1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

Overhaul of packet system to allow for an arbitrary amount of packet definition sets

This commit is contained in:
Mordred 2017-08-20 22:31:23 +02:00
parent 5293e50614
commit cbe00da5f8
41 changed files with 244 additions and 204 deletions

View file

@ -125,9 +125,9 @@ namespace Packets {
// TODO: Include structures for the individual packet segment types
/**
* Server IPC Type Codes.
* Server IPC Lobby Type Codes.
*/
enum ServerIpcType : uint16_t
enum ServerLobbyIpcType : uint16_t
{
LobbyError = 0x0002,
LobbyServiceAccountList = 0x000C,
@ -137,6 +137,25 @@ namespace Packets {
LobbyServerList = 0x0015,
LobbyRetainerList = 0x0017,
};
/**
* Client IPC Lobby Type Codes.
*/
enum ClientLobbyIpcType : uint16_t
{
ReqCharList = 0x0003,
ReqEnterWorld = 0x0004,
ReqServiceAccountList = 0x0005,
ReqCharDelete = 0x000A,
ReqCharCreate = 0x000B,
};
/**
* Server IPC Zone Type Codes.
*/
enum ServerZoneIpcType : uint16_t
{
Ping = 0x0065, // updated for sb
Init = 0x0066, // updated for sb
Chat = 0x0067, // updated for sb
@ -215,16 +234,10 @@ namespace Packets {
// TODO: Include structures for the individual packet segment types
/**
* Client IPC Type Codes.
* Client IPC Zone Type Codes.
*/
enum ClientIpcType : uint16_t
enum ClientZoneIpcType : uint16_t
{
ReqCharList = 0x0003,
ReqEnterWorld = 0x0004,
ReqServiceAccountList = 0x0005,
ReqCharDelete = 0x000A,
ReqCharCreate = 0x000B,
TellChatHandler = 0x0064,// updated for sb
@ -278,6 +291,22 @@ namespace Packets {
};
/**
* Server IPC Chat Type Codes.
*/
enum ServerChatIpcType : uint16_t
{
Tell = 0x0064, // updated for sb
};
/**
* Client IPC Chat Type Codes.
*/
enum ClientChatIpcType : uint16_t
{
TellReq = 0x0064,
};
struct FFXIVARR_PACKET_RAW
{
FFXIVARR_PACKET_SEGMENT_HEADER segHdr;
@ -300,7 +329,7 @@ namespace Packets {
struct FFXIVARR_IPC_HEADER
{
uint16_t reserved;
ServerIpcType type;
uint16_t type;
uint16_t unknown_2;
uint16_t serverId;
uint32_t timestamp;

View file

@ -16,15 +16,16 @@ namespace Packets {
// Must forward define these in order to enable the compiler to produce the
// correct template functions.
template <typename T>
template <typename T, typename T1>
class GamePacketNew;
template <typename T>
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T>& packet );
template <typename T, typename T1>
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T, T1>& packet );
/**
* The base implementation of a game packet. Needed for parsing packets.
*/
template <typename T1>
class GamePacketNewBase
{
public:
@ -33,7 +34,7 @@ public:
* @brief Gets the IPC type of this packet. (Useful for determining the
* type of a parsed packet.)
*/
virtual ServerIpcType ipcType( void ) = 0;
virtual T1 ipcType( void ) = 0;
};
/**
@ -42,8 +43,8 @@ public:
* type that represents just the IPC data portion (the bytes after the initial
* 32 byte header information.)
*/
template <typename T>
class GamePacketNew : public GamePacketNewBase
template <typename T, typename T1>
class GamePacketNew : public GamePacketNewBase<T1>
{
public:
/**
@ -51,7 +52,7 @@ public:
* @param sourceActorId The source actor id.
* @param targetActorId The target actor id.
*/
GamePacketNew<T>( uint32_t sourceActorId, uint32_t targetActorId )
GamePacketNew<T, T1>( uint32_t sourceActorId, uint32_t targetActorId )
{
initialize();
m_segHdr.source_actor = sourceActorId;
@ -62,7 +63,7 @@ public:
* @brief Constructs a new game packet with the specified actors.
* @param sourceActorId The source and target actor id.
*/
GamePacketNew<T>( uint32_t bothActorId )
GamePacketNew<T, T1>( uint32_t bothActorId )
{
initialize();
m_segHdr.source_actor = bothActorId;
@ -85,13 +86,13 @@ protected:
// Game packets (IPC) are type 3.
m_segHdr.type = 3;
// The IPC type itself.
m_ipcHdr.type = static_cast< ServerIpcType >( m_data._ServerIpcType );
m_ipcHdr.type = static_cast< ServerZoneIpcType >( m_data._ServerIpcType );
};
public:
virtual ServerIpcType ipcType( void )
virtual T1 ipcType( void )
{
return static_cast< ServerIpcType >( m_data._ServerIpcType );
return static_cast< T1 >( m_data._ServerIpcType );
};
/** Gets a reference to the underlying IPC data structure. */
@ -102,7 +103,7 @@ public:
* @param actorId The source actor id.
* @return This IPC packet object (can be used for chaining).
*/
GamePacketNew<T> sourceActor( uint32_t actorId )
GamePacketNew<T, T1> sourceActor( uint32_t actorId )
{
m_segHdr.source_actor = actorId;
return this;
@ -122,7 +123,7 @@ public:
* @param actorId The target actor id.
* @return This IPC packet object (can be used for chaining).
*/
GamePacketNew<T> targetActor( uint32_t actorId )
GamePacketNew<T, T1> targetActor( uint32_t actorId )
{
m_segHdr.target_actor = actorId;
return this;
@ -137,7 +138,7 @@ public:
return m_segHdr.target_actor;
};
friend std::ostream& operator<< <> ( std::ostream& os, const GamePacketNew<T>& packet );
friend std::ostream& operator<< <> ( std::ostream& os, const GamePacketNew<T, T1>& packet );
friend class GamePacketFactory;
@ -198,8 +199,8 @@ private:
};
};
template <typename T>
std::ostream& operator<<( std::ostream& os, const GamePacketNew<T>& packet )
template <typename T, typename T1>
std::ostream& operator<<( std::ostream& os, const GamePacketNew<T, T1>& packet )
{
#if 0
// Since the packet itself is constant, we need to make a copy of the IPC

View file

@ -5,7 +5,7 @@
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Crypt/md5.h>
#include <boost/format.hpp>
@ -81,7 +81,7 @@ void Core::Network::GameConnection::OnError( const boost::system::error_code & e
void Core::Network::GameConnection::sendError( uint64_t sequence, uint32_t errorcode, uint16_t messageId, uint32_t tmpId )
{
GamePacketNew< FFXIVIpcLobbyError > errorPacket( tmpId );
GamePacketNew< FFXIVIpcLobbyError, ServerLobbyIpcType > errorPacket( tmpId );
errorPacket.data().seq = sequence;
errorPacket.data().error_id = errorcode;
@ -100,7 +100,7 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
g_log.info( "[" + std::to_string( m_pSession->getAccountID() ) + "] ReqCharList" );
Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcServerList > serverListPacket( tmpId );
GamePacketNew< FFXIVIpcServerList, ServerLobbyIpcType > serverListPacket( tmpId );
serverListPacket.data().seq = 1;
serverListPacket.data().offset = 0;
serverListPacket.data().numServers = 1;
@ -111,7 +111,7 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
pRP.addPacket( serverListPacket );
GamePacketNew< FFXIVIpcRetainerList > retainerListPacket( tmpId );
GamePacketNew< FFXIVIpcRetainerList, ServerLobbyIpcType > retainerListPacket( tmpId );
retainerListPacket.data().padding[8] = 1;
pRP.addPacket( retainerListPacket );
@ -124,7 +124,7 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
for( uint8_t i = 0; i < 4; i++ )
{
GamePacketNew< FFXIVIpcCharList > charListPacket( tmpId );
GamePacketNew< FFXIVIpcCharList, ServerLobbyIpcType > charListPacket( tmpId );
charListPacket.data().seq = sequence;
charListPacket.data().numInPacket = 2;
@ -206,7 +206,7 @@ void Core::Network::GameConnection::enterWorld( FFXIVARR_PACKET_RAW& packet, uin
Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcEnterWorld > enterWorldPacket( tmpId );
GamePacketNew< FFXIVIpcEnterWorld, ServerLobbyIpcType > enterWorldPacket( tmpId );
enterWorldPacket.data().contentId = lookupId;
@ -237,7 +237,7 @@ bool Core::Network::GameConnection::sendServiceAccountList( FFXIVARR_PACKET_RAW&
{
g_log.Log( LoggingSeverity::info, "Found session linked to accountId: " + std::to_string( pSession->getAccountID() ) );
m_pSession = pSession;
GamePacketNew< FFXIVIpcServiceIdInfo > serviceIdInfoPacket( tmpId );
GamePacketNew< FFXIVIpcServiceIdInfo, ServerLobbyIpcType > serviceIdInfoPacket( tmpId );
sprintf( serviceIdInfoPacket.data().serviceAccount[0].name, "FINAL FANTASY XIV" );
serviceIdInfoPacket.data().numServiceAccounts = 1;
@ -288,7 +288,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
return true;
}
GamePacketNew< FFXIVIpcCharCreate > charCreatePacket( tmpId );
GamePacketNew< FFXIVIpcCharCreate, ServerLobbyIpcType > charCreatePacket( tmpId );
charCreatePacket.data().content_id = newContentId;
strcpy( charCreatePacket.data().name, name.c_str() );
@ -312,7 +312,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
{
Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcCharCreate > charCreatePacket( tmpId );
GamePacketNew< FFXIVIpcCharCreate, ServerLobbyIpcType > charCreatePacket( tmpId );
charCreatePacket.data().content_id = newContentId;
strcpy( charCreatePacket.data().name, name.c_str() );
@ -342,7 +342,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
if( g_restConnector.deleteCharacter( ( char* )m_pSession->getSessionId(), name ) )
{
GamePacketNew< FFXIVIpcCharCreate > charCreatePacket( tmpId );
GamePacketNew< FFXIVIpcCharCreate, ServerLobbyIpcType > charCreatePacket( tmpId );
//charCreatePacket.data().content_id = deletePlayer.getContentId();
charCreatePacket.data().content_id = 0;

View file

@ -49,7 +49,7 @@ void Core::Action::ActionCast::onStart()
m_pSource->getAsPlayer()->sendDebug( "onStart()" );
m_startTime = Util::getTimeMs();
GamePacketNew< FFXIVIpcActorCast > castPacket( getId() );
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( getId() );
castPacket.data().action_id = m_id;
castPacket.data().unknown = 1;

View file

@ -45,7 +45,7 @@ void Core::Action::ActionTeleport::onStart()
m_startTime = Util::getTimeMs();
GamePacketNew< FFXIVIpcActorCast > castPacket( getId() );
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( getId() );
castPacket.data().action_id = 5;
castPacket.data().unknown = 1;
@ -83,7 +83,7 @@ void Core::Action::ActionTeleport::onFinish()
pPlayer->setZoningType( Common::ZoneingType::Teleport );
GamePacketNew< FFXIVIpcEffect > effectPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( pPlayer->getId() );
effectPacket.data().targetId = pPlayer->getId();
effectPacket.data().actionAnimationId = 5;
//effectPacket.data().unknown_3 = 1;

View file

@ -49,7 +49,7 @@ void Core::Action::EventItemAction::onStart()
m_startTime = Util::getTimeMs();
GamePacketNew< FFXIVIpcActorCast > castPacket( m_pSource->getId() );
GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( m_pSource->getId() );
castPacket.data().action_id = 1;
castPacket.data().unknown = 3;
@ -70,7 +70,7 @@ void Core::Action::EventItemAction::onFinish()
try
{
GamePacketNew< FFXIVIpcEffect > effectPacket( m_pSource->getId() );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( m_pSource->getId() );
effectPacket.data().targetId = static_cast< uint32_t >( m_additional );
effectPacket.data().actionAnimationId = 1;
// effectPacket.data().unknown_3 = 3;

View file

@ -594,7 +594,7 @@ void Core::Entity::Actor::autoAttack( ActorPtr pTarget )
uint32_t damage = 10 + rand() % 12;
uint32_t variation = 0 + rand() % 3;
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 0x366;
effectPacket.data().unknown_2 = variation;

View file

@ -123,7 +123,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget )
//pTarget->queuePacket( spawnPacket );
GamePacketNew< FFXIVIpcNpcSpawn > spawnPacket( getId(), pTarget->getId() );
GamePacketNew< FFXIVIpcNpcSpawn, ServerZoneIpcType > spawnPacket( getId(), pTarget->getId() );
spawnPacket.data().pos.x = m_pos.x;
@ -221,14 +221,14 @@ void Core::Entity::BattleNpc::setOwner( Core::Entity::PlayerPtr pPlayer )
if( pPlayer != nullptr )
{
GamePacketNew< FFXIVIpcActorOwner > setOwnerPacket( getId(), pPlayer->getId() );
GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket( getId(), pPlayer->getId() );
setOwnerPacket.data().type = 0x01;
setOwnerPacket.data().actorId = pPlayer->getId();
sendToInRangeSet( setOwnerPacket );
}
else
{
GamePacketNew< FFXIVIpcActorOwner > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID);
GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID);
setOwnerPacket.data().type = 0x01;
setOwnerPacket.data().actorId = INVALID_GAME_OBJECT_ID;
sendToInRangeSet( setOwnerPacket );

View file

@ -177,7 +177,7 @@ uint64_t Core::Entity::Player::getOnlineStatusMask() const
void Core::Entity::Player::prepareZoning( uint16_t targetZone, bool fadeOut )
{
GamePacketNew< FFXIVIpcPrepareZoning > preparePacket( getId() );
GamePacketNew< FFXIVIpcPrepareZoning, ServerZoneIpcType > preparePacket( getId() );
preparePacket.data().targetZone = targetZone;
preparePacket.data().fadeOut = fadeOut == true ? 1 : 0;
queuePacket( preparePacket );
@ -259,7 +259,7 @@ bool Core::Entity::Player::isAutoattackOn() const
void Core::Entity::Player::sendStats()
{
GamePacketNew< FFXIVIpcPlayerStats > statPacket( getId() );
GamePacketNew< FFXIVIpcPlayerStats, ServerZoneIpcType > statPacket( getId() );
statPacket.data().strength = m_baseStats.str;
statPacket.data().dexterity = m_baseStats.dex;
statPacket.data().vitality = m_baseStats.vit;
@ -378,7 +378,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
// mark the player for a position update in DB
setSyncFlag( PlayerSyncFlags::Position );
GamePacketNew< FFXIVIpcInit > initPacket( getId() );
GamePacketNew< FFXIVIpcInit, ServerZoneIpcType > initPacket( getId() );
initPacket.data().charId = getId();
queuePacket( initPacket );
@ -394,7 +394,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
// only initialize the UI if the player in fact just logged in.
if( isLogin() )
{
GamePacketNew< FFXIVIpcCFAvailableContents > contentFinderList( getId() );
GamePacketNew< FFXIVIpcCFAvailableContents, ServerZoneIpcType > contentFinderList( getId() );
for( auto i = 0; i < 72; i++ )
{
// unlock all contents for now
@ -405,14 +405,14 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
Server::InitUIPacket initUIPacket( pPlayer );
queuePacket( initUIPacket );
GamePacketNew< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass();
classInfoPacket.data().unknown = 1;
classInfoPacket.data().level = getLevel();
classInfoPacket.data().level1 = getLevel();
queuePacket( classInfoPacket );
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() );
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1];
@ -420,7 +420,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
queuePacket( gcAffPacket );
}
GamePacketNew< FFXIVIpcInitZone > initZonePacket( getId() );
GamePacketNew< FFXIVIpcInitZone, ServerZoneIpcType > initZonePacket( getId() );
initZonePacket.data().zoneId = getCurrentZone()->getLayoutId();
initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
initZonePacket.data().bitmask = 0x2A;
@ -431,10 +431,10 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
if( isLogin() )
{
GamePacketNew< FFXIVARR_IPC_UNK322 > unk322( getId() );
GamePacketNew< FFXIVARR_IPC_UNK322, ServerZoneIpcType > unk322( getId() );
queuePacket( unk322 );
GamePacketNew< FFXIVARR_IPC_UNK320 > unk320( getId() );
GamePacketNew< FFXIVARR_IPC_UNK320, ServerZoneIpcType > unk320( getId() );
queuePacket( unk320 );
}
@ -655,7 +655,7 @@ void Core::Entity::Player::gainLevel()
m_hp = getMaxHp();
m_mp = getMaxMp();
GamePacketNew< FFXIVIpcStatusEffectList > effectListPacket( getId() );
GamePacketNew< FFXIVIpcStatusEffectList, ServerZoneIpcType > effectListPacket( getId() );
effectListPacket.data().classId = getClass();
effectListPacket.data().classId1 = getClass();
effectListPacket.data().level = getLevel();
@ -670,7 +670,7 @@ void Core::Entity::Player::gainLevel()
getLevel(), getLevel() - 1 ), true );
GamePacketNew< FFXIVIpcUpdateClassInfo > classInfoPacket( getId() );
GamePacketNew< FFXIVIpcUpdateClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass();
classInfoPacket.data().classId1 = getClass();
classInfoPacket.data().level = getLevel();
@ -760,7 +760,7 @@ void Core::Entity::Player::setClassJob( Core::Common::ClassJob classJob )
m_tp = 0;
GamePacketNew< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass();
classInfoPacket.data().level = getLevel();
queuePacket( classInfoPacket );
@ -950,7 +950,7 @@ void Core::Entity::Player::setGc( uint8_t gc )
{
m_gc = gc;
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() );
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1];
@ -964,7 +964,7 @@ void Core::Entity::Player::setGcRankAt( uint8_t index, uint8_t rank )
{
m_gcRank[index] = rank;
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() );
GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1];
@ -1060,7 +1060,7 @@ void Core::Entity::Player::update( int64_t currTime )
}
else
{
GamePacketNew< FFXIVIpcActorSetPos > setActorPosPacket( getId() );
GamePacketNew< FFXIVIpcActorSetPos, ServerZoneIpcType > setActorPosPacket( getId() );
setActorPosPacket.data().r16 = Math::Util::floatToUInt16Rot( m_queuedZoneing->m_targetRotation );
setActorPosPacket.data().waitForLoad = 0x04;
setActorPosPacket.data().x = targetPos.x;
@ -1154,7 +1154,7 @@ void Core::Entity::Player::freePlayerSpawnId( uint32_t actorId )
m_playerIdToSpawnIdMap.erase( actorId );
m_freeSpawnIdQueue.push( spawnId );
GamePacketNew< FFXIVIpcActorFreeSpawn > freeActorSpawnPacket( getId() );
GamePacketNew< FFXIVIpcActorFreeSpawn, ServerZoneIpcType > freeActorSpawnPacket( getId() );
freeActorSpawnPacket.data().actorId = actorId;
freeActorSpawnPacket.data().spawnId = spawnId;
queuePacket( freeActorSpawnPacket );
@ -1421,7 +1421,7 @@ void Core::Entity::Player::initHateSlotQueue()
void Core::Entity::Player::sendHateList()
{
GamePacketNew< FFXIVIpcHateList > hateListPacket( getId() );
GamePacketNew< FFXIVIpcHateList, ServerZoneIpcType > hateListPacket( getId() );
hateListPacket.data().numEntries = m_actorIdTohateSlotMap.size();
auto it = m_actorIdTohateSlotMap.begin();
for( int32_t i = 0; it != m_actorIdTohateSlotMap.end(); ++it, i++ )
@ -1456,7 +1456,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
if( getClass() == 5 || getClass() == 23 || getClass() == 31 )
{
GamePacketNew< FFXIVIpcEffect > effectPacket(getId());
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 8;
// effectPacket.data().unknown_2 = variation;
@ -1477,7 +1477,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
else
{
GamePacketNew< FFXIVIpcEffect > effectPacket(getId());
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 7;
// effectPacket.data().unknown_2 = variation;
@ -1510,7 +1510,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
case Core::Common::HandleSkillType::StdDamage:
{
sendDebug( "STD_DAMAGE" );
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0;
@ -1534,7 +1534,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId,
case Core::Common::HandleSkillType::StdHeal:
{
sendDebug( "STD_HEAL" );
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() );
GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0;

View file

@ -130,7 +130,7 @@ void Core::Entity::Player::addCurrency( uint8_t type, uint32_t amount )
if( !m_pInventory->addCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
invUpPacket.data().catalogId = 1;
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
@ -144,7 +144,7 @@ void Core::Entity::Player::removeCurrency( uint8_t type, uint32_t amount )
if( !m_pInventory->removeCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Currency;
invUpPacket.data().catalogId = 1;
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) );
@ -164,7 +164,7 @@ void Core::Entity::Player::addCrystal( uint8_t type, uint32_t amount )
if( !m_pInventory->addCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );
@ -180,7 +180,7 @@ void Core::Entity::Player::removeCrystal( uint8_t type, uint32_t amount )
if( !m_pInventory->removeCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() );
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) );

View file

@ -1,6 +1,6 @@
#include <src/servers/Server_Common/Common.h>
#include <src/servers/Server_Common/Database/Database.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Network/PacketContainer.h>
@ -78,13 +78,13 @@ void Core::Entity::Player::finishQuest( uint16_t questId )
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{
GamePacketNew< FFXIVIpcQuestUpdate > questUpdatePacket( getId() );
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > questUpdatePacket( getId() );
questUpdatePacket.data().slot = idx;
questUpdatePacket.data().questInfo.c.questId = 0;
questUpdatePacket.data().questInfo.c.sequence = 0xFF;
queuePacket( questUpdatePacket );
GamePacketNew< FFXIVIpcQuestFinish > questFinishPacket( getId() );
GamePacketNew< FFXIVIpcQuestFinish, ServerZoneIpcType > questFinishPacket( getId() );
questFinishPacket.data().questId = questId;
questFinishPacket.data().flag1 = 1;
questFinishPacket.data().flag2 = 1;
@ -128,13 +128,13 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{
GamePacketNew< FFXIVIpcQuestUpdate > questUpdatePacket( getId() );
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > questUpdatePacket( getId() );
questUpdatePacket.data().slot = idx;
questUpdatePacket.data().questInfo.c.questId = 0;
questUpdatePacket.data().questInfo.c.sequence = 0xFF;
queuePacket( questUpdatePacket );
GamePacketNew< FFXIVIpcQuestFinish > questFinishPacket( getId() );
GamePacketNew< FFXIVIpcQuestFinish, ServerZoneIpcType > questFinishPacket( getId() );
questFinishPacket.data().questId = questId;
questFinishPacket.data().flag1 = 1;
questFinishPacket.data().flag2 = 1;
@ -977,7 +977,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint16_t sequence )
{
if( hasQuest( questId ) )
{
GamePacketNew< FFXIVIpcQuestUpdate > pe_qa( getId() );
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
int16_t index = getQuestIndex( questId );
auto pNewQuest = m_activeQuests[index];
pe_qa.data().slot = index;
@ -994,7 +994,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint16_t sequence )
int8_t idx = m_freeQuestIdxQueue.front();
m_freeQuestIdxQueue.pop();
GamePacketNew< FFXIVIpcQuestUpdate > pe_qa( getId() );
GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
boost::shared_ptr< QuestActive > pNewQuest( new QuestActive() );
pNewQuest->c.questId = questId;
@ -1031,7 +1031,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint16_t sequence )
void Core::Entity::Player::sendQuestTracker()
{
GamePacketNew< FFXIVIpcQuestTracker > trackerPacket( getId() );
GamePacketNew< FFXIVIpcQuestTracker, ServerZoneIpcType > trackerPacket( getId() );
for( int32_t ii = 0; ii < 5; ii++ )
{
@ -1078,7 +1078,7 @@ void Core::Entity::Player::setQuestTracker( uint16_t index, int16_t flag )
void Core::Entity::Player::sendQuestInfo()
{
GamePacketNew< FFXIVIpcQuestActiveList > pe_qa( getId() );
GamePacketNew< FFXIVIpcQuestActiveList, ServerZoneIpcType > pe_qa( getId() );
for( int32_t i = 0; i < 30; i++ )
{
@ -1094,7 +1094,7 @@ void Core::Entity::Player::sendQuestInfo()
queuePacket( pe_qa );
GamePacketNew< FFXIVIpcQuestCompleteList > pe_qc( getId() );
GamePacketNew< FFXIVIpcQuestCompleteList, ServerZoneIpcType > pe_qc( getId() );
memcpy( pe_qc.data().questCompleteMask, m_questCompleteFlags, 200 );
queuePacket( pe_qc );

View file

@ -161,7 +161,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
pPlayer->getPos().y + static_cast< float >( posY ),
pPlayer->getPos().z + static_cast< float >( posZ ) );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos >
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos, Network::Packets::ServerZoneIpcType >
setActorPosPacket( pPlayer->getId() );
setActorPosPacket.data().x = pPlayer->getPos().x;
setActorPosPacket.data().y = pPlayer->getPos().y;
@ -216,7 +216,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
int32_t discover_id;
sscanf( params.c_str(), "%i %i", &map_id, &discover_id );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcDiscovery > discoveryPacket( pPlayer->getId() );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcDiscovery, Network::Packets::ServerZoneIpcType > discoveryPacket( pPlayer->getId() );
discoveryPacket.data().map_id = map_id;
discoveryPacket.data().map_part_id = discover_id;
pPlayer->queuePacket( discoveryPacket );
@ -400,7 +400,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
pPlayer->sendNotice( "Injecting ACTOR_CONTROL " + std::to_string( opcode ) );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorControl143 > actorControl( playerId, pPlayer->getId() );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorControl143, Network::Packets::ServerZoneIpcType > actorControl( playerId, pPlayer->getId() );
actorControl.data().category = opcode;
actorControl.data().param1 = param1;
actorControl.data().param2 = param2;
@ -511,7 +511,7 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::PlayerPtr pPlayer, b
}
if( offset != 0 )
{
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos >
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos, Network::Packets::ServerZoneIpcType >
setActorPosPacket( pPlayer->getId() );
setActorPosPacket.data().x = pPlayer->getPos().x;
setActorPosPacket.data().y = pPlayer->getPos().y;

View file

@ -1,4 +1,4 @@
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Database/Database.h>
#include <src/servers/Server_Common/Common.h>
#include <src/servers/Server_Common/Exd/ExdData.h>
@ -486,7 +486,7 @@ int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t
" WHERE storageId = " + std::to_string( inventoryId ) +
" AND CharacterId = " + std::to_string( m_pOwner->getId() ) );
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( m_pOwner->getId() );
invUpPacket.data().containerId = inventoryId;
invUpPacket.data().catalogId = catalogId;
invUpPacket.data().quantity = item->getStackSize();
@ -607,7 +607,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
m_inventoryMap[fromInventoryId]->removeItem( fromSlotId );
updateContainer( fromInventoryId, fromSlotId, nullptr );
GamePacketNew< FFXIVIpcInventoryTransaction > invTransPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcInventoryTransaction, ServerZoneIpcType > invTransPacket( m_pOwner->getId() );
invTransPacket.data().transactionId = transactionId;
invTransPacket.data().ownerId = m_pOwner->getId();
invTransPacket.data().storageId = fromInventoryId;
@ -617,7 +617,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
invTransPacket.data().type = 7;
m_pOwner->queuePacket( invTransPacket );
GamePacketNew< FFXIVIpcInventoryTransactionFinish > invTransFinPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcInventoryTransactionFinish, ServerZoneIpcType > invTransFinPacket( m_pOwner->getId() );
invTransFinPacket.data().transactionId = transactionId;
invTransFinPacket.data().transactionId1 = transactionId;
m_pOwner->queuePacket( invTransFinPacket );
@ -812,7 +812,7 @@ void Core::Inventory::send()
if( it->second->getId() == InventoryType::Currency || it->second->getId() == InventoryType::Crystal )
{
GamePacketNew< FFXIVIpcCurrencyCrystalInfo > currencyInfoPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcCurrencyCrystalInfo, ServerZoneIpcType > currencyInfoPacket( m_pOwner->getId() );
currencyInfoPacket.data().sequence = count;
currencyInfoPacket.data().catalogId = itM->second->getId();
currencyInfoPacket.data().unknown = 1;
@ -823,7 +823,7 @@ void Core::Inventory::send()
}
else
{
GamePacketNew< FFXIVIpcItemInfo > itemInfoPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcItemInfo, ServerZoneIpcType > itemInfoPacket( m_pOwner->getId() );
itemInfoPacket.data().sequence = count;
itemInfoPacket.data().containerId = it->second->getId();
itemInfoPacket.data().slot = itM->first;
@ -836,7 +836,7 @@ void Core::Inventory::send()
}
}
GamePacketNew< FFXIVIpcContainerInfo > containerInfoPacket( m_pOwner->getId() );
GamePacketNew< FFXIVIpcContainerInfo, ServerZoneIpcType > containerInfoPacket( m_pOwner->getId() );
containerInfoPacket.data().sequence = count;
containerInfoPacket.data().numItems = it->second->getEntryCount();
containerInfoPacket.data().containerId = it->second->getId();

View file

@ -31,58 +31,58 @@ Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
, m_pAcceptor( pAcceptor )
, m_conType( ConnectionType::None )
{
auto setHandler = [=]( uint16_t opcode, std::string handlerName, GameConnection::Handler pHandler )
auto setZoneHandler = [=]( uint16_t opcode, std::string handlerName, GameConnection::Handler pHandler )
{
m_packetHandlerMap[opcode] = pHandler;
m_zoneHandlerMap[opcode] = pHandler;
m_packetHandlerStrMap[opcode] = handlerName;
};
setHandler( ClientIpcType::PingHandler, "PingHandler", &GameConnection::pingHandler );
setHandler( ClientIpcType::InitHandler, "InitHandler", &GameConnection::initHandler );
setHandler( ClientIpcType::ChatHandler, "ChatHandler", &GameConnection::chatHandler );
setZoneHandler( ClientZoneIpcType::PingHandler, "PingHandler", &GameConnection::pingHandler );
setZoneHandler( ClientZoneIpcType::InitHandler, "InitHandler", &GameConnection::initHandler );
setZoneHandler( ClientZoneIpcType::ChatHandler, "ChatHandler", &GameConnection::chatHandler );
setHandler( ClientIpcType::FinishLoadingHandler, "FinishLoadingHandler", &GameConnection::finishLoadingHandler );
setZoneHandler( ClientZoneIpcType::FinishLoadingHandler, "FinishLoadingHandler", &GameConnection::finishLoadingHandler );
setHandler( ClientIpcType::PlayTimeHandler, "PlayTimeHandler", &GameConnection::playTimeHandler );
setHandler( ClientIpcType::LogoutHandler, "LogoutHandler", &GameConnection::logoutHandler );
setZoneHandler( ClientZoneIpcType::PlayTimeHandler, "PlayTimeHandler", &GameConnection::playTimeHandler );
setZoneHandler( ClientZoneIpcType::LogoutHandler, "LogoutHandler", &GameConnection::logoutHandler );
setHandler( ClientIpcType::SocialListHandler, "SocialListHandler", &GameConnection::socialListHandler );
setHandler( ClientIpcType::SetSearchInfoHandler, "SetSearchInfoHandler", &GameConnection::setSearchInfoHandler );
setHandler( ClientIpcType::ReqSearchInfoHandler, "ReqSearchInfoHandler", &GameConnection::reqSearchInfoHandler );
setZoneHandler( ClientZoneIpcType::SocialListHandler, "SocialListHandler", &GameConnection::socialListHandler );
setZoneHandler( ClientZoneIpcType::SetSearchInfoHandler, "SetSearchInfoHandler", &GameConnection::setSearchInfoHandler );
setZoneHandler( ClientZoneIpcType::ReqSearchInfoHandler, "ReqSearchInfoHandler", &GameConnection::reqSearchInfoHandler );
setHandler( ClientIpcType::BlackListHandler, "BlackListHandler", &GameConnection::blackListHandler );
setZoneHandler( ClientZoneIpcType::BlackListHandler, "BlackListHandler", &GameConnection::blackListHandler );
setHandler( ClientIpcType::LinkshellListHandler, "LinkshellListHandler", &GameConnection::linkshellListHandler );
setZoneHandler( ClientZoneIpcType::LinkshellListHandler, "LinkshellListHandler", &GameConnection::linkshellListHandler );
setHandler( ClientIpcType::FcInfoReqHandler, "FcInfoReqHandler", &GameConnection::fcInfoReqHandler );
setZoneHandler( ClientZoneIpcType::FcInfoReqHandler, "FcInfoReqHandler", &GameConnection::fcInfoReqHandler );
setHandler( ClientIpcType::ZoneLineHandler, "ZoneLineHandler", &GameConnection::zoneLineHandler );
setHandler( ClientIpcType::ActionHandler, "ActionHandler", &GameConnection::actionHandler );
setZoneHandler( ClientZoneIpcType::ZoneLineHandler, "ZoneLineHandler", &GameConnection::zoneLineHandler );
setZoneHandler( ClientZoneIpcType::ActionHandler, "ActionHandler", &GameConnection::actionHandler );
setHandler( ClientIpcType::DiscoveryHandler, "DiscoveryHandler", &GameConnection::discoveryHandler );
setZoneHandler( ClientZoneIpcType::DiscoveryHandler, "DiscoveryHandler", &GameConnection::discoveryHandler );
setHandler( ClientIpcType::SkillHandler, "SkillHandler", &GameConnection::skillHandler );
setZoneHandler( ClientZoneIpcType::SkillHandler, "SkillHandler", &GameConnection::skillHandler );
setHandler( ClientIpcType::GMCommand1, "GMCommand1", &GameConnection::gm1Handler );
setHandler( ClientIpcType::GMCommand2, "GMCommand2", &GameConnection::gm2Handler );
setZoneHandler( ClientZoneIpcType::GMCommand1, "GMCommand1", &GameConnection::gm1Handler );
setZoneHandler( ClientZoneIpcType::GMCommand2, "GMCommand2", &GameConnection::gm2Handler );
setHandler( ClientIpcType::UpdatePositionHandler,"UpdatePositionHandler", &GameConnection::updatePositionHandler );
setZoneHandler( ClientZoneIpcType::UpdatePositionHandler,"UpdatePositionHandler", &GameConnection::updatePositionHandler );
setHandler( ClientIpcType::InventoryModifyHandler,"InventoryModifyHandler", &GameConnection::inventoryModifyHandler );
setZoneHandler( ClientZoneIpcType::InventoryModifyHandler,"InventoryModifyHandler", &GameConnection::inventoryModifyHandler );
setHandler( ClientIpcType::TalkEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::EmoteEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::WithinRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::OutOfRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::EnterTeriEventHandler, "EventHandler", &GameConnection::eventHandler );
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 );
setHandler( ClientIpcType::ReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setHandler( ClientIpcType::TradeReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setZoneHandler( ClientZoneIpcType::ReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setZoneHandler( ClientZoneIpcType::TradeReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setHandler( ClientIpcType::CFDutyInfoHandler, "CFDutyInfoRequest", &GameConnection::cfDutyInfoRequest );
setHandler( ClientIpcType::CFRegisterDuty, "CFRegisterDuty", &GameConnection::cfRegisterDuty );
setHandler( ClientIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
setHandler( ClientIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
setZoneHandler( ClientZoneIpcType::CFDutyInfoHandler, "CFDutyInfoRequest", &GameConnection::cfDutyInfoRequest );
setZoneHandler( ClientZoneIpcType::CFRegisterDuty, "CFRegisterDuty", &GameConnection::cfRegisterDuty );
setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
}
@ -139,14 +139,23 @@ void Core::Network::GameConnection::handleGamePacket( Core::Network::Packets::Ga
if( !m_pSession )
return;
auto it = m_packetHandlerMap.find( pPacket->getSubType() );
/*if( m_conType == Network::ConnectionType::Zone )
{
g_log.debug( "Zone Packet" );
}
else if( m_conType == Network::ConnectionType::Chat )
{
g_log.debug( "Chat Packet" );
}*/
if( it != m_packetHandlerMap.end() )
auto it = m_zoneHandlerMap.find( pPacket->getSubType() );
if( it != m_zoneHandlerMap.end() )
{
auto name = m_packetHandlerStrMap[pPacket->getSubType()];
// dont display packet notification if it is a ping or pos update, don't want the spam
if( pPacket->getSubType() != ClientIpcType::PingHandler
&& pPacket->getSubType() != ClientIpcType::UpdatePositionHandler )
if( pPacket->getSubType() != ClientZoneIpcType::PingHandler &&
pPacket->getSubType() != ClientZoneIpcType::UpdatePositionHandler )
g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Handling packet : " + name + "( " +
boost::str( boost::format( "%|04X|" ) % static_cast< uint32_t >( pPacket->getSubType() & 0xFFFF ) ) + " )" );
@ -264,7 +273,6 @@ void Core::Network::GameConnection::injectPacket( const std::string& packetpath,
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();

View file

@ -37,7 +37,7 @@ private:
AcceptorPtr m_pAcceptor;
// handler for game packets (main type 0x03)
HandlerMap m_packetHandlerMap;
HandlerMap m_zoneHandlerMap;
HandlerStrMap m_packetHandlerStrMap;
SessionPtr m_pSession;

View file

@ -27,7 +27,7 @@ using namespace Core::Network::Packets::Server;
void Core::Network::GameConnection::cfDutyInfoRequest( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcCFDutyInfo > dutyInfoPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcCFDutyInfo, ServerZoneIpcType > dutyInfoPacket( pPlayer->getId() );
auto penaltyMinutes = pPlayer->getCFPenaltyMinutes();
if (penaltyMinutes > 255)
@ -39,7 +39,7 @@ void Core::Network::GameConnection::cfDutyInfoRequest( const Packets::GamePacket
queueOutPacket( dutyInfoPacket );
GamePacketNew< FFXIVIpcCFPlayerInNeed > inNeedsPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcCFPlayerInNeed, ServerZoneIpcType > inNeedsPacket( pPlayer->getId() );
queueOutPacket( inNeedsPacket );
}
@ -62,7 +62,7 @@ void Core::Network::GameConnection::cfRegisterDuty( const Packets::GamePacket& i
pPlayer->sendDebug("ContentId5" + std::to_string(contentId5));
// let's cancel it because otherwise you can't register it again
GamePacketNew< FFXIVIpcCFNotify > cfCancelPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcCFNotify, ServerZoneIpcType > cfCancelPacket( pPlayer->getId() );
cfCancelPacket.data().state1 = 3;
cfCancelPacket.data().state2 = 1; // Your registration is withdrawn.
queueOutPacket( cfCancelPacket );

View file

@ -46,7 +46,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
switch( eventHandlerId )
{
case ClientIpcType::TalkEventHandler: // Talk event
case ClientZoneIpcType::TalkEventHandler: // Talk event
{
uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 );
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x28 );
@ -56,7 +56,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break;
}
case ClientIpcType::EmoteEventHandler: // Emote event
case ClientZoneIpcType::EmoteEventHandler: // Emote event
{
uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 );
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x28 );
@ -70,7 +70,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
}
case ClientIpcType::WithinRangeEventHandler:
case ClientZoneIpcType::WithinRangeEventHandler:
{
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x24 );
uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 );
@ -85,7 +85,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break;
}
case ClientIpcType::OutOfRangeEventHandler:
case ClientZoneIpcType::OutOfRangeEventHandler:
{
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x24 );
uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 );
@ -100,7 +100,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break;
}
case ClientIpcType::EnterTeriEventHandler:
case ClientZoneIpcType::EnterTeriEventHandler:
{
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 );
uint16_t eventParam1 = inPacket.getValAt< uint16_t >( 0x24 );
@ -113,8 +113,8 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break;
}
case ClientIpcType::ReturnEventHandler:
case ClientIpcType::TradeReturnEventHandler:
case ClientZoneIpcType::ReturnEventHandler:
case ClientZoneIpcType::TradeReturnEventHandler:
{
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 );
uint16_t subEvent = inPacket.getValAt< uint16_t >( 0x24 );

View file

@ -293,11 +293,11 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
{
targetPlayer->setOnlineStatusMask( param1 );
GamePacketNew< FFXIVIpcSetOnlineStatus > statusPacket( targetPlayer->getId() );
GamePacketNew< FFXIVIpcSetOnlineStatus, ServerZoneIpcType > statusPacket( targetPlayer->getId() );
statusPacket.data().onlineStatusFlags = param1;
queueOutPacket( statusPacket );
GamePacketNew< FFXIVIpcSetSearchInfo > searchInfoPacket( targetPlayer->getId() );
GamePacketNew< FFXIVIpcSetSearchInfo, ServerZoneIpcType > searchInfoPacket( targetPlayer->getId() );
searchInfoPacket.data().onlineStatusFlags = param1;
searchInfoPacket.data().selectRegion = targetPlayer->getSearchSelectRegion();
sprintf( searchInfoPacket.data().searchMessage, targetPlayer->getSearchMessage() );

View file

@ -48,7 +48,7 @@ void Core::Network::GameConnection::inventoryModifyHandler( const Packets::GameP
uint16_t fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 );
GamePacketNew< FFXIVIpcInventoryActionAck > ackPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcInventoryActionAck, ServerZoneIpcType > ackPacket( pPlayer->getId() );
ackPacket.data().sequence = seq;
ackPacket.data().type = 7;
pPlayer->queuePacket( ackPacket );

View file

@ -76,11 +76,11 @@ void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePac
// mark player as new adventurer
pPlayer->setNewAdventurer( true );
GamePacketNew< FFXIVIpcSetOnlineStatus > statusPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcSetOnlineStatus, ServerZoneIpcType > statusPacket( pPlayer->getId() );
statusPacket.data().onlineStatusFlags = status;
queueOutPacket( statusPacket );
GamePacketNew< FFXIVIpcSetSearchInfo > searchInfoPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcSetSearchInfo, ServerZoneIpcType > searchInfoPacket( pPlayer->getId() );
searchInfoPacket.data().onlineStatusFlags = status;
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
sprintf( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
@ -94,7 +94,7 @@ void Core::Network::GameConnection::setSearchInfoHandler( const Packets::GamePac
void Core::Network::GameConnection::reqSearchInfoHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcInitSearchInfo > searchInfoPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcInitSearchInfo, ServerZoneIpcType > searchInfoPacket( pPlayer->getId() );
searchInfoPacket.data().onlineStatusFlags = pPlayer->getOnlineStatusMask();
searchInfoPacket.data().selectRegion = pPlayer->getSearchSelectRegion();
sprintf( searchInfoPacket.data().searchMessage, pPlayer->getSearchMessage() );
@ -104,7 +104,7 @@ void Core::Network::GameConnection::reqSearchInfoHandler( const Packets::GamePac
void Core::Network::GameConnection::linkshellListHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcLinkshellList > linkshellListPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcLinkshellList, ServerZoneIpcType > linkshellListPacket( pPlayer->getId() );
queueOutPacket( linkshellListPacket );
}
@ -308,7 +308,7 @@ void Core::Network::GameConnection::zoneLineHandler( const Packets::GamePacket&
targetZone = pLine->getTargetZoneId();
rotation = pLine->getTargetRotation();
GamePacketNew< FFXIVIpcPrepareZoning > preparePacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcPrepareZoning, ServerZoneIpcType > preparePacket( pPlayer->getId() );
preparePacket.data().targetZone = targetZone;
//ActorControlPacket143 controlPacket( pPlayer, ActorControlType::DespawnZoneScreenMsg,
@ -348,7 +348,7 @@ void Core::Network::GameConnection::discoveryHandler( const Packets::GamePacket&
Db::Field *field = pQR->fetch();
GamePacketNew< FFXIVIpcDiscovery > discoveryPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcDiscovery, ServerZoneIpcType > discoveryPacket( pPlayer->getId() );
discoveryPacket.data().map_id = field[1].getInt16();
discoveryPacket.data().map_part_id = field[2].getInt16();
@ -363,7 +363,7 @@ void Core::Network::GameConnection::discoveryHandler( const Packets::GamePacket&
void Core::Network::GameConnection::playTimeHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcPlayTime > playTimePacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcPlayTime, ServerZoneIpcType > playTimePacket( pPlayer->getId() );
playTimePacket.data().playTimeInMinutes = pPlayer->getPlayTime() / 60;
pPlayer->queuePacket( playTimePacket );
}
@ -384,7 +384,7 @@ void Core::Network::GameConnection::blackListHandler( const Packets::GamePacket&
{
uint8_t count = inPacket.getValAt< uint8_t >( 0x21 );
GamePacketNew< FFXIVIpcBlackList > blackListPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcBlackList, ServerZoneIpcType > blackListPacket( pPlayer->getId() );
blackListPacket.data().sequence = count;
// TODO: Fill with actual blacklist data
//blackListPacket.data().entry[0].contentId = 1;
@ -436,7 +436,7 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
if( type == 0x02 )
{ // party list
GamePacketNew< FFXIVIpcSocialList > listPacket( pPlayer->getId() );;
GamePacketNew< FFXIVIpcSocialList, ServerZoneIpcType > listPacket( pPlayer->getId() );;
listPacket.data().type = 2;
listPacket.data().sequence = count;
@ -471,7 +471,7 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
else if( type == 0x0b )
{ // friend list
GamePacketNew< FFXIVIpcSocialList > listPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcSocialList, ServerZoneIpcType > listPacket( pPlayer->getId() );
listPacket.data().type = 0x0B;
listPacket.data().sequence = count;
memset( listPacket.data().entries, 0, sizeof( listPacket.data().entries ) );
@ -537,7 +537,7 @@ void Core::Network::GameConnection::chatHandler( const Packets::GamePacket& inPa
void Core::Network::GameConnection::logoutHandler( const Packets::GamePacket& inPacket,
Entity::PlayerPtr pPlayer )
{
GamePacketNew< FFXIVIpcLogout > logoutPacket( pPlayer->getId() );
GamePacketNew< FFXIVIpcLogout, ServerZoneIpcType > logoutPacket( pPlayer->getId() );
logoutPacket.data().flags1 = 0x02;
logoutPacket.data().flags2 = 0x2000;
queueOutPacket( logoutPacket );

View file

@ -2,7 +2,7 @@
#define _ACTORCONTROL142_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "src/servers/Server_Zone/Forwards.h"
namespace Core {
@ -14,7 +14,7 @@ namespace Server {
* @brief The Ping response packet.
*/
class ActorControlPacket142 :
public GamePacketNew< FFXIVIpcActorControl142 >
public GamePacketNew< FFXIVIpcActorControl142, ServerZoneIpcType >
{
public:
ActorControlPacket142( uint32_t actorId,
@ -24,7 +24,7 @@ public:
uint32_t param3 = 0,
uint32_t param4 = 0,
uint32_t padding1 = 0 ) :
GamePacketNew< FFXIVIpcActorControl142 >( actorId, actorId )
GamePacketNew< FFXIVIpcActorControl142, ServerZoneIpcType >( actorId, actorId )
{
initialize( category, param1, param2, param3, param4 );
};

View file

@ -2,7 +2,7 @@
#define _ACTORCONTROL143_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "src/servers/Server_Zone/Forwards.h"
@ -15,7 +15,7 @@ namespace Server {
* @brief The Ping response packet.
*/
class ActorControlPacket143 :
public GamePacketNew< FFXIVIpcActorControl143 >
public GamePacketNew< FFXIVIpcActorControl143, ServerZoneIpcType >
{
public:
ActorControlPacket143( uint32_t actorId,
@ -26,7 +26,7 @@ public:
uint32_t param4 = 0,
uint32_t param5 = 0,
uint32_t padding1 = 0 ) :
GamePacketNew< FFXIVIpcActorControl143 >( actorId, actorId )
GamePacketNew< FFXIVIpcActorControl143, ServerZoneIpcType >( actorId, actorId )
{
initialize( category, param1, param2, param3, param4, param5 );
};

View file

@ -2,7 +2,7 @@
#define _ACTORCONTROL144_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
namespace Core {
namespace Network {
@ -13,7 +13,7 @@ namespace Server {
* @brief The Ping response packet.
*/
class ActorControlPacket144 :
public GamePacketNew< FFXIVIpcActorControl144 >
public GamePacketNew< FFXIVIpcActorControl144, ServerZoneIpcType >
{
public:
ActorControlPacket144( uint32_t actorId,
@ -24,7 +24,7 @@ public:
uint32_t param4 = 0,
uint64_t targetId = 0,
uint32_t padding1 = 0 ) :
GamePacketNew< FFXIVIpcActorControl144 >( actorId, actorId )
GamePacketNew< FFXIVIpcActorControl144, ServerZoneIpcType >( actorId, actorId )
{
initialize( category, param1, param2, param3, param4, targetId );
};

View file

@ -15,11 +15,11 @@ namespace Server {
* @brief The packet sent to spawn an actor.
*/
class ActorSpawnPacket :
public GamePacketNew<FFXIVIpcActorSpawn>
public GamePacketNew< FFXIVIpcActorSpawn, ServerZoneIpcType >
{
public:
ActorSpawnPacket( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget ) :
GamePacketNew<FFXIVIpcActorSpawn>( pPlayer->getId(), pTarget->getId() )
GamePacketNew< FFXIVIpcActorSpawn, ServerZoneIpcType >( pPlayer->getId(), pTarget->getId() )
{
initialize( pPlayer, pTarget );
};

View file

@ -2,7 +2,7 @@
#define _CHATPACKET_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "src/servers/Server_Zone/Forwards.h"
@ -15,11 +15,11 @@ namespace Server {
* @brief The Chat packet.
*/
class ChatPacket :
public GamePacketNew< FFXIVIpcChat >
public GamePacketNew< FFXIVIpcChat, ServerZoneIpcType >
{
public:
ChatPacket( Entity::PlayerPtr player, Common::ChatType chatType, const std::string& msg ) :
GamePacketNew<FFXIVIpcChat>( player->getId(), player->getId() )
GamePacketNew< FFXIVIpcChat, ServerZoneIpcType >( player->getId(), player->getId() )
{
initialize( player, chatType, msg );
};

View file

@ -11,14 +11,14 @@ namespace Server {
/**
* @brief The packet sent to finish an event.
*/
class EventFinishPacket : public GamePacketNew< FFXIVIpcEventFinish >
class EventFinishPacket : public GamePacketNew< FFXIVIpcEventFinish, ServerZoneIpcType >
{
public:
EventFinishPacket( uint32_t playerId,
uint32_t eventId,
uint8_t param1,
uint32_t param3 ) :
GamePacketNew< FFXIVIpcEventFinish >( playerId, playerId )
GamePacketNew< FFXIVIpcEventFinish, ServerZoneIpcType >( playerId, playerId )
{
initialize( eventId, param1, param3 );
};

View file

@ -12,7 +12,7 @@ namespace Server {
/**
* @brief The packet sent to play an event.
*/
class EventPlayPacket : public GamePacketNew< FFXIVIpcEventPlay >
class EventPlayPacket : public GamePacketNew< FFXIVIpcEventPlay, ServerZoneIpcType >
{
public:
EventPlayPacket( uint32_t playerId,
@ -23,7 +23,7 @@ public:
uint8_t param3,
uint32_t param4 = 0,
uint32_t param5 = 0 ) :
GamePacketNew< FFXIVIpcEventPlay >( playerId, playerId )
GamePacketNew< FFXIVIpcEventPlay, ServerZoneIpcType >( playerId, playerId )
{
initialize( actorId, eventId, scene, flags, param3, param4, param5 );
};

View file

@ -12,7 +12,7 @@ namespace Server {
/**
* @brief The packet sent to start an event.
*/
class EventStartPacket : public GamePacketNew< FFXIVIpcEventStart >
class EventStartPacket : public GamePacketNew< FFXIVIpcEventStart, ServerZoneIpcType >
{
public:
EventStartPacket( uint32_t playerId,
@ -21,7 +21,7 @@ public:
uint8_t param1 = 0,
uint8_t param2 = 0,
uint32_t param3 = 0 ) :
GamePacketNew< FFXIVIpcEventStart >( playerId, playerId )
GamePacketNew< FFXIVIpcEventStart, ServerZoneIpcType >( playerId, playerId )
{
initialize( actorId, eventId, param1, param2, param3 );
};

View file

@ -2,7 +2,7 @@
#define _CORE_NETWORK_PACKETS_INITUIPACKET_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "Server_Zone/Actor/Player.h"
#include "Server_Zone/Forwards.h"
@ -15,11 +15,11 @@ namespace Server {
* @brief The Client UI Initialization packet. This must be sent to the client
* once upon connection to configure the UI.
*/
class InitUIPacket : public GamePacketNew< FFXIVIpcInitUI >
class InitUIPacket : public GamePacketNew< FFXIVIpcInitUI, ServerZoneIpcType >
{
public:
InitUIPacket( Entity::PlayerPtr player ) :
GamePacketNew< FFXIVIpcInitUI >( player->getId(), player->getId() )
GamePacketNew< FFXIVIpcInitUI, ServerZoneIpcType >( player->getId(), player->getId() )
{
initialize( player );
};

View file

@ -14,11 +14,11 @@ namespace Server {
* @brief The update model packet.
*/
class ModelEquipPacket :
public GamePacketNew<FFXIVIpcModelEquip>
public GamePacketNew< FFXIVIpcModelEquip, ServerZoneIpcType >
{
public:
ModelEquipPacket( Entity::PlayerPtr player ) :
GamePacketNew<FFXIVIpcModelEquip>( player->getId(), player->getId() )
GamePacketNew< FFXIVIpcModelEquip, ServerZoneIpcType >( player->getId(), player->getId() )
{
initialize( player );
};

View file

@ -2,7 +2,7 @@
#define _MOVEACTORPACKET_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Util/UtilMath.h>
#include "src/servers/Server_Zone/Actor/Player.h"
#include "src/servers/Server_Zone/Forwards.h"
@ -18,11 +18,11 @@ namespace Server {
* once upon connection to configure the UI.
*/
class MoveActorPacket :
public GamePacketNew<FFXIVIpcActorMove>
public GamePacketNew< FFXIVIpcActorMove, ServerZoneIpcType >
{
public:
MoveActorPacket( Entity::ActorPtr actor, uint8_t unk1, uint8_t unk2, uint8_t unk3, uint16_t unk4 ) :
GamePacketNew<FFXIVIpcActorMove>( actor->getId(), actor->getId() )
GamePacketNew< FFXIVIpcActorMove, ServerZoneIpcType >( actor->getId(), actor->getId() )
{
initialize( actor, unk1, unk2, unk3, unk4 );
};

View file

@ -14,11 +14,11 @@ namespace Server {
* @brief The Ping response packet.
*/
class PingPacket :
public GamePacketNew<FFXIVIpcPing>
public GamePacketNew< FFXIVIpcPing, ServerZoneIpcType >
{
public:
PingPacket( Entity::PlayerPtr player, int32_t inVal ) :
GamePacketNew<FFXIVIpcPing>( player->getId(), player->getId() )
GamePacketNew< FFXIVIpcPing, ServerZoneIpcType >( player->getId(), player->getId() )
{
initialize( player, inVal );
};

View file

@ -1,7 +1,7 @@
#ifndef _PLAYERSPAWN_H
#define _PLAYERSPAWN_H
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Util/UtilMath.h>
#include "src/servers/Server_Zone/Actor/Player.h"
@ -18,11 +18,11 @@ namespace Server {
* @brief The packet sent to spawn a player.
*/
class PlayerSpawnPacket :
public GamePacketNew<FFXIVIpcPlayerSpawn>
public GamePacketNew< FFXIVIpcPlayerSpawn, ServerZoneIpcType >
{
public:
PlayerSpawnPacket( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget ) :
GamePacketNew<FFXIVIpcPlayerSpawn>( pPlayer->getId(), pTarget->getId() )
GamePacketNew< FFXIVIpcPlayerSpawn, ServerZoneIpcType >( pPlayer->getId(), pTarget->getId() )
{
initialize( pPlayer, pTarget );
};

View file

@ -14,17 +14,17 @@ namespace Server {
* @brief Packet sent to set a players state, this impacts which actions he can perform.
*/
class PlayerStateFlagsPacket :
public GamePacketNew< FFXIVIpcPlayerStateFlags >
public GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >
{
public:
PlayerStateFlagsPacket( Entity::PlayerPtr pActor ) :
GamePacketNew< FFXIVIpcPlayerStateFlags >( pActor->getId(), pActor->getId() )
GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
{
initialize( pActor->getStateFlags() );
}
PlayerStateFlagsPacket( Entity::PlayerPtr pActor, std::vector< Common::PlayerStateFlag > flags ) :
GamePacketNew< FFXIVIpcPlayerStateFlags >( pActor->getId(), pActor->getId() )
GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
{
uint8_t newFlags[7];
memset( newFlags, 0, 7 );

View file

@ -14,12 +14,12 @@ namespace Server {
* @brief Packet to display a quest specific info message.
*/
class QuestMessagePacket :
public GamePacketNew< FFXIVIpcQuestMessage >
public GamePacketNew< FFXIVIpcQuestMessage, ServerZoneIpcType >
{
public:
QuestMessagePacket( Entity::ActorPtr pActor, uint32_t questId, int8_t msgId,
uint8_t type = 0, uint32_t var1 = 0, uint32_t var2 = 0 ) :
GamePacketNew< FFXIVIpcQuestMessage >( pActor->getId(), pActor->getId() )
GamePacketNew< FFXIVIpcQuestMessage, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
{
initialize( questId, msgId, type, var1, var2 );
};

View file

@ -2,7 +2,7 @@
#define _SERVERNOTICEPACKET_H
#include <src/servers/Server_Common/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "src/servers/Server_Zone/Forwards.h"
namespace Core {
@ -14,11 +14,11 @@ namespace Server {
* @brief The Ping response packet.
*/
class ServerNoticePacket :
public GamePacketNew<FFXIVIpcServerNotice>
public GamePacketNew<FFXIVIpcServerNotice, ServerZoneIpcType>
{
public:
ServerNoticePacket( uint32_t playerId, const std::string& message ) :
GamePacketNew<FFXIVIpcServerNotice>( playerId, playerId )
GamePacketNew<FFXIVIpcServerNotice, ServerZoneIpcType>( playerId, playerId )
{
initialize( message );
};

View file

@ -13,11 +13,11 @@ namespace Server {
* @brief The Ping response packet.
*/
class UpdateHpMpTpPacket :
public GamePacketNew< FFXIVIpcUpdateHpMpTp >
public GamePacketNew< FFXIVIpcUpdateHpMpTp, ServerZoneIpcType >
{
public:
UpdateHpMpTpPacket( Entity::ActorPtr pActor ) :
GamePacketNew< FFXIVIpcUpdateHpMpTp >( pActor->getId(), pActor->getId() )
GamePacketNew< FFXIVIpcUpdateHpMpTp, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
{
initialize( pActor );
};

View file

@ -1,6 +1,6 @@
#include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Util/Util.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Logging/Logger.h>
#include <src/servers/Server_Common/Exd/ExdData.h>

View file

@ -1,5 +1,5 @@
#include <src/servers/Server_Common/Util/Util.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include "src/servers/Server_Zone/Actor/Actor.h"
#include "StatusEffect.h"
@ -56,7 +56,7 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr
pEffect->applyStatus();
m_effectMap[nextSlot] = pEffect;
GamePacketNew< Server::FFXIVIpcAddStatusEffect > statusEffectAdd( m_pOwner->getId() );
GamePacketNew< Server::FFXIVIpcAddStatusEffect, ServerZoneIpcType > statusEffectAdd( m_pOwner->getId() );
statusEffectAdd.data().actor_id = m_pOwner->getId();
statusEffectAdd.data().actor_id1 = m_pOwner->getId();
statusEffectAdd.data().current_hp = m_pOwner->getHp();
@ -99,7 +99,7 @@ void Core::StatusEffect::StatusEffectContainer::sendUpdate()
{
uint64_t currentTimeMs = Util::getTimeMs();
GamePacketNew< Server::FFXIVIpcStatusEffectList > statusEffectList( m_pOwner->getId() );
GamePacketNew< Server::FFXIVIpcStatusEffectList, ServerZoneIpcType > statusEffectList( m_pOwner->getId() );
statusEffectList.data().current_hp = m_pOwner->getHp();
statusEffectList.data().current_mp = m_pOwner->getMp();

View file

@ -10,7 +10,7 @@
#include <src/servers/Server_Common/Database/Database.h>
#include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Network/CommonNetwork.h>
#include <src/servers/Server_Common/Network/PacketDef/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketDef/Zone/ServerPacketDef.h>
#include <src/servers/Server_Common/Network/PacketContainer.h>
#include "Zone.h"
@ -523,7 +523,9 @@ bool Zone::runZoneLogic()
if( changedWeather )
{
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcWeatherChange > weatherChangePacket( pSession->getPlayer()->getId() );
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcWeatherChange,
Network::Packets::ServerZoneIpcType >
weatherChangePacket( pSession->getPlayer()->getId() );
weatherChangePacket.data().weatherId = m_currentWeather;
weatherChangePacket.data().delay = 5.0f;
pSession->getPlayer()->queuePacket( weatherChangePacket );