Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f37aed628b | ||
![]() |
e301be3dc1 | ||
![]() |
0e2ac2bb59 | ||
![]() |
7c3edc1074 | ||
![]() |
3e424d81aa | ||
![]() |
72abfd9f94 | ||
![]() |
aa5e6661fc |
@ -73,6 +73,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void OnConnect() override
|
||||||
|
{
|
||||||
|
f8::UdpLog::Instance()->Warning("OnConnect socket_handle:%d", {socket_handle});
|
||||||
|
}
|
||||||
|
|
||||||
virtual void OnRawHttpGet(const std::string& url, const std::string& querystr,
|
virtual void OnRawHttpGet(const std::string& url, const std::string& querystr,
|
||||||
std::string& response) override
|
std::string& response) override
|
||||||
{
|
{
|
||||||
@ -91,6 +96,7 @@ public:
|
|||||||
|
|
||||||
virtual void OnDisConnect() override
|
virtual void OnDisConnect() override
|
||||||
{
|
{
|
||||||
|
f8::UdpLog::Instance()->Warning("OnDisConnect socket_handle:%d", {socket_handle});
|
||||||
f8::MsgQueue::Instance()->PostMsg
|
f8::MsgQueue::Instance()->PostMsg
|
||||||
(IM_ClientSocketDisconnect,
|
(IM_ClientSocketDisconnect,
|
||||||
a8::Args
|
a8::Args
|
||||||
@ -241,7 +247,7 @@ void GGListener::RemoveSocketDisconnectHandler(std::weak_ptr<SocketDisconnectHan
|
|||||||
p->cb = nullptr;
|
p->cb = nullptr;
|
||||||
p->holder = nullptr;
|
p->holder = nullptr;
|
||||||
#if 1
|
#if 1
|
||||||
f8::UdpLog::Instance()->Warning("RemoveSocketDisconnectHandler socket_handle%d time:%d",
|
f8::UdpLog::Instance()->Warning("RemoveSocketDisconnectHandler socket_handle:%d time:%d",
|
||||||
{
|
{
|
||||||
p->socket_handle,
|
p->socket_handle,
|
||||||
a8::XGetTickCount() - p->add_tick
|
a8::XGetTickCount() - p->add_tick
|
||||||
@ -253,5 +259,17 @@ void GGListener::RemoveSocketDisconnectHandler(std::weak_ptr<SocketDisconnectHan
|
|||||||
|
|
||||||
void GGListener::OnClientDisconnect(int socket_handle)
|
void GGListener::OnClientDisconnect(int socket_handle)
|
||||||
{
|
{
|
||||||
|
auto itr = disconnect_listener_hash_.find(socket_handle);
|
||||||
|
if (itr != disconnect_listener_hash_.end()) {
|
||||||
|
std::vector<std::weak_ptr<SocketDisconnectHandler>> del_handlers;
|
||||||
|
SocketDisconnectHandler *handle = nullptr, *tmp = nullptr;
|
||||||
|
list_for_each_entry_safe(handle, tmp, &itr->second, entry) {
|
||||||
|
del_handlers.push_back(handle->holder);
|
||||||
|
handle->cb(a8::Args({itr->first}));
|
||||||
|
}
|
||||||
|
for (auto handler : del_handlers) {
|
||||||
|
RemoveSocketDisconnectHandler(handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
PlayerMgr::Instance()->OnClientDisconnect(socket_handle);
|
PlayerMgr::Instance()->OnClientDisconnect(socket_handle);
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,13 @@ void RoomMgr::_CMJoin(f8::MsgHdr* hdr, const cs::CMJoin& msg)
|
|||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
a8::XPrintf("CMJoin socket_handle:%d\n", {hdr->socket_handle});
|
a8::XPrintf("CMJoin socket_handle:%d\n", {hdr->socket_handle});
|
||||||
|
#endif
|
||||||
|
#if 1
|
||||||
|
f8::UdpLog::Instance()->Warning("CMJoin account_id:%s socket_handle:%d",
|
||||||
|
{
|
||||||
|
msg.account_id(),
|
||||||
|
hdr->socket_handle,
|
||||||
|
});
|
||||||
#endif
|
#endif
|
||||||
if (IsLimitJoin()) {
|
if (IsLimitJoin()) {
|
||||||
JoinErrorHandle(msg, 2, hdr->socket_handle);
|
JoinErrorHandle(msg, 2, hdr->socket_handle);
|
||||||
@ -87,7 +94,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr* hdr, const cs::CMJoin& msg)
|
|||||||
auto member = GetCustomMemberBySocket(hdr->socket_handle);
|
auto member = GetCustomMemberBySocket(hdr->socket_handle);
|
||||||
if (member) {
|
if (member) {
|
||||||
#if 1
|
#if 1
|
||||||
f8::UdpLog::Instance()->Warning("JoinError socket_not_exits socket_handle%d",
|
f8::UdpLog::Instance()->Warning("JoinError socket already exits socket_handle:%d",
|
||||||
{
|
{
|
||||||
hdr->socket_handle,
|
hdr->socket_handle,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user