mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Fix locking bugs and make inventory deserialization errors more specific
This commit is contained in:
parent
6bc4cad0ed
commit
c061bdd37f
@ -938,7 +938,7 @@ void Inventory::deSerialize(std::istream &is)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw SerializationError("invalid inventory specifier");
|
||||
throw SerializationError("invalid inventory specifier: " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user