mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
add tell and chat ipc structures
This commit is contained in:
parent
961621a903
commit
6da1af4fb5
3 changed files with 28 additions and 32 deletions
|
@ -9,8 +9,6 @@ namespace Network {
|
||||||
namespace Packets {
|
namespace Packets {
|
||||||
namespace Client {
|
namespace Client {
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
|
|
||||||
struct FFXIVIpcGmCommand1 : FFXIVIpcBasePacket< GMCommand1 >
|
struct FFXIVIpcGmCommand1 : FFXIVIpcBasePacket< GMCommand1 >
|
||||||
{
|
{
|
||||||
/* 0000 */ uint32_t commandId;
|
/* 0000 */ uint32_t commandId;
|
||||||
|
@ -31,17 +29,8 @@ struct FFXIVIpcClientTrigger : FFXIVIpcBasePacket< ClientTrigger >
|
||||||
{
|
{
|
||||||
/* 0000 */ uint16_t commandId;
|
/* 0000 */ uint16_t commandId;
|
||||||
/* 0002 */ uint8_t unk_2[2];
|
/* 0002 */ uint8_t unk_2[2];
|
||||||
|
/* 0004 */ uint32_t param11;
|
||||||
union
|
/* 0008 */ uint32_t param12;
|
||||||
{
|
|
||||||
/* 0004 */ uint64_t param1;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
/* 0004 */ uint32_t param11;
|
|
||||||
/* 0008 */ uint32_t param12;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 000C */ uint32_t param2;
|
/* 000C */ uint32_t param2;
|
||||||
/* 0010 */ char unk_10[8];
|
/* 0010 */ char unk_10[8];
|
||||||
/* 0018 */ uint64_t param3;
|
/* 0018 */ uint64_t param3;
|
||||||
|
@ -134,7 +123,21 @@ struct FFXIVIpcSetSearchInfo : FFXIVIpcBasePacket< SetSearchInfoHandler >
|
||||||
/* 0012 */ char searchComment[193];
|
/* 0012 */ char searchComment[193];
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack(pop)
|
struct FFXIVIpcTellHandler : FFXIVIpcBasePacket< TellReq >
|
||||||
|
{
|
||||||
|
/* 0000 */ char pad_0000[4];
|
||||||
|
/* 0004 */ char targetPCName[32];
|
||||||
|
/* 0024 */ char message[1012];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FFXIVIpcChatHandler : FFXIVIpcBasePacket< ChatHandler >
|
||||||
|
{
|
||||||
|
/* 0000 */ char pad_0000[4];
|
||||||
|
/* 0004 */ uint32_t sourceId;
|
||||||
|
/* 0008 */ char pad_0008[16];
|
||||||
|
/* 0018 */ Common::ChatType chatType;
|
||||||
|
/* 001A */ char message[1012];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
|
||||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcClientTrigger >( inPacket );
|
const auto packet = ZoneChannelPacket< Client::FFXIVIpcClientTrigger >( inPacket );
|
||||||
|
|
||||||
const auto& commandId = packet.data().commandId;
|
const auto& commandId = packet.data().commandId;
|
||||||
const auto& param1 = packet.data().param1;
|
const auto& param1 = *reinterpret_cast< const uint64_t* >( &packet.data().param11 );
|
||||||
const auto& param11 = packet.data().param11;
|
const auto& param11 = packet.data().param11;
|
||||||
const auto& param12 = packet.data().param12;
|
const auto& param12 = packet.data().param12;
|
||||||
const auto& param2 = packet.data().param2;
|
const auto& param2 = packet.data().param2;
|
||||||
|
|
|
@ -63,7 +63,7 @@ void Core::Network::GameConnection::fcInfoReqHandler( const Core::Network::Packe
|
||||||
void Core::Network::GameConnection::setSearchInfoHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
void Core::Network::GameConnection::setSearchInfoHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||||
Entity::Player& player )
|
Entity::Player& player )
|
||||||
{
|
{
|
||||||
const auto packet = ZoneChannelPacket< Client::FFXIVIpcSetSearchInfo >( inPacket, true );
|
const auto packet = ZoneChannelPacket< Client::FFXIVIpcSetSearchInfo >( inPacket );
|
||||||
|
|
||||||
const auto& inval = packet.data().status1;
|
const auto& inval = packet.data().status1;
|
||||||
const auto& inval1 = packet.data().status2;
|
const auto& inval1 = packet.data().status2;
|
||||||
|
@ -459,23 +459,19 @@ void Core::Network::GameConnection::chatHandler( const Core::Network::Packets::F
|
||||||
{
|
{
|
||||||
auto pDebugCom = g_fw.get< DebugCommandHandler >();
|
auto pDebugCom = g_fw.get< DebugCommandHandler >();
|
||||||
|
|
||||||
Packets::FFXIVARR_PACKET_RAW copy = inPacket;
|
const auto packet = ZoneChannelPacket< Client::FFXIVIpcChatHandler >( inPacket );
|
||||||
|
|
||||||
std::string chatString( reinterpret_cast< char* >( ©.data[0x2a] ) );
|
if( packet.data().message[0] == '!' )
|
||||||
|
|
||||||
auto sourceId = *reinterpret_cast< uint32_t* >( ©.data[0x14] );
|
|
||||||
|
|
||||||
if( chatString.at( 0 ) == '!' )
|
|
||||||
{
|
{
|
||||||
// execute game console command
|
// execute game console command
|
||||||
pDebugCom->execCommand( const_cast< char * >( chatString.c_str() ) + 1, player );
|
pDebugCom->execCommand( const_cast< char* >( packet.data().message ) + 1, player );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatType chatType = static_cast< ChatType >( inPacket.data[0x28] );
|
auto chatType = packet.data().chatType;
|
||||||
|
|
||||||
//ToDo, need to implement sending GM chat types.
|
//ToDo, need to implement sending GM chat types.
|
||||||
auto chatPacket = boost::make_shared< ChatPacket >( player, chatType, chatString );
|
auto chatPacket = boost::make_shared< Server::ChatPacket >( player, chatType, packet.data().message );
|
||||||
|
|
||||||
switch( chatType )
|
switch( chatType )
|
||||||
{
|
{
|
||||||
|
@ -531,19 +527,16 @@ void Core::Network::GameConnection::logoutHandler( const Core::Network::Packets:
|
||||||
void Core::Network::GameConnection::tellHandler( const Core::Network::Packets::FFXIVARR_PACKET_RAW& inPacket,
|
void Core::Network::GameConnection::tellHandler( const Core::Network::Packets::FFXIVARR_PACKET_RAW& inPacket,
|
||||||
Entity::Player& player )
|
Entity::Player& player )
|
||||||
{
|
{
|
||||||
Packets::FFXIVARR_PACKET_RAW copy = inPacket;
|
const auto packet = ZoneChannelPacket< Client::FFXIVIpcTellHandler >( inPacket );
|
||||||
|
|
||||||
std::string targetPcName( reinterpret_cast< char* >( ©.data[0x14] ) );
|
|
||||||
std::string msg( reinterpret_cast< char* >( ©.data[0x34] ) );
|
|
||||||
|
|
||||||
auto pZoneServer = g_fw.get< ServerZone >();
|
auto pZoneServer = g_fw.get< ServerZone >();
|
||||||
|
|
||||||
auto pSession = pZoneServer->getSession( targetPcName );
|
auto pSession = pZoneServer->getSession( packet.data().targetPCName );
|
||||||
|
|
||||||
if( !pSession )
|
if( !pSession )
|
||||||
{
|
{
|
||||||
auto tellErrPacket = makeZonePacket< FFXIVIpcTellErrNotFound >( player.getId() );
|
auto tellErrPacket = makeZonePacket< FFXIVIpcTellErrNotFound >( player.getId() );
|
||||||
strcpy( tellErrPacket->data().receipientName, targetPcName.c_str() );
|
strcpy( tellErrPacket->data().receipientName, packet.data().targetPCName );
|
||||||
sendSinglePacket( tellErrPacket );
|
sendSinglePacket( tellErrPacket );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -572,7 +565,7 @@ void Core::Network::GameConnection::tellHandler( const Core::Network::Packets::F
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tellPacket = makeChatPacket< FFXIVIpcTell >( player.getId() );
|
auto tellPacket = makeChatPacket< FFXIVIpcTell >( player.getId() );
|
||||||
strcpy( tellPacket->data().msg, msg.c_str() );
|
strcpy( tellPacket->data().msg, packet.data().message );
|
||||||
strcpy( tellPacket->data().receipientName, player.getName().c_str() );
|
strcpy( tellPacket->data().receipientName, player.getName().c_str() );
|
||||||
// TODO: do these have a meaning?
|
// TODO: do these have a meaning?
|
||||||
//tellPacket.data().u1 = 0x92CD7337;
|
//tellPacket.data().u1 = 0x92CD7337;
|
||||||
|
|
Loading…
Add table
Reference in a new issue