mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Prelim housing eventhandler
This commit is contained in:
parent
e71128ba12
commit
7763f11478
6 changed files with 45 additions and 3 deletions
|
@ -291,11 +291,13 @@ namespace Core::Network::Packets
|
|||
OutOfRangeEventHandler = 0x014E, // updated 4.4
|
||||
EnterTeriEventHandler = 0x014F, // updated 4.4
|
||||
|
||||
ShopEventHandler = 0x0151, // updated 4.4
|
||||
|
||||
ReturnEventHandler = 0x0154, // updated 4.4
|
||||
TradeReturnEventHandler = 0x0155, // updated 4.4
|
||||
|
||||
LinkshellEventHandler = 0x0150, // updated 4.1 ??
|
||||
LinkshellEventHandler1 = 0x0151, // updated 4.1 ??
|
||||
LinkshellEventHandler = 0x1150, // updated 4.1 ??
|
||||
LinkshellEventHandler1 = 0x1151, // updated 4.1 ??
|
||||
|
||||
LandRenameHandler = 0x0171, // updated 4.4
|
||||
|
||||
|
|
|
@ -163,6 +163,13 @@ struct FFXIVIpcChatHandler :
|
|||
/* 001A */ char message[1012];
|
||||
};
|
||||
|
||||
struct FFXIVIpcShopEventHandler :
|
||||
FFXIVIpcBasePacket< ShopEventHandler >
|
||||
{
|
||||
/* 0000 */ uint32_t eventId;
|
||||
/* 0004 */ uint32_t param;
|
||||
};
|
||||
|
||||
struct FFXIVIpcLinkshellEventHandler :
|
||||
FFXIVIpcBasePacket< LinkshellEventHandler >
|
||||
{
|
||||
|
|
|
@ -98,8 +98,12 @@ Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
|
|||
setZoneHandler( ClientZoneIpcType::TradeReturnEventHandler, "EventHandlerReturn",
|
||||
&GameConnection::eventHandlerReturn );
|
||||
|
||||
setZoneHandler( ClientZoneIpcType::ShopEventHandler, "ShopEventHandler",
|
||||
&GameConnection::eventHandlerShop );
|
||||
|
||||
setZoneHandler( ClientZoneIpcType::LinkshellEventHandler, "LinkshellEventHandler",
|
||||
&GameConnection::eventHandlerLinkshell );
|
||||
|
||||
setZoneHandler( ClientZoneIpcType::LinkshellEventHandler1, "LinkshellEventHandler1",
|
||||
&GameConnection::eventHandlerLinkshell );
|
||||
|
||||
|
|
|
@ -139,6 +139,8 @@ namespace Core::Network
|
|||
|
||||
DECLARE_HANDLER( eventHandlerReturn );
|
||||
|
||||
DECLARE_HANDLER( eventHandlerShop );
|
||||
|
||||
DECLARE_HANDLER( eventHandlerLinkshell );
|
||||
|
||||
DECLARE_HANDLER( logoutHandler );
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <Common.h>
|
||||
#include <Logging/Logger.h>
|
||||
#include <Exd/ExdDataGenerated.h>
|
||||
#include <Network/CommonNetwork.h>
|
||||
#include <Network/GamePacketNew.h>
|
||||
|
@ -251,4 +252,30 @@ void Core::Network::GameConnection::eventHandlerLinkshell( const Packets::FFXIVA
|
|||
|
||||
}
|
||||
|
||||
void Core::Network::GameConnection::eventHandlerShop( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||
Entity::Player& player )
|
||||
{
|
||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcShopEventHandler >( inPacket );
|
||||
|
||||
auto pLog = g_fw.get< Logger >();
|
||||
auto pScriptMgr = g_fw.get< Scripting::ScriptMgr >();
|
||||
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
||||
|
||||
const auto eventId = packet.data().eventId;
|
||||
|
||||
auto eventType = static_cast< uint16_t >( eventId >> 16 );
|
||||
|
||||
std::string eventName = "onShop";
|
||||
std::string objName = Event::getEventName( eventId );
|
||||
|
||||
player.sendDebug( "EventId: " +
|
||||
std::to_string( eventId ) +
|
||||
" (0x" + Util::intToHexString( static_cast< uint64_t >( eventId & 0xFFFFFFF ), 8 ) + ")" );
|
||||
|
||||
|
||||
player.sendDebug( "Calling: " + objName + "." + eventName );
|
||||
player.eventStart( 0, eventId, Event::EventHandler::UI, 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue