mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-02-05 04:10:04 +00:00
Properly clean up players that have been kicked as duplicates.
This should fix the issue with null pointers in PlayerManager::players.
This commit is contained in:
@@ -56,7 +56,8 @@ void CNShardServer::newConnection(CNSocket* cns) {
|
||||
cns->setActiveKey(SOCKETKEY_E); // by default they accept keys encrypted with the default key
|
||||
}
|
||||
|
||||
void CNShardServer::killConnection(CNSocket* cns) {
|
||||
// must be static to be called from PlayerManager::exitDuplicate()
|
||||
void CNShardServer::_killConnection(CNSocket* cns) {
|
||||
// check if the player ever sent a REQ_PC_ENTER
|
||||
if (PlayerManager::players.find(cns) == PlayerManager::players.end())
|
||||
return;
|
||||
@@ -76,6 +77,10 @@ void CNShardServer::killConnection(CNSocket* cns) {
|
||||
CNSharedData::erasePlayer(key);
|
||||
}
|
||||
|
||||
void CNShardServer::killConnection(CNSocket *cns) {
|
||||
_killConnection(cns);
|
||||
}
|
||||
|
||||
void CNShardServer::onStep() {
|
||||
time_t currTime = getTime();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user