1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Update GMCommand 1 and 2 Defs

This commit is contained in:
Biscuit 2018-10-14 12:52:06 +11:00
parent 3060c10264
commit 72fde12b0c
2 changed files with 28 additions and 12 deletions

View file

@ -15,16 +15,22 @@ struct FFXIVIpcGmCommand1 :
/* 0000 */ uint32_t commandId;
/* 0004 */ uint32_t param1;
/* 0008 */ uint32_t param2;
/* 000C */ uint8_t unknown_C[0xC];
/* 0018 */ uint32_t param3;
/* 000C */ uint32_t param3;
/* 0010 */ uint32_t param4;
/* 0014 */ uint32_t unknown1;
/* 0018 */ uint32_t target;
};
struct FFXIVIpcGmCommand2 :
FFXIVIpcBasePacket< GMCommand2 >
{
/* 0000 */ uint32_t commandId;
/* 0004 */ char unk_4[0x10];
/* 0014 */ char param1[0x20];
/* 0004 */ uint32_t param1;
/* 0008 */ uint32_t param2;
/* 000C */ uint32_t param3;
/* 0010 */ uint32_t param4;
/* 0014 */ char target[0x20];
/* 0034 */ uint32_t unknown1;
};
struct FFXIVIpcClientTrigger :

View file

@ -98,16 +98,19 @@ void Core::Network::GameConnection::gm1Handler( const Packets::FFXIVARR_PACKET_R
const auto& param1 = packet.data().param1;
const auto& param2 = packet.data().param2;
const auto& param3 = packet.data().param3;
const auto& param4 = packet.data().param4;
const auto& target = packet.data().target;
auto pLog = g_fw.get< Logger >();
pLog->debug( player.getName() + " used GM1 commandId: " + std::to_string( commandId ) +
", params: " + std::to_string( param1 ) + ", " +
std::to_string( param2 ) + ", " + std::to_string( param3 ) );
std::to_string( param2 ) + ", " + std::to_string( param3 ) + ", " + std::to_string( param4 ) +
", target: " + std::to_string( target ) );
Core::Entity::ActorPtr targetActor;
if( player.getId() == param3 )
if( player.getId() == target )
{
targetActor = player.getAsPlayer();
}
@ -116,7 +119,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::FFXIVARR_PACKET_R
auto inRange = player.getInRangeActors();
for( auto& actor : inRange )
{
if( actor->getId() == param3 )
if( actor->getId() == target )
targetActor = actor;
}
}
@ -506,11 +509,18 @@ void Core::Network::GameConnection::gm2Handler( const Packets::FFXIVARR_PACKET_R
const auto packet = ZoneChannelPacket< Client::FFXIVIpcGmCommand2 >( inPacket );
const auto& commandId = packet.data().commandId;
const auto& param1 = std::string( packet.data().param1 );
const auto& param1 = packet.data().param1;
const auto& param2 = packet.data().param2;
const auto& param3 = packet.data().param3;
const auto& param4 = packet.data().param4;
const auto& target = std::string( packet.data().target );
pLog->debug( player.getName() + " used GM2 commandId: " + std::to_string( commandId ) + ", params: " + param1 );
pLog->debug( player.getName() + " used GM2 commandId: " + std::to_string( commandId ) +
", params: " + std::to_string( param1 ) + ", " +
std::to_string( param2 ) + ", " + std::to_string( param3 ) + ", " + std::to_string( param4 ) +
", target: " + target );
auto targetSession = pServerZone->getSession( param1 );
auto targetSession = pServerZone->getSession( target );
Core::Entity::CharaPtr targetActor;
if( targetSession != nullptr )
@ -519,13 +529,13 @@ void Core::Network::GameConnection::gm2Handler( const Packets::FFXIVARR_PACKET_R
}
else
{
if( param1 == "self" )
if( target == "self" )
{
targetActor = player.getAsPlayer();
}
else
{
player.sendUrgent( "Player " + param1 + " not found on this server." );
player.sendUrgent( "Player " + target + " not found on this server." );
return;
}
}