2017-08-19 00:18:40 +02:00
|
|
|
#include <src/servers/Server_Common/Common.h>
|
|
|
|
#include <src/servers/Server_Common/Network/CommonNetwork.h>
|
|
|
|
#include <src/servers/Server_Common/Database/Database.h>
|
|
|
|
#include <src/servers/Server_Common/Util/Util.h>
|
|
|
|
#include <src/servers/Server_Common/Util/UtilNetwork.h>
|
|
|
|
#include <src/servers/Server_Common/Logging/Logger.h>
|
|
|
|
#include <src/servers/Server_Common/Network/PacketContainer.h>
|
2017-08-08 13:53:47 +02:00
|
|
|
#include <boost/format.hpp>
|
|
|
|
|
|
|
|
#include "GameConnection.h"
|
|
|
|
|
2017-08-18 17:16:15 +02:00
|
|
|
#include "src/servers/Server_Zone/ServerZone.h"
|
|
|
|
#include "src/servers/Server_Zone/Session.h"
|
|
|
|
#include "src/servers/Server_Zone/Zone/Zone.h"
|
|
|
|
#include "src/servers/Server_Zone/Network/PacketWrappers/InitUIPacket.h"
|
|
|
|
#include "src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h"
|
|
|
|
#include "src/servers/Server_Zone/Actor/Player.h"
|
|
|
|
#include "src/servers/Server_Zone/Forwards.h"
|
|
|
|
|
|
|
|
extern Core::DebugCommandHandler g_gameCommandMgr;
|
2017-08-08 13:53:47 +02:00
|
|
|
extern Core::Logger g_log;
|
|
|
|
extern Core::ServerZone g_serverZone;
|
|
|
|
|
|
|
|
using namespace Core::Common;
|
|
|
|
using namespace Core::Network::Packets;
|
|
|
|
using namespace Core::Network::Packets::Server;
|
|
|
|
|
|
|
|
Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
|
|
|
|
Core::Network::AcceptorPtr pAcceptor )
|
|
|
|
: Connection( pHive )
|
|
|
|
, m_pAcceptor( pAcceptor )
|
|
|
|
, m_conType( ConnectionType::None )
|
|
|
|
{
|
2017-08-20 22:31:23 +02:00
|
|
|
auto setZoneHandler = [=]( uint16_t opcode, std::string handlerName, GameConnection::Handler pHandler )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2017-08-20 22:31:23 +02:00
|
|
|
m_zoneHandlerMap[opcode] = pHandler;
|
2017-08-08 13:53:47 +02:00
|
|
|
m_packetHandlerStrMap[opcode] = handlerName;
|
|
|
|
};
|
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::PingHandler, "PingHandler", &GameConnection::pingHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::InitHandler, "InitHandler", &GameConnection::initHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::ChatHandler, "ChatHandler", &GameConnection::chatHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::FinishLoadingHandler, "FinishLoadingHandler", &GameConnection::finishLoadingHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::PlayTimeHandler, "PlayTimeHandler", &GameConnection::playTimeHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::LogoutHandler, "LogoutHandler", &GameConnection::logoutHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::SocialListHandler, "SocialListHandler", &GameConnection::socialListHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::SetSearchInfoHandler, "SetSearchInfoHandler", &GameConnection::setSearchInfoHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::ReqSearchInfoHandler, "ReqSearchInfoHandler", &GameConnection::reqSearchInfoHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::BlackListHandler, "BlackListHandler", &GameConnection::blackListHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::LinkshellListHandler, "LinkshellListHandler", &GameConnection::linkshellListHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::FcInfoReqHandler, "FcInfoReqHandler", &GameConnection::fcInfoReqHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::ZoneLineHandler, "ZoneLineHandler", &GameConnection::zoneLineHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::ActionHandler, "ActionHandler", &GameConnection::actionHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::DiscoveryHandler, "DiscoveryHandler", &GameConnection::discoveryHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::SkillHandler, "SkillHandler", &GameConnection::skillHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::GMCommand1, "GMCommand1", &GameConnection::gm1Handler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::GMCommand2, "GMCommand2", &GameConnection::gm2Handler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::UpdatePositionHandler,"UpdatePositionHandler", &GameConnection::updatePositionHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::InventoryModifyHandler,"InventoryModifyHandler", &GameConnection::inventoryModifyHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::TalkEventHandler, "EventHandler", &GameConnection::eventHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::EmoteEventHandler, "EventHandler", &GameConnection::eventHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::WithinRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::OutOfRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::EnterTeriEventHandler, "EventHandler", &GameConnection::eventHandler );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::ReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
|
|
|
|
setZoneHandler( ClientZoneIpcType::TradeReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
|
2017-08-12 23:20:26 +09:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
setZoneHandler( ClientZoneIpcType::CFDutyInfoHandler, "CFDutyInfoRequest", &GameConnection::cfDutyInfoRequest );
|
|
|
|
setZoneHandler( ClientZoneIpcType::CFRegisterDuty, "CFRegisterDuty", &GameConnection::cfRegisterDuty );
|
|
|
|
setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
|
|
|
|
setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
|
2017-08-12 23:20:26 +09:00
|
|
|
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Core::Network::GameConnection::~GameConnection()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// overwrite the parents onConnect for our game socket needs
|
|
|
|
void Core::Network::GameConnection::OnAccept( const std::string & host, uint16_t port )
|
|
|
|
{
|
|
|
|
GameConnectionPtr connection( new GameConnection( m_hive, m_pAcceptor ) );
|
|
|
|
m_pAcceptor->Accept( connection );
|
|
|
|
|
|
|
|
g_log.info( "Connect from " + m_socket.remote_endpoint().address().to_string() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::OnDisconnect()
|
|
|
|
{
|
|
|
|
g_log.debug( "DISCONNECT" );
|
|
|
|
m_pSession = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::OnRecv( std::vector< uint8_t > & buffer )
|
|
|
|
{
|
|
|
|
Packets::FFXIVARR_PACKET_HEADER ipcHeader;
|
|
|
|
std::vector< Packets::FFXIVARR_PACKET_RAW > packetList;
|
|
|
|
|
|
|
|
Network::Util::bufferToPacketList( buffer, ipcHeader, packetList );
|
|
|
|
|
|
|
|
handlePackets( ipcHeader, packetList );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::OnError( const boost::system::error_code & error )
|
|
|
|
{
|
|
|
|
g_log.debug( "ERROR" );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::queueInPacket( Core::Network::Packets::GamePacketPtr inPacket )
|
|
|
|
{
|
|
|
|
m_inQueue.push( inPacket );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::queueOutPacket( Core::Network::Packets::GamePacketPtr outPacket )
|
|
|
|
{
|
|
|
|
m_outQueue.push( outPacket );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::handleGamePacket( Core::Network::Packets::GamePacketPtr pPacket )
|
|
|
|
{
|
|
|
|
if( !m_pSession )
|
|
|
|
return;
|
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
/*if( m_conType == Network::ConnectionType::Zone )
|
|
|
|
{
|
|
|
|
g_log.debug( "Zone Packet" );
|
|
|
|
}
|
|
|
|
else if( m_conType == Network::ConnectionType::Chat )
|
|
|
|
{
|
|
|
|
g_log.debug( "Chat Packet" );
|
|
|
|
}*/
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-20 22:31:23 +02:00
|
|
|
auto it = m_zoneHandlerMap.find( pPacket->getSubType() );
|
|
|
|
|
|
|
|
if( it != m_zoneHandlerMap.end() )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
auto name = m_packetHandlerStrMap[pPacket->getSubType()];
|
|
|
|
// dont display packet notification if it is a ping or pos update, don't want the spam
|
2017-08-20 22:31:23 +02:00
|
|
|
if( pPacket->getSubType() != ClientZoneIpcType::PingHandler &&
|
|
|
|
pPacket->getSubType() != ClientZoneIpcType::UpdatePositionHandler )
|
2017-08-08 13:53:47 +02:00
|
|
|
g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Handling packet : " + name + "( " +
|
|
|
|
boost::str( boost::format( "%|04X|" ) % static_cast< uint32_t >( pPacket->getSubType() & 0xFFFF ) ) + " )" );
|
|
|
|
|
2017-08-17 17:30:00 +02:00
|
|
|
( this->*( it->second ) )( *pPacket, m_pSession->getPlayer() );
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Undefined packet : Unknown ( " +
|
|
|
|
boost::str( boost::format( "%|04X|" ) % static_cast< uint32_t >( pPacket->getSubType() & 0xFFFF ) ) + " )" );
|
|
|
|
g_log.debug( pPacket->toString() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::sendPackets( Packets::PacketContainer * pPacket )
|
|
|
|
{
|
|
|
|
//g_log.Log(LoggingSeverity::info, pPacket->toString());
|
|
|
|
std::vector< uint8_t > sendBuffer;
|
|
|
|
|
|
|
|
pPacket->fillSendBuffer( sendBuffer );
|
|
|
|
Send( sendBuffer );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::processInQueue()
|
|
|
|
{
|
|
|
|
// handle the incoming game packets
|
|
|
|
while( auto pPacket = m_inQueue.pop() )
|
|
|
|
{
|
|
|
|
handleGamePacket( pPacket );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::processOutQueue()
|
|
|
|
{
|
|
|
|
|
|
|
|
if( m_outQueue.size() < 1 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
int32_t totalSize = 0;
|
|
|
|
|
|
|
|
// create a new packet container
|
|
|
|
PacketContainer pRP = PacketContainer();
|
|
|
|
|
|
|
|
// get next packet off the queue
|
|
|
|
while( auto pPacket = m_outQueue.pop() )
|
|
|
|
{
|
|
|
|
if( pPacket->getSize() == 0 )
|
|
|
|
{
|
|
|
|
g_log.debug( "end of packet set" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
pRP.addPacket( *pPacket );
|
|
|
|
totalSize += pPacket->getSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( totalSize > 0 )
|
|
|
|
sendPackets( &pRP );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::sendSinglePacket( Packets::GamePacket * pPacket )
|
|
|
|
{
|
|
|
|
PacketContainer pRP = PacketContainer();
|
|
|
|
pRP.addPacket( *pPacket );
|
|
|
|
sendPackets( &pRP );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::injectPacket( const std::string& packetpath, Core::Entity::PlayerPtr pPlayer )
|
|
|
|
{
|
|
|
|
|
|
|
|
char packet[0x11570];
|
|
|
|
memset( packet, 0, 0x11570 );
|
|
|
|
|
|
|
|
// get the packet name / path from the command arguments
|
|
|
|
FILE *fp = nullptr;
|
|
|
|
fp = fopen( packetpath.c_str(), "rb" );
|
|
|
|
if( fp == nullptr )
|
|
|
|
{
|
|
|
|
g_log.error( "Packet " + packetpath + " not found!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// read the packet into the buffer
|
|
|
|
fseek( fp, 0, SEEK_END );
|
|
|
|
int32_t size = ftell( fp );
|
|
|
|
rewind( fp );
|
|
|
|
fread( packet, sizeof( char ), size, fp );
|
|
|
|
fclose( fp );
|
|
|
|
|
|
|
|
// cycle through the packet entries and queue each one
|
2017-08-11 22:56:30 +01:00
|
|
|
for( int32_t k = 0x18; k < size;)
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
uint32_t tmpId = pPlayer->getId();
|
|
|
|
// replace ids in the entryheader if needed
|
|
|
|
if( !memcmp( packet + k + 0x04, packet + k + 0x08, 4 ) )
|
|
|
|
{
|
|
|
|
memcpy( packet + k + 0x04, &tmpId, 4 );
|
|
|
|
memcpy( packet + k + 0x08, &tmpId, 4 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
memcpy( packet + k + 0x08, &tmpId, 4 );
|
|
|
|
|
|
|
|
uint16_t pSize = *reinterpret_cast< uint16_t* >( packet + k );
|
|
|
|
// queue packet to the session
|
|
|
|
if( pSize == 0 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
queueOutPacket( GamePacketPtr( new GamePacket( packet + k, pSize, false ) ) );
|
|
|
|
k += ( pSize );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::Network::GameConnection::handlePackets( const Core::Network::Packets::FFXIVARR_PACKET_HEADER& ipcHeader,
|
|
|
|
const std::vector<Core::Network::Packets::FFXIVARR_PACKET_RAW>& packetData )
|
|
|
|
{
|
|
|
|
// if a session is set, update the last time it recieved a game packet
|
|
|
|
if( m_pSession )
|
|
|
|
m_pSession->updateLastDataTime();
|
|
|
|
|
|
|
|
for( auto inPacket : packetData )
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
switch( inPacket.segHdr.type )
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
char* id = ( char* ) &( inPacket.data[4] );
|
|
|
|
uint32_t playerId = boost::lexical_cast< uint32_t >( id );
|
|
|
|
auto pCon = boost::static_pointer_cast< GameConnection, Connection >( shared_from_this() );
|
|
|
|
|
|
|
|
// try to retrieve the session for this id
|
|
|
|
auto session = g_serverZone.getSession( playerId );
|
|
|
|
|
|
|
|
if( !session )
|
|
|
|
{
|
|
|
|
g_log.info( "[" + std::string( id ) + "] Session not registered, creating" );
|
|
|
|
// return;
|
|
|
|
g_serverZone.createSession( playerId );
|
|
|
|
session = g_serverZone.getSession( playerId );
|
|
|
|
}
|
|
|
|
|
|
|
|
// if not set, set the session for this connection
|
|
|
|
if( !m_pSession && session )
|
|
|
|
m_pSession = session;
|
|
|
|
|
|
|
|
// main connection, assinging it to the session
|
2017-08-20 20:48:55 +02:00
|
|
|
if( ipcHeader.connectionType == ConnectionType::Zone )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
g_log.info( "[" + std::string( id ) + "] Setting session for zone connection" );
|
|
|
|
session->setZoneConnection( pCon );
|
|
|
|
}
|
|
|
|
// chat connection, assinging it to the session
|
2017-08-20 20:48:55 +02:00
|
|
|
else if( ipcHeader.connectionType == ConnectionType::Chat )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
g_log.info( "[" + std::string( id ) + "] Setting session for chat connection" );
|
2017-08-20 20:48:55 +02:00
|
|
|
session->setChatConnection( pCon );
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GamePacket pPe( 0x00, 0x18, 0, 0, 0x07 );
|
|
|
|
pPe.setValAt< uint32_t >( 0x10, 0xE0000005 );
|
|
|
|
pPe.setValAt< uint32_t >( 0x14, static_cast< uint32_t >( time( nullptr ) ) );
|
|
|
|
sendSinglePacket( &pPe );
|
|
|
|
|
|
|
|
pPe = GamePacket( 0x00, 0x38, 0, 0, 0x02 );
|
|
|
|
pPe.setValAt< uint32_t >( 0x10, playerId );
|
|
|
|
sendSinglePacket( &pPe );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
case 3: // game packet
|
|
|
|
{
|
|
|
|
auto pPacket = new GamePacket( inPacket );
|
|
|
|
queueInPacket( Packets::GamePacketPtr( pPacket ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7: // keep alive
|
|
|
|
{
|
|
|
|
uint32_t id = *( uint32_t* ) &inPacket.data[0];
|
|
|
|
uint32_t timeStamp = *( uint32_t* ) &inPacket.data[4];
|
|
|
|
|
|
|
|
GamePacket pPe( 0x00, 0x18, 0, 0, 0x08 );
|
|
|
|
pPe.setValAt< uint32_t >( 0x10, id );
|
|
|
|
pPe.setValAt< uint32_t >( 0x14, timeStamp );
|
|
|
|
sendSinglePacket( &pPe );
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// try to retrieve the session for this id
|
|
|
|
//auto session = g_serverZone.getSession( inPacket.segHdr.source_actor );
|
|
|
|
//auto pCon = boost::static_pointer_cast< GameConnection, Connection >( shared_from_this() );
|
|
|
|
|
|
|
|
//// check if this is a zoning notification
|
|
|
|
//if( *reinterpret_cast< uint16_t* >( &inPacket.data[2] ) == 0x9999 )
|
|
|
|
//{
|
|
|
|
|
|
|
|
// // if we already have a session in this connection, reload the player
|
|
|
|
// if( session )
|
|
|
|
// g_serverZone.updateSession( inPacket.segHdr.source_actor );
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // if not, create a new session
|
|
|
|
// g_serverZone.createSession( inPacket.segHdr.source_actor );
|
|
|
|
// session = g_serverZone.getSession( inPacket.segHdr.source_actor );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // set the zoneingType for the player so the correct animation can be played
|
|
|
|
// auto pPlayer = session->getPlayer();
|
|
|
|
// ZoneingType zoneType = static_cast< ZoneingType >( *reinterpret_cast< uint16_t* >( &inPacket.data[18] ) );
|
|
|
|
// switch( zoneType )
|
|
|
|
// {
|
|
|
|
// case ZoneingType::Teleport:
|
|
|
|
// pPlayer->setTeleporting( true );
|
|
|
|
// break;
|
|
|
|
// case ZoneingType::Return:
|
|
|
|
// pPlayer->setReturning( true );
|
|
|
|
// break;
|
|
|
|
// default:
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// // place this connection in the session
|
|
|
|
// session->setZoneConnection( pCon );
|
|
|
|
// // actually perform the zoning
|
|
|
|
// session->getPlayer()->setZone( *reinterpret_cast< uint16_t* >( &inPacket.data[16] ) );
|
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// if( !session )
|
|
|
|
// {
|
|
|
|
// g_serverZone.createSession( inPacket.segHdr.source_actor );
|
|
|
|
// session = g_serverZone.getSession( inPacket.segHdr.source_actor );
|
|
|
|
// session->setZoneConnection( pCon );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// queueInPacket( GamePacketPtr( new GamePacket( inPacket ) ) );
|
|
|
|
//}
|
|
|
|
|
|
|
|
//// if not set, set the session for this connection
|
|
|
|
//if( !m_pSession && session )
|
|
|
|
// m_pSession = session;
|
|
|
|
}
|
|
|
|
}
|