1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 02:57:45 +00:00

more style

This commit is contained in:
goaaats 2017-12-04 23:21:15 +01:00
parent 1b09369505
commit c8c4baefb1
2 changed files with 53 additions and 53 deletions

View file

@ -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() );
}
}
}
@ -248,14 +248,14 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
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, &timestamp );
@ -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 );
@ -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 );
}
@ -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();
}

View file

@ -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;
}