1
This commit is contained in:
parent
8acbe0abf6
commit
2decd9f875
@ -2266,10 +2266,11 @@ void Human::ReJoin(long ip_saddr, int socket_handle)
|
||||
if (!IsPlayer()) {
|
||||
abort();
|
||||
}
|
||||
if (socket_handle == 0 && GetSocketHandle() != 0) {
|
||||
A8_ABORT();
|
||||
}
|
||||
auto old_socket_handle = GetSocketHandle();
|
||||
if (SocketIsValid()) {
|
||||
GGListener::Instance()->ForceCloseChildSocket(GetSocketHandle());
|
||||
PlayerMgr::Instance()->RemovePlayerBySocket(GetSocketHandle());
|
||||
}
|
||||
SetIpSaddr(ip_saddr);
|
||||
SetSocketHandle(socket_handle);
|
||||
room->frame_event.AddEnterGame(GetWeakPtrRef());
|
||||
@ -2280,7 +2281,9 @@ void Human::ReJoin(long ip_saddr, int socket_handle)
|
||||
PushJoinRoomMsg();
|
||||
RefreshView();
|
||||
room->NotifyUiUpdate();
|
||||
PlayerMgr::Instance()->ReBindSocket(AsPlayer());
|
||||
if (SocketIsValid()) {
|
||||
PlayerMgr::Instance()->ReBindSocket(AsPlayer());
|
||||
}
|
||||
#ifdef MYDEBUG
|
||||
a8::XPrintf("ReJoin account_id:%s old_socket_handle:%d new_socket_handle:%d socket_handle:%d\n",
|
||||
{
|
||||
|
@ -124,6 +124,9 @@ void PlayerMgr::DecAccountNum(const std::string& account_id)
|
||||
|
||||
void PlayerMgr::ReBindSocket(Player* hum)
|
||||
{
|
||||
if (!hum->SocketIsValid()) {
|
||||
A8_ABORT();
|
||||
}
|
||||
#ifdef MYDEBUG
|
||||
a8::XPrintf("ReBindSocket account_id:%s socket_handle:%d\n",
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user