diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index 952ff6f..4a12daa 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -933,4 +933,12 @@ void PlayerManager::setSpecialState(CNSocket* sock, CNPacketData* data) { sock->sendPacket((void*)&response, P_FE2CL_REP_PC_SPECIAL_STATE_SWITCH_SUCC, sizeof(sP_FE2CL_REP_PC_SPECIAL_STATE_SWITCH_SUCC)); sendToViewable(sock, (void*)&response, P_FE2CL_PC_SPECIAL_STATE_CHANGE, sizeof(sP_FE2CL_PC_SPECIAL_STATE_CHANGE)); } + +CNSocket* PlayerManager::getSockFromID(int32_t iID) { + for (auto& pair : PlayerManager::players) + if (pair.second.plr->iID == iID) + return pair.first; + + return nullptr; +} #pragma endregion diff --git a/src/PlayerManager.hpp b/src/PlayerManager.hpp index f4fafb4..d551fbe 100644 --- a/src/PlayerManager.hpp +++ b/src/PlayerManager.hpp @@ -66,4 +66,5 @@ namespace PlayerManager { bool isAccountInUse(int accountId); void exitDuplicate(int accountId); void setSpecialState(CNSocket* sock, CNPacketData* data); + CNSocket* getSockFromID(int32_t iID); }