1
This commit is contained in:
parent
0542ded043
commit
efbfca944a
@ -112,7 +112,7 @@ bool App::Init(int argc, char* argv[])
|
||||
JsonDataMgr::Instance()->Init();
|
||||
uuid.SetMachineId((node_id - 1) * MAX_NODE_ID + instance_id);
|
||||
DownStreamMgr::Instance()->Init();
|
||||
MasterSvrMgr::Instance()->Init();
|
||||
MasterMgr::Instance()->Init();
|
||||
UpStreamMgr::Instance()->Init();
|
||||
GCListener::Instance()->Init();
|
||||
|
||||
@ -168,7 +168,7 @@ void App::UnInit()
|
||||
{
|
||||
a8::XPrintf("wsproxy terminating instance_id:%d pid:%d\n", {instance_id, getpid()});
|
||||
GCListener::Instance()->UnInit();
|
||||
MasterSvrMgr::Instance()->UnInit();
|
||||
MasterMgr::Instance()->UnInit();
|
||||
UpStreamMgr::Instance()->UnInit();
|
||||
DownStreamMgr::Instance()->UnInit();
|
||||
JsonDataMgr::Instance()->UnInit();
|
||||
@ -355,7 +355,7 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
|
||||
ss::SS_CMLogin msg;
|
||||
bool ok = msg.ParseFromArray(hdr.buf + hdr.offset, hdr.buflen - hdr.offset);
|
||||
if (ok) {
|
||||
MasterSvrMgr::Instance()->RequestTargetServer(hdr,
|
||||
MasterMgr::Instance()->RequestTargetServer(hdr,
|
||||
msg.team_uuid(),
|
||||
msg.account_id(),
|
||||
"",
|
||||
@ -369,7 +369,7 @@ void App::ProcessClientMsg(f8::MsgHdr& hdr)
|
||||
ss::SS_CMReconnect msg;
|
||||
bool ok = msg.ParseFromArray(hdr.buf + hdr.offset, hdr.buflen - hdr.offset);
|
||||
if (ok) {
|
||||
MasterSvrMgr::Instance()->RequestTargetServer(hdr,
|
||||
MasterMgr::Instance()->RequestTargetServer(hdr,
|
||||
msg.team_uuid(),
|
||||
msg.account_id(),
|
||||
msg.server_info(),
|
||||
@ -403,8 +403,8 @@ void App::ProcessMasterServerMsg(f8::MsgHdr& hdr)
|
||||
hdr.msgid);
|
||||
if (handler) {
|
||||
switch (handler->handlerid) {
|
||||
case HID_MasterSvrMgr:
|
||||
ProcessNetMsg(handler, MasterSvrMgr::Instance(), hdr);
|
||||
case HID_MasterMgr:
|
||||
ProcessNetMsg(handler, MasterMgr::Instance(), hdr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -442,7 +442,7 @@ void App::ProcessIMMsg()
|
||||
case IM_ClientSocketDisconnect:
|
||||
{
|
||||
DownStreamMgr::Instance()->OnClientDisconnect(pdelnode->params);
|
||||
MasterSvrMgr::Instance()->RemoveRequest(pdelnode->params.param1, pdelnode->params.sender, true);
|
||||
MasterMgr::Instance()->RemoveRequest(pdelnode->params.param1, pdelnode->params.sender, true);
|
||||
}
|
||||
break;
|
||||
case IM_UpStreamConnect:
|
||||
|
@ -21,7 +21,7 @@ enum InnerMesssage_e
|
||||
enum NetHandler_e
|
||||
{
|
||||
HID_GCListener,
|
||||
HID_MasterSvrMgr,
|
||||
HID_MasterMgr,
|
||||
};
|
||||
|
||||
enum PlayerState_e
|
||||
|
@ -42,7 +42,7 @@ void HandlerMgr::UnInit()
|
||||
|
||||
void HandlerMgr::RegisterNetMsgHandlers()
|
||||
{
|
||||
RegisterNetMsgHandler(&msmsghandler, &MasterSvrMgr::_SS_MS_ResponseTargetServer);
|
||||
RegisterNetMsgHandler(&msmsghandler, &MasterMgr::_SS_MS_ResponseTargetServer);
|
||||
}
|
||||
|
||||
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "app.h"
|
||||
#include "downstreammgr.h"
|
||||
|
||||
void MasterSvrMgr::Init()
|
||||
void MasterMgr::Init()
|
||||
{
|
||||
curr_context_id_ = a8::MakeInt64(0, time(nullptr) + 1000 * 60 * 10);
|
||||
|
||||
@ -35,11 +35,11 @@ void MasterSvrMgr::Init()
|
||||
}
|
||||
}
|
||||
|
||||
void MasterSvrMgr::UnInit()
|
||||
void MasterMgr::UnInit()
|
||||
{
|
||||
}
|
||||
|
||||
void MasterSvrMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_ResponseTargetServer& msg)
|
||||
void MasterMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_ResponseTargetServer& msg)
|
||||
{
|
||||
f8::MsgHdr* context_hdr = GetHdrByContextId(msg.context_id());
|
||||
if (context_hdr) {
|
||||
@ -60,13 +60,13 @@ void MasterSvrMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_
|
||||
}
|
||||
}
|
||||
|
||||
MasterSvr* MasterSvrMgr::GetConnById(int instance_id)
|
||||
MasterSvr* MasterMgr::GetConnById(int instance_id)
|
||||
{
|
||||
auto itr = mastersvr_hash_.find(instance_id);
|
||||
return itr != mastersvr_hash_.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr,
|
||||
void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr,
|
||||
const std::string& team_id,
|
||||
const std::string& account_id,
|
||||
const std::string& server_info,
|
||||
@ -141,7 +141,7 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr,
|
||||
});
|
||||
}
|
||||
a8::Timer::Instance()->RemoveTimerAfterFunc(a8::Timer::Instance()->GetRunningTimer());
|
||||
MasterSvrMgr::Instance()->RemoveRequest(
|
||||
MasterMgr::Instance()->RemoveRequest(
|
||||
param.param1,
|
||||
param.sender,
|
||||
true
|
||||
@ -177,7 +177,7 @@ void MasterSvrMgr::RequestTargetServer(f8::MsgHdr& hdr,
|
||||
}
|
||||
}
|
||||
|
||||
void MasterSvrMgr::RemoveRequest(int socket_handle, long long context_id, bool auto_free)
|
||||
void MasterMgr::RemoveRequest(int socket_handle, long long context_id, bool auto_free)
|
||||
{
|
||||
#if 0
|
||||
if (context_id == GetContextIdBySocket(socket_handle)) {
|
||||
@ -199,13 +199,13 @@ void MasterSvrMgr::RemoveRequest(int socket_handle, long long context_id, bool a
|
||||
#endif
|
||||
}
|
||||
|
||||
long long MasterSvrMgr::GetContextIdBySocket(int socket_handle)
|
||||
long long MasterMgr::GetContextIdBySocket(int socket_handle)
|
||||
{
|
||||
auto itr = pending_socket_hash_.find(socket_handle);
|
||||
return itr != pending_socket_hash_.end() ? itr->second : 0;
|
||||
}
|
||||
|
||||
f8::MsgHdr* MasterSvrMgr::GetHdrByContextId(long long context_id)
|
||||
f8::MsgHdr* MasterMgr::GetHdrByContextId(long long context_id)
|
||||
{
|
||||
auto itr = pending_request_hash_.find(context_id);
|
||||
return itr != pending_request_hash_.end() ? itr->second : nullptr;
|
||||
|
@ -11,14 +11,14 @@ namespace ss
|
||||
}
|
||||
|
||||
class MasterSvr;
|
||||
class MasterSvrMgr : public a8::Singleton<MasterSvrMgr>
|
||||
class MasterMgr : public a8::Singleton<MasterMgr>
|
||||
{
|
||||
public:
|
||||
enum { HID = HID_MasterSvrMgr };
|
||||
enum { HID = HID_MasterMgr };
|
||||
|
||||
private:
|
||||
MasterSvrMgr() {};
|
||||
friend class a8::Singleton<MasterSvrMgr>;
|
||||
MasterMgr() {};
|
||||
friend class a8::Singleton<MasterMgr>;
|
||||
|
||||
public:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user