⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamedbproxysession.cpp

📁 奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码
💻 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 + -