mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 02:57:45 +00:00
more style
This commit is contained in:
parent
1b09369505
commit
c8c4baefb1
2 changed files with 53 additions and 53 deletions
|
@ -64,7 +64,7 @@ Core::DebugCommandHandler::~DebugCommandHandler()
|
|||
|
||||
// add a command set to the register map
|
||||
void Core::DebugCommandHandler::registerCommand( const std::string& n, Core::DebugCommand::pFunc functionPtr,
|
||||
const std::string& hText, uint8_t uLevel )
|
||||
const std::string& hText, uint8_t uLevel )
|
||||
{
|
||||
m_commandMap[std::string( n )] = boost::make_shared<DebugCommand>( n, functionPtr, hText, uLevel );
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ void Core::DebugCommandHandler::execCommand( char * data, Core::Entity::PlayerPt
|
|||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Core::DebugCommandHandler::scriptReload( char * data, Core::Entity::PlayerPtr pPlayer,
|
||||
boost::shared_ptr<Core::DebugCommand> command )
|
||||
boost::shared_ptr<Core::DebugCommand> command )
|
||||
{
|
||||
g_scriptMgr.reload();
|
||||
pPlayer->sendDebug( "Scripts reloaded." );
|
||||
|
@ -127,11 +127,11 @@ void Core::DebugCommandHandler::scriptReload( char * data, Core::Entity::PlayerP
|
|||
void Core::DebugCommandHandler::help( char* data, Entity::PlayerPtr pPlayer, boost::shared_ptr< Core::DebugCommand > command )
|
||||
{
|
||||
pPlayer->sendDebug( "Registered debug commands:" );
|
||||
for ( auto cmd : m_commandMap )
|
||||
for( auto cmd : m_commandMap )
|
||||
{
|
||||
if ( pPlayer->getGmRank( ) >= cmd.second->m_gmLevel )
|
||||
if( pPlayer->getGmRank() >= cmd.second->m_gmLevel )
|
||||
{
|
||||
pPlayer->sendDebug( " - " + cmd.first + " - " + cmd.second->getHelpText( ) );
|
||||
pPlayer->sendDebug( " - " + cmd.first + " - " + cmd.second->getHelpText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
params = std::string( data + command->getName().length() + 1 + pos + 1 );
|
||||
|
||||
g_log.debug( "[" + std::to_string( pPlayer->getId() ) + "] " +
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
|
||||
|
||||
if( ( ( subCommand == "pos" ) || ( subCommand == "posr" ) ) && ( params != "" ) )
|
||||
|
@ -176,12 +176,12 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
|
||||
if( subCommand == "pos" )
|
||||
pPlayer->setPosition( static_cast< float >( posX ),
|
||||
static_cast< float >( posY ),
|
||||
static_cast< float >( posZ ) );
|
||||
static_cast< float >( posY ),
|
||||
static_cast< float >( posZ ) );
|
||||
else
|
||||
pPlayer->setPosition( pPlayer->getPos().x + static_cast< float >( posX ),
|
||||
pPlayer->getPos().y + static_cast< float >( posY ),
|
||||
pPlayer->getPos().z + static_cast< float >( posZ ) );
|
||||
pPlayer->getPos().y + static_cast< float >( posY ),
|
||||
pPlayer->getPos().z + static_cast< float >( posZ ) );
|
||||
|
||||
Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcActorSetPos >
|
||||
setActorPosPacket( pPlayer->getId() );
|
||||
|
@ -236,26 +236,26 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
}
|
||||
else if( subCommand == "classjob" )
|
||||
{
|
||||
int32_t id;
|
||||
int32_t id;
|
||||
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
|
||||
if( pPlayer->getLevelForClass( static_cast<Core::Common::ClassJob> ( id ) ) == 0 )
|
||||
{
|
||||
pPlayer->setLevelForClass( 1, static_cast<Core::Common::ClassJob> ( id ) );
|
||||
pPlayer->setClassJob( static_cast<Core::Common::ClassJob> ( id ) );
|
||||
}
|
||||
else
|
||||
pPlayer->setClassJob( static_cast<Core::Common::ClassJob> ( id ) );
|
||||
if( pPlayer->getLevelForClass( static_cast<Core::Common::ClassJob> ( id ) ) == 0 )
|
||||
{
|
||||
pPlayer->setLevelForClass( 1, static_cast<Core::Common::ClassJob> ( id ) );
|
||||
pPlayer->setClassJob( static_cast<Core::Common::ClassJob> ( id ) );
|
||||
}
|
||||
else
|
||||
pPlayer->setClassJob( static_cast<Core::Common::ClassJob> ( id ) );
|
||||
}
|
||||
else if ( subCommand == "cfpenalty" )
|
||||
else if( subCommand == "cfpenalty" )
|
||||
{
|
||||
int32_t minutes;
|
||||
sscanf( params.c_str(), "%d", &minutes );
|
||||
|
||||
pPlayer->setCFPenaltyMinutes( minutes );
|
||||
}
|
||||
else if ( subCommand == "eorzeatime" )
|
||||
else if( subCommand == "eorzeatime" )
|
||||
{
|
||||
uint64_t timestamp;
|
||||
sscanf( params.c_str(), "%" SCNu64, ×tamp );
|
||||
|
@ -263,7 +263,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
pPlayer->setEorzeaTimeOffset( timestamp );
|
||||
pPlayer->sendNotice( "Eorzea time offset: " + std::to_string( timestamp ) );
|
||||
}
|
||||
else if ( subCommand == "model" )
|
||||
else if( subCommand == "model" )
|
||||
{
|
||||
uint32_t slot;
|
||||
uint32_t val;
|
||||
|
@ -273,7 +273,7 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
pPlayer->sendModel();
|
||||
pPlayer->sendDebug( "Model updated" );
|
||||
}
|
||||
else if ( subCommand == "mount" )
|
||||
else if( subCommand == "mount" )
|
||||
{
|
||||
int32_t id;
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
|
@ -312,7 +312,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
params = std::string( data + command->getName().length() + 1 + pos + 1 );
|
||||
|
||||
g_log.debug( "[" + std::to_string( pPlayer->getId() ) + "] " +
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
|
||||
|
||||
if( subCommand == "status" )
|
||||
|
@ -328,7 +328,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
|
||||
pPlayer->addStatusEffect( effect );
|
||||
}
|
||||
else if ( subCommand == "title" )
|
||||
else if( subCommand == "title" )
|
||||
{
|
||||
uint32_t titleId;
|
||||
sscanf( params.c_str(), "%u", &titleId );
|
||||
|
@ -397,14 +397,14 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
pPlayer->queuePacket(controlPacket);*/
|
||||
|
||||
}
|
||||
else if ( subCommand == "unlock" )
|
||||
else if( subCommand == "unlock" )
|
||||
{
|
||||
int32_t id;
|
||||
sscanf( params.c_str(), "%d", &id );
|
||||
|
||||
pPlayer->learnAction( id );
|
||||
}
|
||||
else if ( subCommand == "enablecompanion" )
|
||||
else if( subCommand == "enablecompanion" )
|
||||
{
|
||||
pPlayer->learnAction( 17 );
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ void Core::DebugCommandHandler::get( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
params = std::string( data + command->getName().length() + 1 + pos + 1 );
|
||||
|
||||
g_log.debug( "[" + std::to_string( pPlayer->getId() ) + "] " +
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
"subCommand " + subCommand + " params: " + params );
|
||||
|
||||
|
||||
if( subCommand == "pos" )
|
||||
|
@ -446,12 +446,12 @@ void Core::DebugCommandHandler::get( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
int16_t map_id = g_exdData.m_zoneInfoMap[pPlayer->getCurrentZone()->getId()].map_id;
|
||||
|
||||
pPlayer->sendNotice( "Pos:\n" +
|
||||
std::to_string( pPlayer->getPos().x ) + "\n" +
|
||||
std::to_string( pPlayer->getPos().y ) + "\n" +
|
||||
std::to_string( pPlayer->getPos().z ) + "\n" +
|
||||
std::to_string( pPlayer->getRotation() ) + "\nMapId: " +
|
||||
std::to_string( map_id ) + "\nZoneID: " +
|
||||
std::to_string( pPlayer->getCurrentZone()->getId() ) + "\n" );
|
||||
std::to_string( pPlayer->getPos().x ) + "\n" +
|
||||
std::to_string( pPlayer->getPos().y ) + "\n" +
|
||||
std::to_string( pPlayer->getPos().z ) + "\n" +
|
||||
std::to_string( pPlayer->getRotation() ) + "\nMapId: " +
|
||||
std::to_string( map_id ) + "\nZoneID: " +
|
||||
std::to_string( pPlayer->getCurrentZone()->getId() ) + "\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -531,5 +531,5 @@ void Core::DebugCommandHandler::serverInfo( char * data, Core::Entity::PlayerPtr
|
|||
|
||||
void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::PlayerPtr pPlayer, boost::shared_ptr< Core::DebugCommand > command )
|
||||
{
|
||||
pPlayer->unlock( );
|
||||
pPlayer->unlock();
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
pPlayer->sendNotice( "Race for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||
targetPlayer->spawn( targetPlayer );
|
||||
auto inRange = targetPlayer->getInRangeActors();
|
||||
for ( auto actor : inRange )
|
||||
for( auto actor : inRange )
|
||||
{
|
||||
targetPlayer->despawn( actor->getAsPlayer() );
|
||||
targetPlayer->spawn( actor->getAsPlayer() );
|
||||
|
@ -154,7 +154,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
pPlayer->sendNotice( "Tribe for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||
targetPlayer->spawn( targetPlayer );
|
||||
auto inRange = targetPlayer->getInRangeActors();
|
||||
for ( auto actor : inRange )
|
||||
for( auto actor : inRange )
|
||||
{
|
||||
targetPlayer->despawn( actor->getAsPlayer() );
|
||||
targetPlayer->spawn( actor->getAsPlayer() );
|
||||
|
@ -167,7 +167,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
pPlayer->sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||
targetPlayer->spawn( targetPlayer );
|
||||
auto inRange = targetActor->getInRangeActors();
|
||||
for ( auto actor : inRange )
|
||||
for( auto actor : inRange )
|
||||
{
|
||||
targetPlayer->despawn( actor->getAsPlayer() );
|
||||
targetPlayer->spawn( actor->getAsPlayer() );
|
||||
|
@ -189,7 +189,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
}
|
||||
case GmCommand::Call:
|
||||
{
|
||||
if ( targetPlayer->getZoneId() != pPlayer->getZoneId() )
|
||||
if( targetPlayer->getZoneId() != pPlayer->getZoneId() )
|
||||
targetPlayer->setZone( pPlayer->getZoneId() );
|
||||
|
||||
targetPlayer->changePosition( pPlayer->getPos().x, pPlayer->getPos().y, pPlayer->getPos().z,
|
||||
|
@ -268,7 +268,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
}
|
||||
case GmCommand::Inv:
|
||||
{
|
||||
if ( targetActor->getInvincibilityType() == Common::InvincibilityType::InvincibilityRefill )
|
||||
if( targetActor->getInvincibilityType() == Common::InvincibilityType::InvincibilityRefill )
|
||||
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityNone );
|
||||
else
|
||||
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityRefill );
|
||||
|
@ -279,11 +279,11 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
}
|
||||
case GmCommand::Orchestrion:
|
||||
{
|
||||
if ( param1 == 1 )
|
||||
if( param1 == 1 )
|
||||
{
|
||||
if ( param2 == 0 )
|
||||
if( param2 == 0 )
|
||||
{
|
||||
for ( uint8_t i = 0; i < 255; i++ )
|
||||
for( uint8_t i = 0; i < 255; i++ )
|
||||
targetActor->getAsPlayer()->learnSong( i, 0 );
|
||||
|
||||
pPlayer->sendNotice( "All Songs for " + targetPlayer->getName() +
|
||||
|
@ -301,9 +301,9 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
}
|
||||
case GmCommand::Mount:
|
||||
{
|
||||
if ( param2 == 0 )
|
||||
if( param2 == 0 )
|
||||
{
|
||||
for (uint8_t i = 0; i < 255; i++)
|
||||
for( uint8_t i = 0; i < 255; i++ )
|
||||
targetActor->getAsPlayer()->learnMount( i );
|
||||
|
||||
pPlayer->sendNotice( "All mounts for " + targetPlayer->getName() +
|
||||
|
@ -325,7 +325,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
param2 = 1;
|
||||
}
|
||||
|
||||
if( ( param1 == 0xcccccccc ) )
|
||||
if( param1 == 0xcccccccc )
|
||||
{
|
||||
pPlayer->sendUrgent( "Syntaxerror." );
|
||||
return;
|
||||
|
@ -345,7 +345,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
{
|
||||
uint32_t gil = targetPlayer->getCurrency( 1 );
|
||||
|
||||
if ( gil < param1 )
|
||||
if( gil < param1 )
|
||||
{
|
||||
pPlayer->sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" );
|
||||
}
|
||||
|
@ -400,11 +400,11 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
}
|
||||
case GmCommand::Aetheryte:
|
||||
{
|
||||
if ( param1 == 0 )
|
||||
if( param1 == 0 )
|
||||
{
|
||||
if ( param2 == 0 )
|
||||
if( param2 == 0 )
|
||||
{
|
||||
for ( uint8_t i = 0; i < 255; i++ )
|
||||
for( uint8_t i = 0; i < 255; i++ )
|
||||
targetActor->getAsPlayer()->registerAetheryte( i );
|
||||
|
||||
pPlayer->sendNotice( "All Aetherytes for " + targetPlayer->getName() +
|
||||
|
@ -423,7 +423,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
case GmCommand::Teri:
|
||||
{
|
||||
auto zoneInfo = g_zoneMgr.getZone( param1 );
|
||||
if ( !zoneInfo )
|
||||
if( !zoneInfo )
|
||||
{
|
||||
pPlayer->sendUrgent( "Invalid zone " + std::to_string( param1 ) );
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
{
|
||||
targetPlayer->setPosition( targetPlayer->getPos() );
|
||||
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
||||
pPlayer->sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName( ) + ")" );
|
||||
pPlayer->sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName() + ")" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
pPlayer->sendNotice( "Jumping to " + targetPlayer->getName() + " in range." );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
pPlayer->sendUrgent( "GM1 Command not implemented: " + std::to_string( commandId ) );
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue