📄 handler_gm.cpp
字号:
#include "stdafx.h"
#include "Handler_GM.h"
#include "ServerInfoManager.h"
#include "GameServerSession.h"
#include <PacketStruct_GM.h>
#include <Protocol_GM.h>
// 烹拳樊 RTTA肺 傈价 困秦
#include <PacketStruct_MO.h>
#include <Protocol_MO.h>
#include "MasterServer.h"
#include "ServerSessionManager.h"
// 辑滚 沥惑辆丰 橇肺配妮 困秦
#include <Protocol_ServerCommon.h>
#include <PacketStruct_ServerCommon.h>
VOID Handler_GM::OnSERVERCOMMON_HEARTBEAT( GameServerSession *pGameServerSession, MSG_BASE *pMsg, WORD wSize )
{
}
// 辑滚喊 烹拳樊
VOID Handler_GM::OnGM_USERMONEY_NTF( GameServerSession *pGameServerSession, MSG_BASE *pMsg, WORD wSize )
{
MSG_GM_USERMONEY_NTF *pRecvMsg = (MSG_GM_USERMONEY_NTF*)pMsg;
SERVER_KEY sServerKey = pGameServerSession->GetServerKey();
MasterServer::Instance()->SetMoney( sServerKey,
pRecvMsg->dwTotalGetMoney,
pRecvMsg->dwTotalLoseMoney,
pRecvMsg->dwTotalUserMoney );
MessageOut(eFULL_LOG, "GM_USERMONEY_NTF[W:%u C:%u S:%u] Set(%u,%u,%u)", sServerKey.GetWorldID(),
sServerKey.GetChannelID(),
sServerKey.GetServerID(),
pRecvMsg->dwTotalGetMoney,
pRecvMsg->dwTotalLoseMoney,
pRecvMsg->dwTotalUserMoney );
}
// 沥惑 辆丰 橇肺配妮
VOID Handler_GM::OnSERVERCOMMON_SERVERSHUTDOWN_ANS( GameServerSession *pGameServerSession, MSG_BASE *pMsg, WORD wSize )
{
// 辆丰 措扁吝牢 仇捞 辆丰等 巴捞骨肺 眉农
if( MasterServer::Instance()->IsExitServer() && MasterServer::Instance()->IsSendExit() )
{
MasterServer::Instance()->RemoveExitServer( pGameServerSession->GetServerKey() ); // 辆丰登菌促!
MessageOut( eFULL_LOG, "Game Exit Message Recv[%u]", pGameServerSession->GetServerKey() );
}
}
VOID Handler_GM::OnGM_OPERATION_USERMONEY_AND( GameServerSession *pGameServerSession, MSG_BASE *pMsg, WORD wSize )
{
MSG_GM_OPERATION_USERMONEY_ANS* pRecvMsg = (MSG_GM_OPERATION_USERMONEY_ANS*)pMsg;
MSG_MO_RTTG_USERMONEY_ANS sendMsg;
sendMsg.ServerKey = pGameServerSession->GetServerKey();
sendMsg.dwTotalUserMoney = pRecvMsg->dwUserMoney;
sendMsg.ui64TotalGetMoney = pRecvMsg->ui64TotalPlusMoney;
sendMsg.ui64TotalLoseMoney = pRecvMsg->ui64TotalMinusMoney;
ServerSession *pOpServer = ServerSessionManager::Instance()->GetOpServer();
if( !pOpServer )
{
MessageOut( eCRITICAL_LOG, "RTTA 烹拳樊 焊绊 角菩:No Data[%u/%u/%u/%u]", sendMsg.ServerKey.GetWorldID(),
sendMsg.ServerKey.GetChannelID(),
sendMsg.ServerKey.GetServerType(),
sendMsg.ServerKey.GetServerID() );
return;
}
pOpServer->Send( (BYTE*)&sendMsg, sizeof(sendMsg) );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -