mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-23 13:17:45 +00:00
Merge pull request #333 from NotAdam/develop
packet injection & unlock action debug command
This commit is contained in:
commit
f13c0d84be
5 changed files with 20 additions and 4 deletions
|
@ -246,6 +246,15 @@ public:
|
|||
m_segHdr.size = size;
|
||||
};
|
||||
|
||||
FFXIVRawPacket( char* data, uint16_t size ) :
|
||||
m_data( std::vector< uint8_t >( size ) )
|
||||
{
|
||||
auto segmentHdrSize = sizeof( FFXIVARR_PACKET_SEGMENT_HEADER );
|
||||
|
||||
memcpy( &m_data[0], data + segmentHdrSize, size - segmentHdrSize );
|
||||
memcpy( &m_segHdr, data, segmentHdrSize );
|
||||
}
|
||||
|
||||
uint32_t getContentSize() override
|
||||
{
|
||||
return m_data.size();
|
||||
|
|
|
@ -562,7 +562,7 @@ void Core::Entity::Player::changePosition( float x, float y, float z, float o )
|
|||
m_queuedZoneing = boost::make_shared<QueuedZoning>( getZoneId(), pos, Util::getTimeMs(), o );
|
||||
}
|
||||
|
||||
void Core::Entity::Player::learnAction( uint8_t actionId )
|
||||
void Core::Entity::Player::learnAction( uint16_t actionId )
|
||||
{
|
||||
uint16_t index;
|
||||
uint8_t value;
|
||||
|
|
|
@ -419,7 +419,7 @@ public:
|
|||
/*! update bitmask for how-to's seen */
|
||||
void updateHowtosSeen( uint32_t howToId );
|
||||
/*! learn an action / update the unlock bitmask. */
|
||||
void learnAction( uint8_t actionId );
|
||||
void learnAction( uint16_t actionId );
|
||||
/*! learn a song / update the unlock bitmask. */
|
||||
void learnSong( uint8_t songId, uint32_t itemId );
|
||||
/*! check if an action is already unlocked in the bitmask. */
|
||||
|
|
|
@ -423,6 +423,13 @@ void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost:
|
|||
player.queuePacket( controlPacket );*/
|
||||
|
||||
}
|
||||
else if( subCommand == "unlock" )
|
||||
{
|
||||
uint32_t id;
|
||||
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
player.learnAction( id );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendUrgent( subCommand + " is not a valid ADD command." );
|
||||
|
|
|
@ -362,8 +362,8 @@ void Core::Network::GameConnection::injectPacket( const std::string& packetpath,
|
|||
if( pSize == 0 )
|
||||
return;
|
||||
|
||||
// TODO: fix injection for new packets
|
||||
//queueOutPacket( GamePacketPtr( new GamePacket( packet + k, pSize, false ) ) );
|
||||
queueOutPacket( FFXIVPacketBasePtr( new FFXIVRawPacket( packet + k, pSize ) ) );
|
||||
|
||||
k += ( pSize );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue