📄 gamedbproxysession.cpp
字号:
#include "stdafx.h"
#include <PacketStruct.h>
#include <PacketStruct_DM.h>
#include <Protocol_DM.h>
#include <const.h>
#include "GameDBProxySession.h"
#include "MasterServer.h"
#include "PacketHandler.h"
#include "ServerInfoManager.h"
GameDBProxySession::GameDBProxySession()
{
}
GameDBProxySession::~GameDBProxySession()
{
}
VOID GameDBProxySession::Init()
{
ServerSession::Init();
}
VOID GameDBProxySession::Release()
{
ServerSession::Release();
}
VOID GameDBProxySession::Update()
{
ServerSession::Update();
}
VOID GameDBProxySession::OnRedirect()
{
MessageOut( eCRITICAL_LOG, "Game DB proxy connected." );
// 立加茄 霸烙 叼厚 橇遏矫狼 府郊 沥焊甫 焊郴霖促.
SERVER_KEY key = GetServerKey();
BYTE byWorldId = key.GetWorldID();
SERVER_INFO gameDBProxyInfo;
ServerInfoManager::Instance()->GetGameDBProxyInfo( byWorldId, &gameDBProxyInfo );
MSG_DM_CONNECTION_SERVER_INFO_CMD sendMsg;
sendMsg.m_byCategory = DM_CONNECTION;
sendMsg.m_byProtocol = DM_CONNECTION_SERVER_INFO_CMD;
sendMsg.m_ServerKey = key;
sendMsg.m_dwServerGUID = gameDBProxyInfo.dwServerGUID;
strncpy( sendMsg.m_szDBProxyServerIP, gameDBProxyInfo.szInnerIP, MAX_IP_STRING_LEN );
sendMsg.m_wDBProxyServerPort = gameDBProxyInfo.wInnerPort;
Send( (BYTE*)&sendMsg, sizeof(sendMsg) );
}
VOID GameDBProxySession::OnConnect( BOOL bSuccess, DWORD dwNetworkIndex )
{
ServerSession::OnConnect( bSuccess, dwNetworkIndex );
}
VOID GameDBProxySession::OnDisconnect()
{
ServerSession::OnDisconnect();
SERVER_KEY key = GetServerKey();
MessageOut( eCRITICAL_LOG, "Game DB proxy disconnected.[%u]", key.GetWorldID() );
}
VOID GameDBProxySession::OnRecv( BYTE *pMsg, WORD wSize )
{
MSG_BASE *pBaseMsg = (MSG_BASE*)pMsg;
PacketHandler::Instance()->ParsePacket_DM( this, (MSG_BASE*)pMsg, wSize );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -