1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +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 // 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, LobbyError = 0x0002,
LobbyServiceAccountList = 0x000C, LobbyServiceAccountList = 0x000C,
@ -137,6 +137,25 @@ namespace Packets {
LobbyServerList = 0x0015, LobbyServerList = 0x0015,
LobbyRetainerList = 0x0017, 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 Ping = 0x0065, // updated for sb
Init = 0x0066, // updated for sb Init = 0x0066, // updated for sb
Chat = 0x0067, // updated for sb Chat = 0x0067, // updated for sb
@ -215,16 +234,10 @@ namespace Packets {
// TODO: Include structures for the individual packet segment types // 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 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 struct FFXIVARR_PACKET_RAW
{ {
FFXIVARR_PACKET_SEGMENT_HEADER segHdr; FFXIVARR_PACKET_SEGMENT_HEADER segHdr;
@ -300,7 +329,7 @@ namespace Packets {
struct FFXIVARR_IPC_HEADER struct FFXIVARR_IPC_HEADER
{ {
uint16_t reserved; uint16_t reserved;
ServerIpcType type; uint16_t type;
uint16_t unknown_2; uint16_t unknown_2;
uint16_t serverId; uint16_t serverId;
uint32_t timestamp; uint32_t timestamp;

View file

@ -16,15 +16,16 @@ namespace Packets {
// Must forward define these in order to enable the compiler to produce the // Must forward define these in order to enable the compiler to produce the
// correct template functions. // correct template functions.
template <typename T> template <typename T, typename T1>
class GamePacketNew; class GamePacketNew;
template <typename T> template <typename T, typename T1>
std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T>& packet ); std::ostream& operator<< ( std::ostream& os, const GamePacketNew<T, T1>& packet );
/** /**
* The base implementation of a game packet. Needed for parsing packets. * The base implementation of a game packet. Needed for parsing packets.
*/ */
template <typename T1>
class GamePacketNewBase class GamePacketNewBase
{ {
public: public:
@ -33,7 +34,7 @@ public:
* @brief Gets the IPC type of this packet. (Useful for determining the * @brief Gets the IPC type of this packet. (Useful for determining the
* type of a parsed packet.) * 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 * type that represents just the IPC data portion (the bytes after the initial
* 32 byte header information.) * 32 byte header information.)
*/ */
template <typename T> template <typename T, typename T1>
class GamePacketNew : public GamePacketNewBase class GamePacketNew : public GamePacketNewBase<T1>
{ {
public: public:
/** /**
@ -51,7 +52,7 @@ public:
* @param sourceActorId The source actor id. * @param sourceActorId The source actor id.
* @param targetActorId The target 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(); initialize();
m_segHdr.source_actor = sourceActorId; m_segHdr.source_actor = sourceActorId;
@ -62,7 +63,7 @@ public:
* @brief Constructs a new game packet with the specified actors. * @brief Constructs a new game packet with the specified actors.
* @param sourceActorId The source and target actor id. * @param sourceActorId The source and target actor id.
*/ */
GamePacketNew<T>( uint32_t bothActorId ) GamePacketNew<T, T1>( uint32_t bothActorId )
{ {
initialize(); initialize();
m_segHdr.source_actor = bothActorId; m_segHdr.source_actor = bothActorId;
@ -85,13 +86,13 @@ protected:
// Game packets (IPC) are type 3. // Game packets (IPC) are type 3.
m_segHdr.type = 3; m_segHdr.type = 3;
// The IPC type itself. // The IPC type itself.
m_ipcHdr.type = static_cast< ServerIpcType >( m_data._ServerIpcType ); m_ipcHdr.type = static_cast< ServerZoneIpcType >( m_data._ServerIpcType );
}; };
public: 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. */ /** Gets a reference to the underlying IPC data structure. */
@ -102,7 +103,7 @@ public:
* @param actorId The source actor id. * @param actorId The source actor id.
* @return This IPC packet object (can be used for chaining). * @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; m_segHdr.source_actor = actorId;
return this; return this;
@ -122,7 +123,7 @@ public:
* @param actorId The target actor id. * @param actorId The target actor id.
* @return This IPC packet object (can be used for chaining). * @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; m_segHdr.target_actor = actorId;
return this; return this;
@ -137,7 +138,7 @@ public:
return m_segHdr.target_actor; 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; friend class GamePacketFactory;
@ -198,8 +199,8 @@ private:
}; };
}; };
template <typename T> template <typename T, typename T1>
std::ostream& operator<<( std::ostream& os, const GamePacketNew<T>& packet ) std::ostream& operator<<( std::ostream& os, const GamePacketNew<T, T1>& packet )
{ {
#if 0 #if 0
// Since the packet itself is constant, we need to make a copy of the IPC // 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/Logging/Logger.h>
#include <src/servers/Server_Common/Network/GamePacket.h> #include <src/servers/Server_Common/Network/GamePacket.h>
#include <src/servers/Server_Common/Network/GamePacketNew.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 <src/servers/Server_Common/Crypt/md5.h>
#include <boost/format.hpp> #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 ) 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().seq = sequence;
errorPacket.data().error_id = errorcode; 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" ); g_log.info( "[" + std::to_string( m_pSession->getAccountID() ) + "] ReqCharList" );
Packets::LobbyPacketContainer pRP( m_encKey ); Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcServerList > serverListPacket( tmpId ); GamePacketNew< FFXIVIpcServerList, ServerLobbyIpcType > serverListPacket( tmpId );
serverListPacket.data().seq = 1; serverListPacket.data().seq = 1;
serverListPacket.data().offset = 0; serverListPacket.data().offset = 0;
serverListPacket.data().numServers = 1; serverListPacket.data().numServers = 1;
@ -111,7 +111,7 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
pRP.addPacket( serverListPacket ); pRP.addPacket( serverListPacket );
GamePacketNew< FFXIVIpcRetainerList > retainerListPacket( tmpId ); GamePacketNew< FFXIVIpcRetainerList, ServerLobbyIpcType > retainerListPacket( tmpId );
retainerListPacket.data().padding[8] = 1; retainerListPacket.data().padding[8] = 1;
pRP.addPacket( retainerListPacket ); 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++ ) for( uint8_t i = 0; i < 4; i++ )
{ {
GamePacketNew< FFXIVIpcCharList > charListPacket( tmpId ); GamePacketNew< FFXIVIpcCharList, ServerLobbyIpcType > charListPacket( tmpId );
charListPacket.data().seq = sequence; charListPacket.data().seq = sequence;
charListPacket.data().numInPacket = 2; charListPacket.data().numInPacket = 2;
@ -206,7 +206,7 @@ void Core::Network::GameConnection::enterWorld( FFXIVARR_PACKET_RAW& packet, uin
Packets::LobbyPacketContainer pRP( m_encKey ); Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcEnterWorld > enterWorldPacket( tmpId ); GamePacketNew< FFXIVIpcEnterWorld, ServerLobbyIpcType > enterWorldPacket( tmpId );
enterWorldPacket.data().contentId = lookupId; 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() ) ); g_log.Log( LoggingSeverity::info, "Found session linked to accountId: " + std::to_string( pSession->getAccountID() ) );
m_pSession = pSession; m_pSession = pSession;
GamePacketNew< FFXIVIpcServiceIdInfo > serviceIdInfoPacket( tmpId ); GamePacketNew< FFXIVIpcServiceIdInfo, ServerLobbyIpcType > serviceIdInfoPacket( tmpId );
sprintf( serviceIdInfoPacket.data().serviceAccount[0].name, "FINAL FANTASY XIV" ); sprintf( serviceIdInfoPacket.data().serviceAccount[0].name, "FINAL FANTASY XIV" );
serviceIdInfoPacket.data().numServiceAccounts = 1; serviceIdInfoPacket.data().numServiceAccounts = 1;
@ -288,7 +288,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
return true; return true;
} }
GamePacketNew< FFXIVIpcCharCreate > charCreatePacket( tmpId ); GamePacketNew< FFXIVIpcCharCreate, ServerLobbyIpcType > charCreatePacket( tmpId );
charCreatePacket.data().content_id = newContentId; charCreatePacket.data().content_id = newContentId;
strcpy( charCreatePacket.data().name, name.c_str() ); 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 ); Packets::LobbyPacketContainer pRP( m_encKey );
GamePacketNew< FFXIVIpcCharCreate > charCreatePacket( tmpId ); GamePacketNew< FFXIVIpcCharCreate, ServerLobbyIpcType > charCreatePacket( tmpId );
charCreatePacket.data().content_id = newContentId; charCreatePacket.data().content_id = newContentId;
strcpy( charCreatePacket.data().name, name.c_str() ); 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 ) ) 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 = deletePlayer.getContentId();
charCreatePacket.data().content_id = 0; charCreatePacket.data().content_id = 0;

View file

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

View file

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

View file

@ -49,7 +49,7 @@ void Core::Action::EventItemAction::onStart()
m_startTime = Util::getTimeMs(); m_startTime = Util::getTimeMs();
GamePacketNew< FFXIVIpcActorCast > castPacket( m_pSource->getId() ); GamePacketNew< FFXIVIpcActorCast, ServerZoneIpcType > castPacket( m_pSource->getId() );
castPacket.data().action_id = 1; castPacket.data().action_id = 1;
castPacket.data().unknown = 3; castPacket.data().unknown = 3;
@ -70,7 +70,7 @@ void Core::Action::EventItemAction::onFinish()
try 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().targetId = static_cast< uint32_t >( m_additional );
effectPacket.data().actionAnimationId = 1; effectPacket.data().actionAnimationId = 1;
// effectPacket.data().unknown_3 = 3; // 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 damage = 10 + rand() % 12;
uint32_t variation = 0 + rand() % 3; uint32_t variation = 0 + rand() % 3;
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() ); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget->getId(); effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 0x366; effectPacket.data().actionAnimationId = 0x366;
effectPacket.data().unknown_2 = variation; effectPacket.data().unknown_2 = variation;

View file

@ -123,7 +123,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget )
//pTarget->queuePacket( spawnPacket ); //pTarget->queuePacket( spawnPacket );
GamePacketNew< FFXIVIpcNpcSpawn > spawnPacket( getId(), pTarget->getId() ); GamePacketNew< FFXIVIpcNpcSpawn, ServerZoneIpcType > spawnPacket( getId(), pTarget->getId() );
spawnPacket.data().pos.x = m_pos.x; spawnPacket.data().pos.x = m_pos.x;
@ -221,14 +221,14 @@ void Core::Entity::BattleNpc::setOwner( Core::Entity::PlayerPtr pPlayer )
if( pPlayer != nullptr ) if( pPlayer != nullptr )
{ {
GamePacketNew< FFXIVIpcActorOwner > setOwnerPacket( getId(), pPlayer->getId() ); GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket( getId(), pPlayer->getId() );
setOwnerPacket.data().type = 0x01; setOwnerPacket.data().type = 0x01;
setOwnerPacket.data().actorId = pPlayer->getId(); setOwnerPacket.data().actorId = pPlayer->getId();
sendToInRangeSet( setOwnerPacket ); sendToInRangeSet( setOwnerPacket );
} }
else else
{ {
GamePacketNew< FFXIVIpcActorOwner > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID); GamePacketNew< FFXIVIpcActorOwner, ServerZoneIpcType > setOwnerPacket(getId(), INVALID_GAME_OBJECT_ID);
setOwnerPacket.data().type = 0x01; setOwnerPacket.data().type = 0x01;
setOwnerPacket.data().actorId = INVALID_GAME_OBJECT_ID; setOwnerPacket.data().actorId = INVALID_GAME_OBJECT_ID;
sendToInRangeSet( setOwnerPacket ); 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 ) 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().targetZone = targetZone;
preparePacket.data().fadeOut = fadeOut == true ? 1 : 0; preparePacket.data().fadeOut = fadeOut == true ? 1 : 0;
queuePacket( preparePacket ); queuePacket( preparePacket );
@ -259,7 +259,7 @@ bool Core::Entity::Player::isAutoattackOn() const
void Core::Entity::Player::sendStats() void Core::Entity::Player::sendStats()
{ {
GamePacketNew< FFXIVIpcPlayerStats > statPacket( getId() ); GamePacketNew< FFXIVIpcPlayerStats, ServerZoneIpcType > statPacket( getId() );
statPacket.data().strength = m_baseStats.str; statPacket.data().strength = m_baseStats.str;
statPacket.data().dexterity = m_baseStats.dex; statPacket.data().dexterity = m_baseStats.dex;
statPacket.data().vitality = m_baseStats.vit; 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 // mark the player for a position update in DB
setSyncFlag( PlayerSyncFlags::Position ); setSyncFlag( PlayerSyncFlags::Position );
GamePacketNew< FFXIVIpcInit > initPacket( getId() ); GamePacketNew< FFXIVIpcInit, ServerZoneIpcType > initPacket( getId() );
initPacket.data().charId = getId(); initPacket.data().charId = getId();
queuePacket( initPacket ); 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. // only initialize the UI if the player in fact just logged in.
if( isLogin() ) if( isLogin() )
{ {
GamePacketNew< FFXIVIpcCFAvailableContents > contentFinderList( getId() ); GamePacketNew< FFXIVIpcCFAvailableContents, ServerZoneIpcType > contentFinderList( getId() );
for( auto i = 0; i < 72; i++ ) for( auto i = 0; i < 72; i++ )
{ {
// unlock all contents for now // unlock all contents for now
@ -405,14 +405,14 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
Server::InitUIPacket initUIPacket( pPlayer ); Server::InitUIPacket initUIPacket( pPlayer );
queuePacket( initUIPacket ); queuePacket( initUIPacket );
GamePacketNew< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() ); GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass(); classInfoPacket.data().classId = getClass();
classInfoPacket.data().unknown = 1; classInfoPacket.data().unknown = 1;
classInfoPacket.data().level = getLevel(); classInfoPacket.data().level = getLevel();
classInfoPacket.data().level1 = getLevel(); classInfoPacket.data().level1 = getLevel();
queuePacket( classInfoPacket ); queuePacket( classInfoPacket );
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() ); GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc; gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0]; gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1]; gcAffPacket.data().gcRank[1] = m_gcRank[1];
@ -420,7 +420,7 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
queuePacket( gcAffPacket ); queuePacket( gcAffPacket );
} }
GamePacketNew< FFXIVIpcInitZone > initZonePacket( getId() ); GamePacketNew< FFXIVIpcInitZone, ServerZoneIpcType > initZonePacket( getId() );
initZonePacket.data().zoneId = getCurrentZone()->getLayoutId(); initZonePacket.data().zoneId = getCurrentZone()->getLayoutId();
initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() ); initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
initZonePacket.data().bitmask = 0x2A; initZonePacket.data().bitmask = 0x2A;
@ -431,10 +431,10 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
if( isLogin() ) if( isLogin() )
{ {
GamePacketNew< FFXIVARR_IPC_UNK322 > unk322( getId() ); GamePacketNew< FFXIVARR_IPC_UNK322, ServerZoneIpcType > unk322( getId() );
queuePacket( unk322 ); queuePacket( unk322 );
GamePacketNew< FFXIVARR_IPC_UNK320 > unk320( getId() ); GamePacketNew< FFXIVARR_IPC_UNK320, ServerZoneIpcType > unk320( getId() );
queuePacket( unk320 ); queuePacket( unk320 );
} }
@ -655,7 +655,7 @@ void Core::Entity::Player::gainLevel()
m_hp = getMaxHp(); m_hp = getMaxHp();
m_mp = getMaxMp(); m_mp = getMaxMp();
GamePacketNew< FFXIVIpcStatusEffectList > effectListPacket( getId() ); GamePacketNew< FFXIVIpcStatusEffectList, ServerZoneIpcType > effectListPacket( getId() );
effectListPacket.data().classId = getClass(); effectListPacket.data().classId = getClass();
effectListPacket.data().classId1 = getClass(); effectListPacket.data().classId1 = getClass();
effectListPacket.data().level = getLevel(); effectListPacket.data().level = getLevel();
@ -670,7 +670,7 @@ void Core::Entity::Player::gainLevel()
getLevel(), getLevel() - 1 ), true ); getLevel(), getLevel() - 1 ), true );
GamePacketNew< FFXIVIpcUpdateClassInfo > classInfoPacket( getId() ); GamePacketNew< FFXIVIpcUpdateClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass(); classInfoPacket.data().classId = getClass();
classInfoPacket.data().classId1 = getClass(); classInfoPacket.data().classId1 = getClass();
classInfoPacket.data().level = getLevel(); classInfoPacket.data().level = getLevel();
@ -760,7 +760,7 @@ void Core::Entity::Player::setClassJob( Core::Common::ClassJob classJob )
m_tp = 0; m_tp = 0;
GamePacketNew< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() ); GamePacketNew< FFXIVIpcPlayerClassInfo, ServerZoneIpcType > classInfoPacket( getId() );
classInfoPacket.data().classId = getClass(); classInfoPacket.data().classId = getClass();
classInfoPacket.data().level = getLevel(); classInfoPacket.data().level = getLevel();
queuePacket( classInfoPacket ); queuePacket( classInfoPacket );
@ -950,7 +950,7 @@ void Core::Entity::Player::setGc( uint8_t gc )
{ {
m_gc = gc; m_gc = gc;
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() ); GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc; gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0]; gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1]; 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; m_gcRank[index] = rank;
GamePacketNew< FFXIVGCAffiliation > gcAffPacket( getId() ); GamePacketNew< FFXIVGCAffiliation, ServerZoneIpcType > gcAffPacket( getId() );
gcAffPacket.data().gcId = m_gc; gcAffPacket.data().gcId = m_gc;
gcAffPacket.data().gcRank[0] = m_gcRank[0]; gcAffPacket.data().gcRank[0] = m_gcRank[0];
gcAffPacket.data().gcRank[1] = m_gcRank[1]; gcAffPacket.data().gcRank[1] = m_gcRank[1];
@ -1060,7 +1060,7 @@ void Core::Entity::Player::update( int64_t currTime )
} }
else else
{ {
GamePacketNew< FFXIVIpcActorSetPos > setActorPosPacket( getId() ); GamePacketNew< FFXIVIpcActorSetPos, ServerZoneIpcType > setActorPosPacket( getId() );
setActorPosPacket.data().r16 = Math::Util::floatToUInt16Rot( m_queuedZoneing->m_targetRotation ); setActorPosPacket.data().r16 = Math::Util::floatToUInt16Rot( m_queuedZoneing->m_targetRotation );
setActorPosPacket.data().waitForLoad = 0x04; setActorPosPacket.data().waitForLoad = 0x04;
setActorPosPacket.data().x = targetPos.x; setActorPosPacket.data().x = targetPos.x;
@ -1154,7 +1154,7 @@ void Core::Entity::Player::freePlayerSpawnId( uint32_t actorId )
m_playerIdToSpawnIdMap.erase( actorId ); m_playerIdToSpawnIdMap.erase( actorId );
m_freeSpawnIdQueue.push( spawnId ); m_freeSpawnIdQueue.push( spawnId );
GamePacketNew< FFXIVIpcActorFreeSpawn > freeActorSpawnPacket( getId() ); GamePacketNew< FFXIVIpcActorFreeSpawn, ServerZoneIpcType > freeActorSpawnPacket( getId() );
freeActorSpawnPacket.data().actorId = actorId; freeActorSpawnPacket.data().actorId = actorId;
freeActorSpawnPacket.data().spawnId = spawnId; freeActorSpawnPacket.data().spawnId = spawnId;
queuePacket( freeActorSpawnPacket ); queuePacket( freeActorSpawnPacket );
@ -1421,7 +1421,7 @@ void Core::Entity::Player::initHateSlotQueue()
void Core::Entity::Player::sendHateList() void Core::Entity::Player::sendHateList()
{ {
GamePacketNew< FFXIVIpcHateList > hateListPacket( getId() ); GamePacketNew< FFXIVIpcHateList, ServerZoneIpcType > hateListPacket( getId() );
hateListPacket.data().numEntries = m_actorIdTohateSlotMap.size(); hateListPacket.data().numEntries = m_actorIdTohateSlotMap.size();
auto it = m_actorIdTohateSlotMap.begin(); auto it = m_actorIdTohateSlotMap.begin();
for( int32_t i = 0; it != m_actorIdTohateSlotMap.end(); ++it, i++ ) 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 ) if( getClass() == 5 || getClass() == 23 || getClass() == 31 )
{ {
GamePacketNew< FFXIVIpcEffect > effectPacket(getId()); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId(); effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 8; effectPacket.data().actionAnimationId = 8;
// effectPacket.data().unknown_2 = variation; // effectPacket.data().unknown_2 = variation;
@ -1477,7 +1477,7 @@ void Core::Entity::Player::autoAttack( ActorPtr pTarget )
else else
{ {
GamePacketNew< FFXIVIpcEffect > effectPacket(getId()); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket(getId());
effectPacket.data().targetId = pTarget->getId(); effectPacket.data().targetId = pTarget->getId();
effectPacket.data().actionAnimationId = 7; effectPacket.data().actionAnimationId = 7;
// effectPacket.data().unknown_2 = variation; // 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: case Core::Common::HandleSkillType::StdDamage:
{ {
sendDebug( "STD_DAMAGE" ); sendDebug( "STD_DAMAGE" );
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() ); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId(); effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId; effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0; 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: case Core::Common::HandleSkillType::StdHeal:
{ {
sendDebug( "STD_HEAL" ); sendDebug( "STD_HEAL" );
GamePacketNew< FFXIVIpcEffect > effectPacket( getId() ); GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() );
effectPacket.data().targetId = pTarget.getId(); effectPacket.data().targetId = pTarget.getId();
effectPacket.data().actionAnimationId = actionId; effectPacket.data().actionAnimationId = actionId;
effectPacket.data().unknown_2 = 0; 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 ) ) if( !m_pInventory->addCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
return; return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() ); GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Currency; invUpPacket.data().containerId = Inventory::InventoryType::Currency;
invUpPacket.data().catalogId = 1; invUpPacket.data().catalogId = 1;
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) ); 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 ) ) if( !m_pInventory->removeCurrency( static_cast< Inventory::CurrencyType >( type ), amount ) )
return; return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() ); GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Currency; invUpPacket.data().containerId = Inventory::InventoryType::Currency;
invUpPacket.data().catalogId = 1; invUpPacket.data().catalogId = 1;
invUpPacket.data().quantity = m_pInventory->getCurrency( static_cast< Inventory::CurrencyType >( type ) ); 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 ) ) if( !m_pInventory->addCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
return; return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() ); GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Crystal; invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1; invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) ); 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 ) ) if( !m_pInventory->removeCrystal( static_cast< Inventory::CrystalType >( type ), amount ) )
return; return;
GamePacketNew< FFXIVIpcUpdateInventorySlot > invUpPacket( getId() ); GamePacketNew< FFXIVIpcUpdateInventorySlot, ServerZoneIpcType > invUpPacket( getId() );
invUpPacket.data().containerId = Inventory::InventoryType::Crystal; invUpPacket.data().containerId = Inventory::InventoryType::Crystal;
invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1; invUpPacket.data().catalogId = static_cast< uint8_t >( type ) + 1;
invUpPacket.data().quantity = m_pInventory->getCrystal( static_cast< Inventory::CrystalType >( type ) ); 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/Common.h>
#include <src/servers/Server_Common/Database/Database.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/Network/GamePacket.h>
#include <src/servers/Server_Common/Exd/ExdData.h> #include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Network/PacketContainer.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 ) ) if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{ {
GamePacketNew< FFXIVIpcQuestUpdate > questUpdatePacket( getId() ); GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > questUpdatePacket( getId() );
questUpdatePacket.data().slot = idx; questUpdatePacket.data().slot = idx;
questUpdatePacket.data().questInfo.c.questId = 0; questUpdatePacket.data().questInfo.c.questId = 0;
questUpdatePacket.data().questInfo.c.sequence = 0xFF; questUpdatePacket.data().questInfo.c.sequence = 0xFF;
queuePacket( questUpdatePacket ); queuePacket( questUpdatePacket );
GamePacketNew< FFXIVIpcQuestFinish > questFinishPacket( getId() ); GamePacketNew< FFXIVIpcQuestFinish, ServerZoneIpcType > questFinishPacket( getId() );
questFinishPacket.data().questId = questId; questFinishPacket.data().questId = questId;
questFinishPacket.data().flag1 = 1; questFinishPacket.data().flag1 = 1;
questFinishPacket.data().flag2 = 1; questFinishPacket.data().flag2 = 1;
@ -128,13 +128,13 @@ void Core::Entity::Player::removeQuest( uint16_t questId )
if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) ) if( ( idx != -1 ) && ( m_activeQuests[idx] != nullptr ) )
{ {
GamePacketNew< FFXIVIpcQuestUpdate > questUpdatePacket( getId() ); GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > questUpdatePacket( getId() );
questUpdatePacket.data().slot = idx; questUpdatePacket.data().slot = idx;
questUpdatePacket.data().questInfo.c.questId = 0; questUpdatePacket.data().questInfo.c.questId = 0;
questUpdatePacket.data().questInfo.c.sequence = 0xFF; questUpdatePacket.data().questInfo.c.sequence = 0xFF;
queuePacket( questUpdatePacket ); queuePacket( questUpdatePacket );
GamePacketNew< FFXIVIpcQuestFinish > questFinishPacket( getId() ); GamePacketNew< FFXIVIpcQuestFinish, ServerZoneIpcType > questFinishPacket( getId() );
questFinishPacket.data().questId = questId; questFinishPacket.data().questId = questId;
questFinishPacket.data().flag1 = 1; questFinishPacket.data().flag1 = 1;
questFinishPacket.data().flag2 = 1; questFinishPacket.data().flag2 = 1;
@ -977,7 +977,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint16_t sequence )
{ {
if( hasQuest( questId ) ) if( hasQuest( questId ) )
{ {
GamePacketNew< FFXIVIpcQuestUpdate > pe_qa( getId() ); GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
int16_t index = getQuestIndex( questId ); int16_t index = getQuestIndex( questId );
auto pNewQuest = m_activeQuests[index]; auto pNewQuest = m_activeQuests[index];
pe_qa.data().slot = 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(); int8_t idx = m_freeQuestIdxQueue.front();
m_freeQuestIdxQueue.pop(); m_freeQuestIdxQueue.pop();
GamePacketNew< FFXIVIpcQuestUpdate > pe_qa( getId() ); GamePacketNew< FFXIVIpcQuestUpdate, ServerZoneIpcType > pe_qa( getId() );
boost::shared_ptr< QuestActive > pNewQuest( new QuestActive() ); boost::shared_ptr< QuestActive > pNewQuest( new QuestActive() );
pNewQuest->c.questId = questId; pNewQuest->c.questId = questId;
@ -1031,7 +1031,7 @@ void Core::Entity::Player::updateQuest( uint16_t questId, uint16_t sequence )
void Core::Entity::Player::sendQuestTracker() void Core::Entity::Player::sendQuestTracker()
{ {
GamePacketNew< FFXIVIpcQuestTracker > trackerPacket( getId() ); GamePacketNew< FFXIVIpcQuestTracker, ServerZoneIpcType > trackerPacket( getId() );
for( int32_t ii = 0; ii < 5; ii++ ) 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() void Core::Entity::Player::sendQuestInfo()
{ {
GamePacketNew< FFXIVIpcQuestActiveList > pe_qa( getId() ); GamePacketNew< FFXIVIpcQuestActiveList, ServerZoneIpcType > pe_qa( getId() );
for( int32_t i = 0; i < 30; i++ ) for( int32_t i = 0; i < 30; i++ )
{ {
@ -1094,7 +1094,7 @@ void Core::Entity::Player::sendQuestInfo()
queuePacket( pe_qa ); queuePacket( pe_qa );
GamePacketNew< FFXIVIpcQuestCompleteList > pe_qc( getId() ); GamePacketNew< FFXIVIpcQuestCompleteList, ServerZoneIpcType > pe_qc( getId() );
memcpy( pe_qc.data().questCompleteMask, m_questCompleteFlags, 200 ); memcpy( pe_qc.data().questCompleteMask, m_questCompleteFlags, 200 );
queuePacket( pe_qc ); 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().y + static_cast< float >( posY ),
pPlayer->getPos().z + static_cast< float >( posZ ) ); 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( pPlayer->getId() );
setActorPosPacket.data().x = pPlayer->getPos().x; setActorPosPacket.data().x = pPlayer->getPos().x;
setActorPosPacket.data().y = pPlayer->getPos().y; setActorPosPacket.data().y = pPlayer->getPos().y;
@ -216,7 +216,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
int32_t discover_id; int32_t discover_id;
sscanf( params.c_str(), "%i %i", &map_id, &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_id = map_id;
discoveryPacket.data().map_part_id = discover_id; discoveryPacket.data().map_part_id = discover_id;
pPlayer->queuePacket( discoveryPacket ); 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 ) ); 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().category = opcode;
actorControl.data().param1 = param1; actorControl.data().param1 = param1;
actorControl.data().param2 = param2; actorControl.data().param2 = param2;
@ -511,7 +511,7 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::PlayerPtr pPlayer, b
} }
if( offset != 0 ) if( offset != 0 )
{ {
Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos > Network::Packets::GamePacketNew< Network::Packets::Server::FFXIVIpcActorSetPos, Network::Packets::ServerZoneIpcType >
setActorPosPacket( pPlayer->getId() ); setActorPosPacket( pPlayer->getId() );
setActorPosPacket.data().x = pPlayer->getPos().x; setActorPosPacket.data().x = pPlayer->getPos().x;
setActorPosPacket.data().y = pPlayer->getPos().y; 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/Database/Database.h>
#include <src/servers/Server_Common/Common.h> #include <src/servers/Server_Common/Common.h>
#include <src/servers/Server_Common/Exd/ExdData.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 ) + " WHERE storageId = " + std::to_string( inventoryId ) +
" AND CharacterId = " + std::to_string( m_pOwner->getId() ) ); " 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().containerId = inventoryId;
invUpPacket.data().catalogId = catalogId; invUpPacket.data().catalogId = catalogId;
invUpPacket.data().quantity = item->getStackSize(); invUpPacket.data().quantity = item->getStackSize();
@ -607,7 +607,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
m_inventoryMap[fromInventoryId]->removeItem( fromSlotId ); m_inventoryMap[fromInventoryId]->removeItem( fromSlotId );
updateContainer( fromInventoryId, fromSlotId, nullptr ); updateContainer( fromInventoryId, fromSlotId, nullptr );
GamePacketNew< FFXIVIpcInventoryTransaction > invTransPacket( m_pOwner->getId() ); GamePacketNew< FFXIVIpcInventoryTransaction, ServerZoneIpcType > invTransPacket( m_pOwner->getId() );
invTransPacket.data().transactionId = transactionId; invTransPacket.data().transactionId = transactionId;
invTransPacket.data().ownerId = m_pOwner->getId(); invTransPacket.data().ownerId = m_pOwner->getId();
invTransPacket.data().storageId = fromInventoryId; invTransPacket.data().storageId = fromInventoryId;
@ -617,7 +617,7 @@ void Core::Inventory::discardItem( uint16_t fromInventoryId, uint8_t fromSlotId
invTransPacket.data().type = 7; invTransPacket.data().type = 7;
m_pOwner->queuePacket( invTransPacket ); m_pOwner->queuePacket( invTransPacket );
GamePacketNew< FFXIVIpcInventoryTransactionFinish > invTransFinPacket( m_pOwner->getId() ); GamePacketNew< FFXIVIpcInventoryTransactionFinish, ServerZoneIpcType > invTransFinPacket( m_pOwner->getId() );
invTransFinPacket.data().transactionId = transactionId; invTransFinPacket.data().transactionId = transactionId;
invTransFinPacket.data().transactionId1 = transactionId; invTransFinPacket.data().transactionId1 = transactionId;
m_pOwner->queuePacket( invTransFinPacket ); m_pOwner->queuePacket( invTransFinPacket );
@ -812,7 +812,7 @@ void Core::Inventory::send()
if( it->second->getId() == InventoryType::Currency || it->second->getId() == InventoryType::Crystal ) 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().sequence = count;
currencyInfoPacket.data().catalogId = itM->second->getId(); currencyInfoPacket.data().catalogId = itM->second->getId();
currencyInfoPacket.data().unknown = 1; currencyInfoPacket.data().unknown = 1;
@ -823,7 +823,7 @@ void Core::Inventory::send()
} }
else else
{ {
GamePacketNew< FFXIVIpcItemInfo > itemInfoPacket( m_pOwner->getId() ); GamePacketNew< FFXIVIpcItemInfo, ServerZoneIpcType > itemInfoPacket( m_pOwner->getId() );
itemInfoPacket.data().sequence = count; itemInfoPacket.data().sequence = count;
itemInfoPacket.data().containerId = it->second->getId(); itemInfoPacket.data().containerId = it->second->getId();
itemInfoPacket.data().slot = itM->first; 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().sequence = count;
containerInfoPacket.data().numItems = it->second->getEntryCount(); containerInfoPacket.data().numItems = it->second->getEntryCount();
containerInfoPacket.data().containerId = it->second->getId(); containerInfoPacket.data().containerId = it->second->getId();

View file

@ -31,58 +31,58 @@ Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
, m_pAcceptor( pAcceptor ) , m_pAcceptor( pAcceptor )
, m_conType( ConnectionType::None ) , 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; m_packetHandlerStrMap[opcode] = handlerName;
}; };
setHandler( ClientIpcType::PingHandler, "PingHandler", &GameConnection::pingHandler ); setZoneHandler( ClientZoneIpcType::PingHandler, "PingHandler", &GameConnection::pingHandler );
setHandler( ClientIpcType::InitHandler, "InitHandler", &GameConnection::initHandler ); setZoneHandler( ClientZoneIpcType::InitHandler, "InitHandler", &GameConnection::initHandler );
setHandler( ClientIpcType::ChatHandler, "ChatHandler", &GameConnection::chatHandler ); setZoneHandler( ClientZoneIpcType::ChatHandler, "ChatHandler", &GameConnection::chatHandler );
setHandler( ClientIpcType::FinishLoadingHandler, "FinishLoadingHandler", &GameConnection::finishLoadingHandler ); setZoneHandler( ClientZoneIpcType::FinishLoadingHandler, "FinishLoadingHandler", &GameConnection::finishLoadingHandler );
setHandler( ClientIpcType::PlayTimeHandler, "PlayTimeHandler", &GameConnection::playTimeHandler ); setZoneHandler( ClientZoneIpcType::PlayTimeHandler, "PlayTimeHandler", &GameConnection::playTimeHandler );
setHandler( ClientIpcType::LogoutHandler, "LogoutHandler", &GameConnection::logoutHandler ); setZoneHandler( ClientZoneIpcType::LogoutHandler, "LogoutHandler", &GameConnection::logoutHandler );
setHandler( ClientIpcType::SocialListHandler, "SocialListHandler", &GameConnection::socialListHandler ); setZoneHandler( ClientZoneIpcType::SocialListHandler, "SocialListHandler", &GameConnection::socialListHandler );
setHandler( ClientIpcType::SetSearchInfoHandler, "SetSearchInfoHandler", &GameConnection::setSearchInfoHandler ); setZoneHandler( ClientZoneIpcType::SetSearchInfoHandler, "SetSearchInfoHandler", &GameConnection::setSearchInfoHandler );
setHandler( ClientIpcType::ReqSearchInfoHandler, "ReqSearchInfoHandler", &GameConnection::reqSearchInfoHandler ); 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 ); setZoneHandler( ClientZoneIpcType::ZoneLineHandler, "ZoneLineHandler", &GameConnection::zoneLineHandler );
setHandler( ClientIpcType::ActionHandler, "ActionHandler", &GameConnection::actionHandler ); 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 ); setZoneHandler( ClientZoneIpcType::GMCommand1, "GMCommand1", &GameConnection::gm1Handler );
setHandler( ClientIpcType::GMCommand2, "GMCommand2", &GameConnection::gm2Handler ); 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 ); setZoneHandler( ClientZoneIpcType::TalkEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::EmoteEventHandler, "EventHandler", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::EmoteEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::WithinRangeEventHandler, "EventHandler", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::WithinRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::OutOfRangeEventHandler, "EventHandler", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::OutOfRangeEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::EnterTeriEventHandler, "EventHandler", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::EnterTeriEventHandler, "EventHandler", &GameConnection::eventHandler );
setHandler( ClientIpcType::ReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::ReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setHandler( ClientIpcType::TradeReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler ); setZoneHandler( ClientZoneIpcType::TradeReturnEventHandler, "EventHandlerReturn", &GameConnection::eventHandler );
setHandler( ClientIpcType::CFDutyInfoHandler, "CFDutyInfoRequest", &GameConnection::cfDutyInfoRequest ); setZoneHandler( ClientZoneIpcType::CFDutyInfoHandler, "CFDutyInfoRequest", &GameConnection::cfDutyInfoRequest );
setHandler( ClientIpcType::CFRegisterDuty, "CFRegisterDuty", &GameConnection::cfRegisterDuty ); setZoneHandler( ClientZoneIpcType::CFRegisterDuty, "CFRegisterDuty", &GameConnection::cfRegisterDuty );
setHandler( ClientIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette ); setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
setHandler( ClientIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted); setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
} }
@ -139,14 +139,23 @@ void Core::Network::GameConnection::handleGamePacket( Core::Network::Packets::Ga
if( !m_pSession ) if( !m_pSession )
return; 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()]; auto name = m_packetHandlerStrMap[pPacket->getSubType()];
// dont display packet notification if it is a ping or pos update, don't want the spam // dont display packet notification if it is a ping or pos update, don't want the spam
if( pPacket->getSubType() != ClientIpcType::PingHandler if( pPacket->getSubType() != ClientZoneIpcType::PingHandler &&
&& pPacket->getSubType() != ClientIpcType::UpdatePositionHandler ) pPacket->getSubType() != ClientZoneIpcType::UpdatePositionHandler )
g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Handling packet : " + name + "( " + g_log.debug( "[" + std::to_string( m_pSession->getId() ) + "] Handling packet : " + name + "( " +
boost::str( boost::format( "%|04X|" ) % static_cast< uint32_t >( pPacket->getSubType() & 0xFFFF ) ) + " )" ); 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, void Core::Network::GameConnection::handlePackets( const Core::Network::Packets::FFXIVARR_PACKET_HEADER& ipcHeader,
const std::vector<Core::Network::Packets::FFXIVARR_PACKET_RAW>& packetData ) 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 a session is set, update the last time it recieved a game packet
if( m_pSession ) if( m_pSession )
m_pSession->updateLastDataTime(); m_pSession->updateLastDataTime();

View file

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

View file

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

View file

@ -46,7 +46,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
switch( eventHandlerId ) switch( eventHandlerId )
{ {
case ClientIpcType::TalkEventHandler: // Talk event case ClientZoneIpcType::TalkEventHandler: // Talk event
{ {
uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 ); uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 );
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x28 ); uint32_t eventId = inPacket.getValAt< uint32_t >( 0x28 );
@ -56,7 +56,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break; break;
} }
case ClientIpcType::EmoteEventHandler: // Emote event case ClientZoneIpcType::EmoteEventHandler: // Emote event
{ {
uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 ); uint64_t actorId = inPacket.getValAt< uint64_t >( 0x20 );
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x28 ); 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 eventId = inPacket.getValAt< uint32_t >( 0x24 );
uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 ); uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 );
@ -85,7 +85,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break; break;
} }
case ClientIpcType::OutOfRangeEventHandler: case ClientZoneIpcType::OutOfRangeEventHandler:
{ {
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x24 ); uint32_t eventId = inPacket.getValAt< uint32_t >( 0x24 );
uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 ); uint32_t eventParam1 = inPacket.getValAt< uint32_t >( 0x20 );
@ -100,7 +100,7 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break; break;
} }
case ClientIpcType::EnterTeriEventHandler: case ClientZoneIpcType::EnterTeriEventHandler:
{ {
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 ); uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 );
uint16_t eventParam1 = inPacket.getValAt< uint16_t >( 0x24 ); uint16_t eventParam1 = inPacket.getValAt< uint16_t >( 0x24 );
@ -113,8 +113,8 @@ void Core::Network::GameConnection::eventHandler( const Packets::GamePacket& inP
break; break;
} }
case ClientIpcType::ReturnEventHandler: case ClientZoneIpcType::ReturnEventHandler:
case ClientIpcType::TradeReturnEventHandler: case ClientZoneIpcType::TradeReturnEventHandler:
{ {
uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 ); uint32_t eventId = inPacket.getValAt< uint32_t >( 0x20 );
uint16_t subEvent = inPacket.getValAt< uint16_t >( 0x24 ); 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 ); targetPlayer->setOnlineStatusMask( param1 );
GamePacketNew< FFXIVIpcSetOnlineStatus > statusPacket( targetPlayer->getId() ); GamePacketNew< FFXIVIpcSetOnlineStatus, ServerZoneIpcType > statusPacket( targetPlayer->getId() );
statusPacket.data().onlineStatusFlags = param1; statusPacket.data().onlineStatusFlags = param1;
queueOutPacket( statusPacket ); queueOutPacket( statusPacket );
GamePacketNew< FFXIVIpcSetSearchInfo > searchInfoPacket( targetPlayer->getId() ); GamePacketNew< FFXIVIpcSetSearchInfo, ServerZoneIpcType > searchInfoPacket( targetPlayer->getId() );
searchInfoPacket.data().onlineStatusFlags = param1; searchInfoPacket.data().onlineStatusFlags = param1;
searchInfoPacket.data().selectRegion = targetPlayer->getSearchSelectRegion(); searchInfoPacket.data().selectRegion = targetPlayer->getSearchSelectRegion();
sprintf( searchInfoPacket.data().searchMessage, targetPlayer->getSearchMessage() ); 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 fromContainer = inPacket.getValAt< uint16_t >( 0x2C );
uint16_t toContainer = inPacket.getValAt< uint16_t >( 0x40 ); 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().sequence = seq;
ackPacket.data().type = 7; ackPacket.data().type = 7;
pPlayer->queuePacket( ackPacket ); pPlayer->queuePacket( ackPacket );

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
#ifndef _PLAYERSPAWN_H #ifndef _PLAYERSPAWN_H
#define _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/Network/GamePacketNew.h>
#include <src/servers/Server_Common/Util/UtilMath.h> #include <src/servers/Server_Common/Util/UtilMath.h>
#include "src/servers/Server_Zone/Actor/Player.h" #include "src/servers/Server_Zone/Actor/Player.h"
@ -18,11 +18,11 @@ namespace Server {
* @brief The packet sent to spawn a player. * @brief The packet sent to spawn a player.
*/ */
class PlayerSpawnPacket : class PlayerSpawnPacket :
public GamePacketNew<FFXIVIpcPlayerSpawn> public GamePacketNew< FFXIVIpcPlayerSpawn, ServerZoneIpcType >
{ {
public: public:
PlayerSpawnPacket( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget ) : PlayerSpawnPacket( Entity::PlayerPtr pPlayer, Entity::PlayerPtr pTarget ) :
GamePacketNew<FFXIVIpcPlayerSpawn>( pPlayer->getId(), pTarget->getId() ) GamePacketNew< FFXIVIpcPlayerSpawn, ServerZoneIpcType >( pPlayer->getId(), pTarget->getId() )
{ {
initialize( pPlayer, pTarget ); 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. * @brief Packet sent to set a players state, this impacts which actions he can perform.
*/ */
class PlayerStateFlagsPacket : class PlayerStateFlagsPacket :
public GamePacketNew< FFXIVIpcPlayerStateFlags > public GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >
{ {
public: public:
PlayerStateFlagsPacket( Entity::PlayerPtr pActor ) : PlayerStateFlagsPacket( Entity::PlayerPtr pActor ) :
GamePacketNew< FFXIVIpcPlayerStateFlags >( pActor->getId(), pActor->getId() ) GamePacketNew< FFXIVIpcPlayerStateFlags, ServerZoneIpcType >( pActor->getId(), pActor->getId() )
{ {
initialize( pActor->getStateFlags() ); initialize( pActor->getStateFlags() );
} }
PlayerStateFlagsPacket( Entity::PlayerPtr pActor, std::vector< Common::PlayerStateFlag > flags ) : 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]; uint8_t newFlags[7];
memset( newFlags, 0, 7 ); memset( newFlags, 0, 7 );

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
#include <src/servers/Server_Common/Exd/ExdData.h> #include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Util/Util.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/Logging/Logger.h>
#include <src/servers/Server_Common/Exd/ExdData.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/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 "src/servers/Server_Zone/Actor/Actor.h"
#include "StatusEffect.h" #include "StatusEffect.h"
@ -56,7 +56,7 @@ void Core::StatusEffect::StatusEffectContainer::addStatusEffect( StatusEffectPtr
pEffect->applyStatus(); pEffect->applyStatus();
m_effectMap[nextSlot] = pEffect; 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_id = m_pOwner->getId();
statusEffectAdd.data().actor_id1 = m_pOwner->getId(); statusEffectAdd.data().actor_id1 = m_pOwner->getId();
statusEffectAdd.data().current_hp = m_pOwner->getHp(); statusEffectAdd.data().current_hp = m_pOwner->getHp();
@ -99,7 +99,7 @@ void Core::StatusEffect::StatusEffectContainer::sendUpdate()
{ {
uint64_t currentTimeMs = Util::getTimeMs(); 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_hp = m_pOwner->getHp();
statusEffectList.data().current_mp = m_pOwner->getMp(); 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/Database/Database.h>
#include <src/servers/Server_Common/Exd/ExdData.h> #include <src/servers/Server_Common/Exd/ExdData.h>
#include <src/servers/Server_Common/Network/CommonNetwork.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 <src/servers/Server_Common/Network/PacketContainer.h>
#include "Zone.h" #include "Zone.h"
@ -523,7 +523,9 @@ bool Zone::runZoneLogic()
if( changedWeather ) 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().weatherId = m_currentWeather;
weatherChangePacket.data().delay = 5.0f; weatherChangePacket.data().delay = 5.0f;
pSession->getPlayer()->queuePacket( weatherChangePacket ); pSession->getPlayer()->queuePacket( weatherChangePacket );