mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Add helper function to get socket from player ID
Co-authored-by: Jade <jadeshrinemaiden@gmail.com>
This commit is contained in:
parent
21b7500e13
commit
1b55ab44e3
@ -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));
|
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));
|
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
|
#pragma endregion
|
||||||
|
@ -66,4 +66,5 @@ namespace PlayerManager {
|
|||||||
bool isAccountInUse(int accountId);
|
bool isAccountInUse(int accountId);
|
||||||
void exitDuplicate(int accountId);
|
void exitDuplicate(int accountId);
|
||||||
void setSpecialState(CNSocket* sock, CNPacketData* data);
|
void setSpecialState(CNSocket* sock, CNPacketData* data);
|
||||||
|
CNSocket* getSockFromID(int32_t iID);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user