mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
add linkshell event, some cleanup
This commit is contained in:
parent
6da1af4fb5
commit
d1fe43fde3
5 changed files with 17 additions and 26 deletions
|
@ -14,12 +14,6 @@
|
|||
#include "CommonNetwork.h"
|
||||
#include "PacketDef/Ipcs.h"
|
||||
|
||||
#include <Framework.h>
|
||||
#include <Logging/Logger.h>
|
||||
#include <Util/Util.h>
|
||||
|
||||
extern Core::Framework g_fw;
|
||||
|
||||
namespace Core {
|
||||
namespace Network {
|
||||
namespace Packets {
|
||||
|
@ -184,7 +178,7 @@ public:
|
|||
initialize();
|
||||
};
|
||||
|
||||
FFXIVIpcPacket< T, T1 >( const FFXIVARR_PACKET_RAW& rawPacket, bool verbose = false )
|
||||
FFXIVIpcPacket< T, T1 >( const FFXIVARR_PACKET_RAW& rawPacket )
|
||||
{
|
||||
auto ipcHdrSize = sizeof( FFXIVARR_IPC_HEADER );
|
||||
auto copySize = std::min< uint32_t >( sizeof( T ), rawPacket.segHdr.size - ipcHdrSize );
|
||||
|
@ -192,13 +186,6 @@ public:
|
|||
memcpy( &m_segHdr, &rawPacket.segHdr, sizeof( FFXIVARR_PACKET_SEGMENT_HEADER ) );
|
||||
memcpy( &m_data, &rawPacket.data[0] + ipcHdrSize, copySize );
|
||||
|
||||
auto log = g_fw.get< Core::Logger >();
|
||||
if( log && verbose )
|
||||
{
|
||||
log->debug( "rawpacket size " + std::to_string( rawPacket.segHdr.size ) + "\n" + Util::binaryToHexDump( const_cast< uint8_t* >( &rawPacket.data[0] ), rawPacket.segHdr.size ) );
|
||||
log->debug( "T size " + std::to_string( sizeof( T ) ) + "\n" + Util::binaryToHexDump( reinterpret_cast< uint8_t* >( &m_data ), sizeof( T ) ) );
|
||||
}
|
||||
|
||||
memset( &m_ipcHdr, 0, ipcHdrSize );
|
||||
m_ipcHdr.type = static_cast< ServerZoneIpcType >( m_data._ServerIpcType );
|
||||
}
|
||||
|
|
|
@ -139,6 +139,14 @@ struct FFXIVIpcChatHandler : FFXIVIpcBasePacket< ChatHandler >
|
|||
/* 001A */ char message[1012];
|
||||
};
|
||||
|
||||
struct FFXIVIpcLinkshellEventHandler : FFXIVIpcBasePacket< LinkshellEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint16_t scene;
|
||||
/* 0006 */ char pad_0006[1];
|
||||
/* 0007 */ char lsName[21];
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,15 +243,11 @@ void Core::Network::GameConnection::eventHandlerReturn( const Packets::FFXIVARR_
|
|||
void Core::Network::GameConnection::eventHandlerLinkshell( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||
Entity::Player& player )
|
||||
{
|
||||
Packets::FFXIVARR_PACKET_RAW copy = inPacket;
|
||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcLinkshellEventHandler >( inPacket );
|
||||
|
||||
auto eventId = *reinterpret_cast< uint32_t* >( ©.data[0x10] );
|
||||
auto scene = *reinterpret_cast< uint16_t* >( ©.data[0x14] );
|
||||
auto lsName = std::string( reinterpret_cast< char* >( ©.data[0x17] ) );
|
||||
|
||||
auto linkshellEvent = makeZonePacket< FFXIVIpcEventLinkshell >( player.getId() );
|
||||
linkshellEvent->data().eventId = eventId;
|
||||
linkshellEvent->data().scene = static_cast< uint8_t >( scene );
|
||||
auto linkshellEvent = makeZonePacket< Server::FFXIVIpcEventLinkshell >( player.getId() );
|
||||
linkshellEvent->data().eventId = packet.data().eventId;
|
||||
linkshellEvent->data().scene = static_cast< uint8_t >( packet.data().scene );
|
||||
linkshellEvent->data().param3 = 1;
|
||||
linkshellEvent->data().unknown1 = 0x15a;
|
||||
player.queuePacket( linkshellEvent );
|
||||
|
|
|
@ -42,12 +42,12 @@ void Core::Network::GameConnection::inventoryModifyHandler( const Packets::FFXIV
|
|||
Entity::Player& player )
|
||||
{
|
||||
Packets::FFXIVARR_PACKET_RAW copy = inPacket;
|
||||
auto seq = *reinterpret_cast< uint32_t* >( ©.data[0x1] );
|
||||
auto action = *reinterpret_cast< uint8_t* >( ©.data[0x4] );
|
||||
auto seq = *reinterpret_cast< uint32_t* >( ©.data[0x1] ); //
|
||||
auto action = *reinterpret_cast< uint8_t* >( ©.data[0x4] ); //
|
||||
auto fromSlot = *reinterpret_cast< uint8_t* >( ©.data[0x10] );
|
||||
auto toSlot = *reinterpret_cast< uint8_t* >( ©.data[0x24] );
|
||||
|
||||
auto fromContainer = *reinterpret_cast< uint16_t* >( ©.data[0xC] );
|
||||
auto fromContainer = *reinterpret_cast< uint16_t* >( ©.data[0xC] ); //
|
||||
auto toContainer = *reinterpret_cast< uint16_t* >( ©.data[0x20] );
|
||||
|
||||
// todo: check packet handler in game and see if this is sent as a u16 or u32
|
||||
|
|
|
@ -76,7 +76,7 @@ bool Core::Scripting::ScriptMgr::init()
|
|||
scriptsLoaded++;
|
||||
}
|
||||
|
||||
pLog->info( "ScriptMgr: Loaded " + std::to_string( scriptsLoaded ) + "/" + std::to_string( scriptsFound ) + " scripts successfully" );
|
||||
pLog->info( "ScriptMgr: Loaded " + std::to_string( scriptsLoaded ) + "/" + std::to_string( scriptsFound ) + " modules" );
|
||||
|
||||
watchDirectories();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue