1
This commit is contained in:
parent
0aed0c6c0e
commit
ea26404c2b
@ -165,6 +165,11 @@ void App::ProcessGameGateMsg(f8::MsgHdr* hdr)
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(hdr->socket_handle);
|
||||
if (hum) {
|
||||
hdr->hum = hum;
|
||||
#ifdef MYDEBUG
|
||||
if (hum->GetSocketHandle() != hdr->socket_handle) {
|
||||
A8_ABORT();
|
||||
}
|
||||
#endif
|
||||
ProcessNetMsg(handler, hum, hdr);
|
||||
}
|
||||
}
|
||||
|
@ -149,8 +149,6 @@ static Player* InternalCreatePlayer(std::shared_ptr<CustomBattle> p,
|
||||
hum->payload = m->GetNetData()->payload;
|
||||
PlayerMgr::Instance()->
|
||||
CreatePlayerByCustomMember(hum,
|
||||
0,
|
||||
0,
|
||||
m
|
||||
);
|
||||
hum->meta = mt::Hero::GetById(m->GetNetData()->GetHeroId());
|
||||
@ -2425,19 +2423,8 @@ void GGListener::ForceCloseChildSocket(int sockhandle)
|
||||
}
|
||||
|
||||
Player* PlayerMgr::CreatePlayerByCustomMember(Player* hum,
|
||||
long ip_saddr,
|
||||
int socket,
|
||||
std::shared_ptr<CustomMember> member)
|
||||
{
|
||||
#ifdef MYDEBUG
|
||||
a8::XPrintf("CreatePlayerByCustomMember account_id:%s socket_handle:%d\n",
|
||||
{
|
||||
hum->account_id,
|
||||
socket,
|
||||
});
|
||||
#endif
|
||||
hum->SetSocketHandle(socket);
|
||||
hum->SetIpSaddr(ip_saddr);
|
||||
hum->account_id = member->GetAccountId();
|
||||
hum->session_id = member->GetSessionId();
|
||||
hum->name = member->GetName();
|
||||
@ -2469,9 +2456,6 @@ Player* PlayerMgr::CreatePlayerByCustomMember(Player* hum,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (socket) {
|
||||
socket_hash_[socket] = hum;
|
||||
}
|
||||
return hum;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
|
||||
|
||||
int OnlineNum();
|
||||
Player* GetPlayerBySocket(int socket);
|
||||
Player* CreatePlayerByCustomMember(Player* hum, long ip_saddr, int socket,
|
||||
Player* CreatePlayerByCustomMember(Player* hum,
|
||||
std::shared_ptr<CustomMember> member);
|
||||
size_t GetAccountNum() { return account_num_hash_.size(); }
|
||||
void IncAccountNum(const std::string& account_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user