]> git.lizzy.rs Git - minetest.git/blobdiff - src/server.cpp
Fix android build using hardcoded path for data instead of using the one fetched...
[minetest.git] / src / server.cpp
index 93d00f3698a7af0998307f6ea9bd489597a0678a..262970c09a195bdd96615121d2b0e8e40683097d 100644 (file)
@@ -1169,10 +1169,15 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id)
        std::string playername = "";
        PlayerSAO *playersao = NULL;
        m_clients.Lock();
-       RemoteClient* client = m_clients.lockedGetClientNoEx(peer_id, CS_InitDone);
-       if (client != NULL) {
-               playername = client->getName();
-               playersao = emergePlayer(playername.c_str(), peer_id);
+       try {
+               RemoteClient* client = m_clients.lockedGetClientNoEx(peer_id, CS_InitDone);
+               if (client != NULL) {
+                       playername = client->getName();
+                       playersao = emergePlayer(playername.c_str(), peer_id);
+               }
+       } catch (std::exception &e) {
+               m_clients.Unlock();
+               throw;
        }
        m_clients.Unlock();
 
@@ -1459,7 +1464,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                if (playername_length == PLAYERNAME_SIZE) {
                        actionstream<<"Server: Player with name exceeding max length "
                                        <<"tried to connect from "<<addr_s<<std::endl;
-                       DenyAccess(peer_id, L"Name to long");
+                       DenyAccess(peer_id, L"Name too long");
                        return;
                }
 
@@ -3869,7 +3874,7 @@ void Server::SendBlocks(float dtime)
                        RemoteClient *client = m_clients.lockedGetClientNoEx(*i, CS_Active);
 
                        if (client == NULL)
-                               return;
+                               continue;
 
                        total_sending += client->SendingCount();
                        client->GetNextBlocks(m_env,m_emerge, dtime, queue);