#include "StdAfx.h" #include "LogicGateManager.h" CLogicGateManager::CLogicGateManager(CLogicServer* lpLogicServer) :Inherited() { m_pLogicServer = lpLogicServer; } CLogicGateManager::~CLogicGateManager() { } VOID CLogicGateManager::Initialize() { int i; for ( i=0; iGetSessionClient(); if (pSessionClient) { pSessionClient->PostQuerySessionExistsResult(nSessionId,boOnline?1:0); } } void CLogicGateManager::CloseAllGates() { for (INT_PTR i=0;i =0 && nGateIndex < MaxGateCount ) //判断是否是合法的网关 { if( m_Gates[nGateIndex].connected()) //如果这个数据生效的 { m_Gates[nGateIndex].PostInternalMessage(SSM_RECV_LOGIN_DATA,uParam1,uParam2,0,0); } else { GetLogicServer()->GetSessionClient()->FreeBackUserDataPacket(pDataPacket); } } } //数据服务器发来的消息 else if(uParam1 == jxInterSrvComm::DbServerProto::dcGetActorList || uParam1 == jxInterSrvComm::DbServerProto::dcCreateActor || uParam1 == jxInterSrvComm::DbServerProto::dcDeleteActor || uParam1 == jxInterSrvComm::DbServerProto::dcGetRandName || uParam1 == jxInterSrvComm::DbServerProto::dcCheckSecondPsw || uParam1 == jxInterSrvComm::DbServerProto::dcCreateSecondPsw ) { int nGateIndex= (int)uParam3; //先读取网关的编号 if(nGateIndex >=0 && nGateIndex < MaxGateCount ) //判断是否是合法的网关 { if( m_Gates[nGateIndex].connected()) //如果这个数据生效的 { m_Gates[nGateIndex].PostInternalMessage(SSM_RECV_LOGIN_DATA,uParam1,uParam2,0,0); } else { GetLogicServer()->GetDbClient()->FreeBackUserDataPacket(pDataPacket); } } } //会话服务器发来的消息 else if(uParam1 == jxInterSrvComm::SessionServerProto::sSimulateCheckPasswdResult) //session发来的检测密码的 { int nGateIndex= (int)uParam3; //先读取网关的编号 if(nGateIndex >=0 && nGateIndex < MaxGateCount ) //判断是否是合法的网关 { if( m_Gates[nGateIndex].connected()) //如果这个数据生效的 { m_Gates[nGateIndex].PostInternalMessage(SSM_RECV_LOGIN_DATA,uParam1,uParam2,0,uParam4); } } } } } else if(uMsg ==SGIM_RECV_LOGIN_CMD) //是使用原始的数据进来的 { //登陆的结构 if(uParam1 == jxInterSrvComm::SessionServerProto::sCheckPasswdResult) { int nGateIndex = (int)uParam2; if(nGateIndex >=0 && nGateIndex < MaxGateCount ) //判断是否是合法的网关 { //使用内部消息传过去 if( m_Gates[nGateIndex].connected()) //如果这个数据生效的 { m_Gates[nGateIndex].PostInternalMessage(SSM_RECV_LOGIN_CMD,uParam1,uParam3,uParam4,0); } } } } else if(uMsg ==SGIM_POST_KICK_USER) //需要踢人了 { for (INT_PTR i=0;i