mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
moved examine packet to its own class
- fixed accessory display in examine packet - fixed accessory display in playerspawn packet
This commit is contained in:
parent
0796644a21
commit
5ca9b8f90b
3 changed files with 86 additions and 47 deletions
|
@ -13,6 +13,8 @@
|
||||||
#include "Zone/ZonePosition.h"
|
#include "Zone/ZonePosition.h"
|
||||||
|
|
||||||
#include "Network/GameConnection.h"
|
#include "Network/GameConnection.h"
|
||||||
|
|
||||||
|
#include "Network/PacketWrappers/ExaminePacket.h"
|
||||||
#include "Network/PacketWrappers/InitUIPacket.h"
|
#include "Network/PacketWrappers/InitUIPacket.h"
|
||||||
#include "Network/PacketWrappers/PingPacket.h"
|
#include "Network/PacketWrappers/PingPacket.h"
|
||||||
#include "Network/PacketWrappers/MoveActorPacket.h"
|
#include "Network/PacketWrappers/MoveActorPacket.h"
|
||||||
|
@ -27,7 +29,6 @@
|
||||||
#include "Action/Action.h"
|
#include "Action/Action.h"
|
||||||
#include "Action/ActionTeleport.h"
|
#include "Action/ActionTeleport.h"
|
||||||
|
|
||||||
#include "Inventory/Item.h"
|
|
||||||
|
|
||||||
#include "Session.h"
|
#include "Session.h"
|
||||||
#include "ServerZone.h"
|
#include "ServerZone.h"
|
||||||
|
@ -46,53 +47,15 @@ void examineHandler( Core::Entity::Player& player, uint32_t targetId )
|
||||||
{
|
{
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
auto packet = makeZonePacket< FFXIVIpcExamine >( targetId, player.getId() );
|
|
||||||
auto pSession = g_fw.get< Core::ServerZone >()->getSession( targetId );
|
auto pSession = g_fw.get< Core::ServerZone >()->getSession( targetId );
|
||||||
if( pSession )
|
if( pSession )
|
||||||
{
|
{
|
||||||
auto pPlayer = pSession->getPlayer();
|
auto pTarget = pSession->getPlayer();
|
||||||
if( pPlayer )
|
if( pTarget )
|
||||||
{
|
{
|
||||||
// todo: this packet needs mapping out
|
player.queuePacket( boost::make_shared< ExaminePacket >( player, pTarget ) );
|
||||||
strcpy( packet->data().name, pPlayer->getName().c_str() );
|
|
||||||
packet->data().classJob = static_cast< uint8_t >( pPlayer->getClass() );
|
|
||||||
packet->data().level = pPlayer->getLevel();
|
|
||||||
|
|
||||||
packet->data().unkFlag1 = 4;
|
|
||||||
packet->data().unkFlag2 = 1;
|
|
||||||
|
|
||||||
packet->data().titleId = pPlayer->getTitle();
|
|
||||||
packet->data().grandCompany = 1;
|
|
||||||
packet->data().grandCompanyRank = 10;
|
|
||||||
|
|
||||||
packet->data().mainWeaponModel = pPlayer->getModelMainWeapon();
|
|
||||||
packet->data().secWeaponModel = pPlayer->getModelSubWeapon();
|
|
||||||
|
|
||||||
memcpy( packet->data().look, pPlayer->getLookArray(), sizeof( packet->data().look ) );
|
|
||||||
packet->data().models[ 0 ] = pPlayer->getModelForSlot( Common::GearSetSlot::Head );
|
|
||||||
packet->data().models[ 1 ] = pPlayer->getModelForSlot( Common::GearSetSlot::Body );
|
|
||||||
packet->data().models[ 2 ] = pPlayer->getModelForSlot( Common::GearSetSlot::Hands );
|
|
||||||
packet->data().models[ 3 ] = pPlayer->getModelForSlot( Common::GearSetSlot::Legs );
|
|
||||||
packet->data().models[ 4 ] = pPlayer->getModelForSlot( Common::GearSetSlot::Feet );
|
|
||||||
|
|
||||||
// todo: main/sub/other stuff too
|
|
||||||
|
|
||||||
for( auto i = 0; i < Common::GearSetSlot::SoulCrystal + 1; ++i)
|
|
||||||
{
|
|
||||||
auto pItem = pPlayer->getItemAt( Common::InventoryType::GearSet0, i );
|
|
||||||
if( pItem )
|
|
||||||
{
|
|
||||||
auto slot = static_cast< Common::GearSetSlot >( i );
|
|
||||||
auto& entry = packet->data().entries[i];
|
|
||||||
entry.catalogId = pItem->getId();
|
|
||||||
entry.quality = pItem->isHq();
|
|
||||||
//entry.appearanceCatalogId = pItem->getGlamourId()
|
|
||||||
// todo: glamour/materia etc.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.queuePacket( packet );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
#ifndef _CORE_NETWORK_PACKETS_EXAMINEPACKET_H
|
||||||
|
#define _CORE_NETWORK_PACKETS_EXAMINEPACKET_H
|
||||||
|
|
||||||
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
|
#include <Network/GamePacketNew.h>
|
||||||
|
#include <Util/Util.h>
|
||||||
|
#include "Actor/Player.h"
|
||||||
|
#include "Forwards.h"
|
||||||
|
#include "Inventory/Item.h"
|
||||||
|
#include "StatusEffect/StatusEffect.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Core {
|
||||||
|
namespace Network {
|
||||||
|
namespace Packets {
|
||||||
|
namespace Server {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The Examine response packet.
|
||||||
|
*/
|
||||||
|
class ExaminePacket :
|
||||||
|
public ZoneChannelPacket< FFXIVIpcExamine >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ExaminePacket( Entity::Player& player, Entity::PlayerPtr pTarget ) :
|
||||||
|
ZoneChannelPacket< FFXIVIpcExamine >( pTarget->getId(), player.getId() )
|
||||||
|
{
|
||||||
|
initialize( player, pTarget );
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initialize( Entity::Player& player, Entity::PlayerPtr pTarget )
|
||||||
|
{
|
||||||
|
assert( pTarget );
|
||||||
|
{
|
||||||
|
// todo: this packet needs mapping out
|
||||||
|
strcpy( m_data.name, pTarget->getName().c_str() );
|
||||||
|
m_data.classJob = static_cast< uint8_t >( pTarget->getClass() );
|
||||||
|
m_data.level = pTarget->getLevel();
|
||||||
|
|
||||||
|
m_data.unkFlag1 = 4;
|
||||||
|
m_data.unkFlag2 = 1;
|
||||||
|
|
||||||
|
m_data.titleId = pTarget->getTitle();
|
||||||
|
m_data.grandCompany = pTarget->getGc();
|
||||||
|
m_data.grandCompanyRank = pTarget->getGcRankArray()[m_data.grandCompany];
|
||||||
|
|
||||||
|
m_data.mainWeaponModel = pTarget->getModelMainWeapon();
|
||||||
|
m_data.secWeaponModel = pTarget->getModelSubWeapon();
|
||||||
|
|
||||||
|
memcpy( m_data.look, pTarget->getLookArray(), sizeof( m_data.look ) );
|
||||||
|
for( auto i = 2; i < Common::GearSetSlot::SoulCrystal; ++i )
|
||||||
|
m_data.models[ i - 2 ] = pTarget->getModelForSlot( static_cast< Common::GearSetSlot >( i ) );
|
||||||
|
|
||||||
|
// todo: main/sub/other stuff too
|
||||||
|
|
||||||
|
for( auto i = 0; i < Common::GearSetSlot::SoulCrystal + 1; ++i )
|
||||||
|
{
|
||||||
|
auto pItem = pTarget->getItemAt( Common::InventoryType::GearSet0, i );
|
||||||
|
if( pItem )
|
||||||
|
{
|
||||||
|
auto& entry = m_data.entries[i];
|
||||||
|
entry.catalogId = pItem->getId();
|
||||||
|
entry.quality = pItem->isHq();
|
||||||
|
//entry.appearanceCatalogId = pItem->getGlamourId()
|
||||||
|
// todo: glamour/materia etc.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /*_CORE_NETWORK_PACKETS_EXAMINEPACKET_H*/
|
|
@ -53,11 +53,9 @@ private:
|
||||||
m_data.mainWeaponModel = item->getModelId1();
|
m_data.mainWeaponModel = item->getModelId1();
|
||||||
m_data.secWeaponModel = player.getModelSubWeapon();
|
m_data.secWeaponModel = player.getModelSubWeapon();
|
||||||
|
|
||||||
m_data.models[ 0 ] = player.getModelForSlot( Common::GearSetSlot::Head );
|
for( auto i = 2; i < Common::GearSetSlot::SoulCrystal; ++i )
|
||||||
m_data.models[ 1 ] = player.getModelForSlot( Common::GearSetSlot::Body );
|
m_data.models[ i - 2 ] = player.getModelForSlot( static_cast< Common::GearSetSlot >( i ) );
|
||||||
m_data.models[ 2 ] = player.getModelForSlot( Common::GearSetSlot::Hands );
|
|
||||||
m_data.models[ 3 ] = player.getModelForSlot( Common::GearSetSlot::Legs );
|
|
||||||
m_data.models[ 4 ] = player.getModelForSlot( Common::GearSetSlot::Feet );
|
|
||||||
strcpy( m_data.name, player.getName().c_str() );
|
strcpy( m_data.name, player.getName().c_str() );
|
||||||
|
|
||||||
m_data.pos.x = player.getPos().x;
|
m_data.pos.x = player.getPos().x;
|
||||||
|
|
Loading…
Add table
Reference in a new issue