m_nodedef->setNodeRegistrationStatus(true);
// Perform pending node name resolutions
- m_nodedef->runNodeResolverCallbacks();
+ m_nodedef->runNodeResolveCallbacks();
// init the recipe hashes to speed up crafting
m_craftdef->initHashes(this);
Send(&pkt);
}
-void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason)
+void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason)
{
DSTACK(__FUNCTION_NAME);
{
DSTACK(__FUNCTION_NAME);
PlayerSAO *playersao = getPlayerSAO(peer_id);
- assert(playersao);
+ // In some rare case, if the player is disconnected
+ // while Lua call l_punch, for example, this can be NULL
+ if (!playersao)
+ return;
+
SendHP(peer_id, playersao->getHP());
m_script->player_event(playersao,"health_changed");
pkt.putRawString(datas.c_str(), datas.size());
m_clients.send(pkt.getPeerId(),
- clientCommandFactoryTable[pkt.getCommand()].channel,
+ reliable ? clientCommandFactoryTable[pkt.getCommand()].channel : 1,
&pkt, reliable);
}
}
}
-void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::wstring &custom_reason)
+void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason)
{
DSTACK(__FUNCTION_NAME);