📄 gameserversession.cpp
字号:
#include "stdafx.h"
#include ".\gameserversession.h"
#include "PacketHandler.h"
#include <PacketStruct.h>
#include "DBUser.h"
#include <Global.h>
GameServerSession::GameServerSession()
{
}
GameServerSession::~GameServerSession()
{
}
VOID GameServerSession::OnRecv( BYTE * pMsg, WORD wSize )
{
PacketHandler::Instance()->ParsePacket( PACKET_HANDLER_GAME, this, (MSG_BASE *)pMsg, wSize );
}
class DisconnectRelatedGame
{
DWORD m_dwIndex;
public:
DisconnectRelatedGame( DWORD idx ):m_dwIndex(idx){}
~DisconnectRelatedGame(){}
VOID operator()( DBUser * pUser )
{
// Link等 蜡历甫 昏力茄促.
if( pUser->GetServerSessionIndex() == m_dwIndex )
{
SUNLOG(eFULL_LOG, "[霸烙辑滚(%u)辆丰,U:(%u)]昏力", m_dwIndex, pUser->GetUserKey() );
pUser->UpdateDataToDB();
g_DBUserManager.MoveUserToCacheList( pUser->GetUserKey() );
}
}
};
VOID GameServerSession::OnDisconnect()
{
DisconnectRelatedGame op(GetSessionIndex());
removeRelatedUsers(op);
ServerSession::OnDisconnect();
}
VOID GameServerSession::DBResult( BYTE cate, BYTE ptcl, QueryResult * pData )
{
MSG_DBPROXY_RESULT msg;
msg.m_byCategory = cate;
msg.m_byProtocol = ptcl;
msg.m_pData = pData;
PacketHandler::Instance()->ParsePacket( PACKET_HANDLER_GAME, this, &msg, sizeof(MSG_DBPROXY_RESULT) );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -