mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Optimized map saving and sending (server-side)
This commit is contained in:
parent
42fb1ba676
commit
2830095366
7 changed files with 174 additions and 61 deletions
14
src/map.cpp
14
src/map.cpp
|
@ -1792,7 +1792,8 @@ void Map::nodeMetadataStep(float dtime,
|
|||
|
||||
ServerMap::ServerMap(std::string savedir):
|
||||
Map(dout_server),
|
||||
m_seed(0)
|
||||
m_seed(0),
|
||||
m_map_metadata_changed(true)
|
||||
{
|
||||
dstream<<__FUNCTION_NAME<<std::endl;
|
||||
|
||||
|
@ -4797,12 +4798,17 @@ void ServerMap::save(bool only_changed)
|
|||
dstream<<DTIME<<"ServerMap: Saving whole map, this can take time."
|
||||
<<std::endl;
|
||||
|
||||
saveMapMeta();
|
||||
if(only_changed == false || m_map_metadata_changed)
|
||||
{
|
||||
saveMapMeta();
|
||||
m_map_metadata_changed = false;
|
||||
}
|
||||
|
||||
// Disable saving chunk metadata file if chunks are disabled
|
||||
// Disable saving chunk metadata if chunks are disabled
|
||||
if(m_chunksize != 0)
|
||||
{
|
||||
saveChunkMeta();
|
||||
if(only_changed == false || anyChunkModified())
|
||||
saveChunkMeta();
|
||||
}
|
||||
|
||||
u32 sector_meta_count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue