1
This commit is contained in:
parent
2401056ac7
commit
765b0b95cf
@ -176,7 +176,7 @@ bool App::HasTask()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::ProcessClientMsg(f8::MsgHdr* hdr, int tag)
|
void App::ProcessClientMsg(f8::MsgHdr* hdr)
|
||||||
{
|
{
|
||||||
if (hdr->msgid == ss::_SS_CMLogin ||
|
if (hdr->msgid == ss::_SS_CMLogin ||
|
||||||
hdr->msgid == ss::_SS_CMReconnect ||
|
hdr->msgid == ss::_SS_CMReconnect ||
|
||||||
@ -235,12 +235,12 @@ void App::ProcessClientMsg(f8::MsgHdr* hdr, int tag)
|
|||||||
} else {
|
} else {
|
||||||
auto down_wp = DownStreamMgr::Instance()->GetDownStream(hdr->socket_handle);
|
auto down_wp = DownStreamMgr::Instance()->GetDownStream(hdr->socket_handle);
|
||||||
if (auto down = down_wp.lock(); !down_wp.expired()) {
|
if (auto down = down_wp.lock(); !down_wp.expired()) {
|
||||||
down->ProcCMMsg(hdr, tag);
|
down->ProcCMMsg(hdr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::ProcessMasterServerMsg(f8::MsgHdr* hdr, int tag)
|
void App::ProcessMasterServerMsg(f8::MsgHdr* hdr)
|
||||||
{
|
{
|
||||||
f8::NetMsgHandler* handler = f8::GetNetMsgHandler(&HandlerMgr::Instance()->msmsghandler,
|
f8::NetMsgHandler* handler = f8::GetNetMsgHandler(&HandlerMgr::Instance()->msmsghandler,
|
||||||
hdr->msgid);
|
hdr->msgid);
|
||||||
@ -253,7 +253,7 @@ void App::ProcessMasterServerMsg(f8::MsgHdr* hdr, int tag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::ProcessTargetServerMsg(f8::MsgHdr* hdr, int tag)
|
void App::ProcessTargetServerMsg(f8::MsgHdr* hdr)
|
||||||
{
|
{
|
||||||
if (hdr->msgid == ss::_SS_ForceCloseSocket) {
|
if (hdr->msgid == ss::_SS_ForceCloseSocket) {
|
||||||
GCListener::Instance()->ForceCloseClient(hdr->socket_handle);
|
GCListener::Instance()->ForceCloseClient(hdr->socket_handle);
|
||||||
@ -367,17 +367,17 @@ void App::DispatchSocketMsg(f8::MsgHdr* hdr)
|
|||||||
switch (hdr->sockfrom) {
|
switch (hdr->sockfrom) {
|
||||||
case SF_Client:
|
case SF_Client:
|
||||||
{
|
{
|
||||||
ProcessClientMsg(hdr, hdr->tag);
|
ProcessClientMsg(hdr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SF_TargetServer:
|
case SF_TargetServer:
|
||||||
{
|
{
|
||||||
ProcessTargetServerMsg(hdr, hdr->tag);
|
ProcessTargetServerMsg(hdr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SF_MasterServer:
|
case SF_MasterServer:
|
||||||
{
|
{
|
||||||
ProcessMasterServerMsg(hdr, hdr->tag);
|
ProcessMasterServerMsg(hdr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,9 @@ private:
|
|||||||
|
|
||||||
void DispatchUdpMsg();
|
void DispatchUdpMsg();
|
||||||
|
|
||||||
void ProcessClientMsg(f8::MsgHdr* hdr, int tag);
|
void ProcessClientMsg(f8::MsgHdr* hdr);
|
||||||
void ProcessMasterServerMsg(f8::MsgHdr* hdr, int tag);
|
void ProcessMasterServerMsg(f8::MsgHdr* hdr);
|
||||||
void ProcessTargetServerMsg(f8::MsgHdr* hdr, int tag);
|
void ProcessTargetServerMsg(f8::MsgHdr* hdr);
|
||||||
|
|
||||||
void FreeUdpMsgQueue();
|
void FreeUdpMsgQueue();
|
||||||
|
|
||||||
|
@ -73,9 +73,9 @@ void DownStream::OnClose()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownStream::ProcCMMsg(f8::MsgHdr* hdr, int tag)
|
void DownStream::ProcCMMsg(f8::MsgHdr* hdr)
|
||||||
{
|
{
|
||||||
if (hdr->msgid == ss::_SS_CMPing && IsLongSession() && tag == ST_Tcp) {
|
if (hdr->msgid == ss::_SS_CMPing && IsLongSession() && hdr->tag == ST_Tcp) {
|
||||||
ss::SS_SMPing msg;
|
ss::SS_SMPing msg;
|
||||||
GCListener::Instance()->SendMsgEx(socket_handle_, ss::_SS_CMPing, msg);
|
GCListener::Instance()->SendMsgEx(socket_handle_, ss::_SS_CMPing, msg);
|
||||||
if (!long_session_wp_.expired()) {
|
if (!long_session_wp_.expired()) {
|
||||||
|
@ -12,7 +12,7 @@ class DownStream
|
|||||||
std::weak_ptr<UpStream> GetUpStream() const { return up_; }
|
std::weak_ptr<UpStream> GetUpStream() const { return up_; }
|
||||||
void ReBindUpStream(std::weak_ptr<UpStream> up);
|
void ReBindUpStream(std::weak_ptr<UpStream> up);
|
||||||
bool IsLongSession() { return is_long_session_; }
|
bool IsLongSession() { return is_long_session_; }
|
||||||
void ProcCMMsg(f8::MsgHdr* hdr, int tag);
|
void ProcCMMsg(f8::MsgHdr* hdr);
|
||||||
|
|
||||||
void ForwardUpStreamMsg(f8::MsgHdr* hdr);
|
void ForwardUpStreamMsg(f8::MsgHdr* hdr);
|
||||||
void OnClose();
|
void OnClose();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user