LuaVoxelManip: Add option to allocate blank data
[oweals/minetest.git] / src / server.cpp
index 857114d0f0fc12461fd5a9c4840aa1c141d813d6..161aaafc71a96196290655c318e7ba06605b4e8b 100644 (file)
@@ -337,7 +337,7 @@ Server::Server(
        m_nodedef->updateAliases(m_itemdef);
 
        // Perform pending node name resolutions
-       m_nodedef->getResolver()->resolveNodes();
+       m_nodedef->runNodeResolverCallbacks();
 
        // Load the mapgen params from global settings now after any
        // initial overrides have been set by the mods
@@ -568,7 +568,7 @@ void Server::AsyncRunStep(bool initial_step)
                m_env->step(dtime);
        }
 
-       const float map_timer_and_unload_dtime = 2.92;
+       static const float map_timer_and_unload_dtime = 2.92;
        if(m_map_timer_and_unload_interval.step(dtime, map_timer_and_unload_dtime))
        {
                JMutexAutoLock lock(m_env_mutex);
@@ -664,7 +664,7 @@ void Server::AsyncRunStep(bool initial_step)
                /*
                        Set the modified blocks unsent for all the clients
                */
-               if(modified_blocks.size() > 0)
+               if(!modified_blocks.empty())
                {
                        SetBlocksNotSent(modified_blocks);
                }
@@ -745,7 +745,7 @@ void Server::AsyncRunStep(bool initial_step)
                                        client->m_known_objects, added_objects);
 
                        // Ignore if nothing happened
-                       if(removed_objects.size() == 0 && added_objects.size() == 0)
+                       if(removed_objects.empty() && added_objects.empty())
                        {
                                //infostream<<"active objects: none changed"<<std::endl;
                                continue;
@@ -1051,7 +1051,7 @@ void Server::AsyncRunStep(bool initial_step)
                        /*
                                Set blocks not sent to far players
                        */
-                       if(far_players.size() > 0)
+                       if(!far_players.empty())
                        {
                                // Convert list format to that wanted by SetBlocksNotSent
                                std::map<v3s16, MapBlock*> modified_blocks2;
@@ -2650,7 +2650,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                        }
 
                } // action == 4
-               
+
 
                /*
                        Catch invalid actions
@@ -2675,7 +2675,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                                continue;
                        ServerPlayingSound &psound = i->second;
                        psound.clients.erase(peer_id);
-                       if(psound.clients.size() == 0)
+                       if(psound.clients.empty())
                                m_playing_sounds.erase(i++);
                }
        }
@@ -3628,7 +3628,7 @@ s32 Server::playSound(const SimpleSoundSpec &spec,
                        dst_clients.push_back(*i);
                }
        }
-       if(dst_clients.size() == 0)
+       if(dst_clients.empty())
                return -1;
 
        // Create the sound
@@ -4322,7 +4322,7 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason)
                {
                        ServerPlayingSound &psound = i->second;
                        psound.clients.erase(peer_id);
-                       if(psound.clients.size() == 0)
+                       if(psound.clients.empty())
                                m_playing_sounds.erase(i++);
                        else
                                i++;
@@ -4468,7 +4468,7 @@ std::wstring Server::getStatusString()
                        name = narrow_to_wide(player->getName());
                // Add name to information string
                if(!first)
-                       os<<L",";
+                       os<<L", ";
                else
                        first = false;
                os<<name;
@@ -4570,7 +4570,7 @@ bool Server::showFormspec(const char *playername, const std::string &formspec, c
 u32 Server::hudAdd(Player *player, HudElement *form) {
        if (!player)
                return -1;
-       
+
        u32 id = player->addHud(form);
 
        SendHUDAdd(player->peer_id, id, form);
@@ -4586,7 +4586,7 @@ bool Server::hudRemove(Player *player, u32 id) {
 
        if (!todel)
                return false;
-       
+
        delete todel;
 
        SendHUDRemove(player->peer_id, id);
@@ -4607,9 +4607,9 @@ bool Server::hudSetFlags(Player *player, u32 flags, u32 mask) {
 
        SendHUDSetFlags(player->peer_id, flags, mask);
        player->hud_flags = flags;
-       
+
        PlayerSAO* playersao = player->getPlayerSAO();
-       
+
        if (playersao == NULL)
                return false;