1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

Merge remote-tracking branch 'SapphireServer/develop' into develop

This commit is contained in:
JeidoUran 2019-01-06 02:20:17 +01:00
commit e90bfc8dd2
5 changed files with 102 additions and 95 deletions

View file

@ -760,8 +760,18 @@ namespace Sapphire::Entity
uint8_t getSearchSelectClass() const; uint8_t getSearchSelectClass() const;
void sendNotice( const std::string& message ); void sendNotice( const std::string& message );
template< typename... Args >
void sendNotice( const std::string& message, const Args&... args )
{
sendNotice( fmt::format( message, args... ) );
}
void sendUrgent( const std::string& message ); void sendUrgent( const std::string& message );
template< typename... Args >
void sendUrgent( const std::string& message, const Args&... args )
{
sendUrgent( fmt::format( message, args... ) );
}
void sendDebug( const std::string& message ); void sendDebug( const std::string& message );

View file

@ -262,7 +262,7 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player&
sscanf( params.c_str(), "%" SCNu64, &timestamp ); sscanf( params.c_str(), "%" SCNu64, &timestamp );
player.setEorzeaTimeOffset( timestamp ); player.setEorzeaTimeOffset( timestamp );
player.sendNotice( "Eorzea time offset: " + std::to_string( timestamp ) ); player.sendNotice( "Eorzea time offset: {0}", timestamp );
} }
else if( subCommand == "mount" ) else if( subCommand == "mount" )
{ {
@ -369,7 +369,7 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player&
} }
else else
{ {
player.sendUrgent( subCommand + " is not a valid SET command." ); player.sendUrgent( "{0} is not a valid SET command.", subCommand );
} }
} }
@ -419,7 +419,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
sscanf( params.c_str(), "%u", &titleId ); sscanf( params.c_str(), "%u", &titleId );
player.addTitle( titleId ); player.addTitle( titleId );
player.sendNotice( "Added title (ID: " + std::to_string( titleId ) + ")" ); player.sendNotice( "Added title (id#{0})", titleId );
} }
else if( subCommand == "bnpc" ) else if( subCommand == "bnpc" )
{ {
@ -429,7 +429,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
if( !bNpcTemplate ) if( !bNpcTemplate )
{ {
player.sendNotice( "Template " + params + " not found in cache!" ); player.sendNotice( "Template {0} not found in cache!", params );
return; return;
} }
auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate, auto pBNpc = std::make_shared< Entity::BNpc >( bNpcTemplate,
@ -473,7 +473,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
sscanf( params.c_str(), "%x %x %x %x %x %x %x %x", &opcode, &param1, &param2, &param3, &param4, &param5, &param6, sscanf( params.c_str(), "%x %x %x %x %x %x %x %x", &opcode, &param1, &param2, &param3, &param4, &param5, &param6,
&playerId ); &playerId );
player.sendNotice( "Injecting ACTOR_CONTROL " + std::to_string( opcode ) ); player.sendNotice( "Injecting ACTOR_CONTROL {0}", opcode );
auto actorControl = makeZonePacket< FFXIVIpcActorControl143 >( playerId, player.getId() ); auto actorControl = makeZonePacket< FFXIVIpcActorControl143 >( playerId, player.getId() );
actorControl->data().category = opcode; actorControl->data().category = opcode;
@ -506,7 +506,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
} }
else else
{ {
player.sendUrgent( subCommand + " is not a valid ADD command." ); player.sendUrgent( "{0} is not a valid ADD command.", subCommand );
} }
@ -541,17 +541,13 @@ void Sapphire::World::Manager::DebugCommandMgr::get( char* data, Entity::Player&
int16_t map_id = pExdData->get< Sapphire::Data::TerritoryType >( player.getCurrentZone()->getTerritoryTypeId() )->map; int16_t map_id = pExdData->get< Sapphire::Data::TerritoryType >( player.getCurrentZone()->getTerritoryTypeId() )->map;
player.sendNotice( "Pos:\n" + player.sendNotice( "Pos:\n {0}\n {1}\n {2}\n {3}\n MapId: {4}\n ZoneId:{5}",
std::to_string( player.getPos().x ) + "\n" + player.getPos().x, player.getPos().y, player.getPos().z,
std::to_string( player.getPos().y ) + "\n" + player.getRot(), map_id, player.getCurrentZone()->getTerritoryTypeId() );
std::to_string( player.getPos().z ) + "\n" +
std::to_string( player.getRot() ) + "\nMapId: " +
std::to_string( map_id ) + "\nZoneID: " +
std::to_string( player.getCurrentZone()->getTerritoryTypeId() ) + "\n" );
} }
else else
{ {
player.sendUrgent( subCommand + " is not a valid GET command." ); player.sendUrgent( "{0} is not a valid GET command.", subCommand );
} }
} }
@ -621,7 +617,7 @@ void Sapphire::World::Manager::DebugCommandMgr::replay( char* data, Entity::Play
} }
else else
{ {
player.sendUrgent( subCommand + " is not a valid replay command." ); player.sendUrgent( "{0} is not a valid replay command.", subCommand );
} }
@ -648,12 +644,12 @@ void Sapphire::World::Manager::DebugCommandMgr::nudge( char* data, Entity::Playe
if( direction[ 0 ] == 'u' || direction[ 0 ] == '+' ) if( direction[ 0 ] == 'u' || direction[ 0 ] == '+' )
{ {
pos.y += offset; pos.y += offset;
player.sendNotice( "nudge: Placing up " + std::to_string( offset ) + " yalms" ); player.sendNotice( "nudge: Placing up {0} yalms", offset );
} }
else if( direction[ 0 ] == 'd' || direction[ 0 ] == '-' ) else if( direction[ 0 ] == 'd' || direction[ 0 ] == '-' )
{ {
pos.y -= offset; pos.y -= offset;
player.sendNotice( "nudge: Placing down " + std::to_string( offset ) + " yalms" ); player.sendNotice( "nudge: Placing down {0} yalms", offset );
} }
else else
@ -661,7 +657,7 @@ void Sapphire::World::Manager::DebugCommandMgr::nudge( char* data, Entity::Playe
float angle = player.getRot() + ( PI / 2 ); float angle = player.getRot() + ( PI / 2 );
pos.x -= offset * cos( angle ); pos.x -= offset * cos( angle );
pos.z += offset * sin( angle ); pos.z += offset * sin( angle );
player.sendNotice( "nudge: Placing forward " + std::to_string( offset ) + " yalms" ); player.sendNotice( "nudge: Placing forward {0} yalms", offset );
} }
if( offset != 0 ) if( offset != 0 )
{ {

View file

@ -65,7 +65,7 @@ void Sapphire::Network::GameConnection::eventHandlerTalk( FrameworkPtr pFw,
{ {
auto questInfo = pExdData->get< Sapphire::Data::Quest >( eventId ); auto questInfo = pExdData->get< Sapphire::Data::Quest >( eventId );
if( questInfo ) if( questInfo )
player.sendUrgent( "Quest not implemented: " + questInfo->name + " (" + questInfo->id + ")" ); player.sendUrgent( "Quest not implemented: {0} ({1})", questInfo->name, questInfo->id );
} }
player.checkEvent( eventId ); player.checkEvent( eventId );
@ -103,7 +103,7 @@ void Sapphire::Network::GameConnection::eventHandlerEmote( FrameworkPtr pFw,
{ {
auto questInfo = pExdData->get< Sapphire::Data::Quest >( eventId ); auto questInfo = pExdData->get< Sapphire::Data::Quest >( eventId );
if( questInfo ) if( questInfo )
player.sendUrgent( "Quest not implemented: " + questInfo->name ); player.sendUrgent( "Quest not implemented: {0}", questInfo->name );
} }
player.checkEvent( eventId ); player.checkEvent( eventId );

View file

@ -131,13 +131,13 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::Lv: case GmCommand::Lv:
{ {
targetPlayer->setLevel( param1 ); targetPlayer->setLevel( param1 );
player.sendNotice( "Level for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Level for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Race: case GmCommand::Race:
{ {
targetPlayer->setLookAt( CharaLook::Race, param1 ); targetPlayer->setLookAt( CharaLook::Race, param1 );
player.sendNotice( "Race for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Race for {0} was set to {1}", targetPlayer->getName(), param1 );
targetPlayer->spawn( targetPlayer ); targetPlayer->spawn( targetPlayer );
auto inRange = targetPlayer->getInRangeActors(); auto inRange = targetPlayer->getInRangeActors();
for( auto actor : inRange ) for( auto actor : inRange )
@ -150,7 +150,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::Tribe: case GmCommand::Tribe:
{ {
targetPlayer->setLookAt( CharaLook::Tribe, param1 ); targetPlayer->setLookAt( CharaLook::Tribe, param1 );
player.sendNotice( "Tribe for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Tribe for {0} was set to ", targetPlayer->getName(), param1 );
targetPlayer->spawn( targetPlayer ); targetPlayer->spawn( targetPlayer );
auto inRange = targetPlayer->getInRangeActors(); auto inRange = targetPlayer->getInRangeActors();
for( auto actor : inRange ) for( auto actor : inRange )
@ -163,7 +163,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::Sex: case GmCommand::Sex:
{ {
targetPlayer->setLookAt( CharaLook::Gender, param1 ); targetPlayer->setLookAt( CharaLook::Gender, param1 );
player.sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Sex for {0} was set to ", targetPlayer->getName(), param1 );
targetPlayer->spawn( targetPlayer ); targetPlayer->spawn( targetPlayer );
auto inRange = targetActor->getInRangeActors(); auto inRange = targetActor->getInRangeActors();
for( auto actor : inRange ) for( auto actor : inRange )
@ -176,14 +176,14 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::Time: case GmCommand::Time:
{ {
player.setEorzeaTimeOffset( param2 ); player.setEorzeaTimeOffset( param2 );
player.sendNotice( "Eorzea time offset: " + std::to_string( param2 ) ); player.sendNotice( "Eorzea time offset: {0}", param2 );
break; break;
} }
case GmCommand::Weather: case GmCommand::Weather:
{ {
targetPlayer->getCurrentZone()->setWeatherOverride( static_cast< Common::Weather >( param1 ) ); targetPlayer->getCurrentZone()->setWeatherOverride( static_cast< Common::Weather >( param1 ) );
player.sendNotice( "Weather in Zone \"" + targetPlayer->getCurrentZone()->getName() + "\" of " + player.sendNotice( "Weather in Zone \"{0}\" of {1} set in range.",
targetPlayer->getName() + " set in range." ); targetPlayer->getCurrentZone()->getName(), targetPlayer->getName() );
break; break;
} }
case GmCommand::Call: case GmCommand::Call:
@ -192,33 +192,41 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
targetPlayer->setZone( player.getZoneId() ); targetPlayer->setZone( player.getZoneId() );
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() ); targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() );
player.sendNotice( "Calling " + targetPlayer->getName() ); player.sendNotice( "Calling {0}", targetPlayer->getName() );
break; break;
} }
case GmCommand::Inspect: case GmCommand::Inspect:
{ {
player.sendNotice( "Name: " + targetPlayer->getName() + player.sendNotice( "Name: {0}"
"\nGil: " + std::to_string( targetPlayer->getCurrency( CurrencyType::Gil ) ) + "\nGil: {1}"
"\nZone: " + targetPlayer->getCurrentZone()->getName() + "\nZone: {2}"
"(" + std::to_string( targetPlayer->getZoneId() ) + ")" + "({3})"
"\nClass: " + std::to_string( static_cast< uint8_t >( targetPlayer->getClass() ) ) + "\nClass: {4}"
"\nLevel: " + std::to_string( targetPlayer->getLevel() ) + "\nLevel: {5}"
"\nExp: " + std::to_string( targetPlayer->getExp() ) + "\nExp: {6}"
"\nSearchMessage: " + targetPlayer->getSearchMessage() + "\nSearchMessage: {7}"
"\nPlayTime: " + std::to_string( targetPlayer->getPlayTime() ) ); "\nPlayTime: {8}",
targetPlayer->getName(),
targetPlayer->getCurrency( CurrencyType::Gil ),
targetPlayer->getCurrentZone()->getName(),
targetPlayer->getZoneId(),
static_cast< uint8_t >( targetPlayer->getClass() ),
targetPlayer->getLevel(),
targetPlayer->getExp(),
targetPlayer->getSearchMessage(),
targetPlayer->getPlayTime() );
break; break;
} }
case GmCommand::Speed: case GmCommand::Speed:
{ {
targetPlayer->queuePacket( makeActorControl143( player.getId(), Flee, param1 ) ); targetPlayer->queuePacket( makeActorControl143( player.getId(), Flee, param1 ) );
player.sendNotice( "Speed for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Speed for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Invis: case GmCommand::Invis:
{ {
player.setGmInvis( !player.getGmInvis() ); player.setGmInvis( !player.getGmInvis() );
player.sendNotice( "Invisibility flag for " + player.getName() + player.sendNotice( "Invisibility flag for {0} was toggled to {1}", player.getName(), !player.getGmInvis() );
" was toggled to " + std::to_string( !player.getGmInvis() ) );
for( auto actor : player.getInRangeActors() ) for( auto actor : player.getInRangeActors() )
{ {
@ -230,7 +238,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::Kill: case GmCommand::Kill:
{ {
targetActor->getAsChara()->takeDamage( 9999999 ); targetActor->getAsChara()->takeDamage( 9999999 );
player.sendNotice( "Killed " + std::to_string( targetActor->getId() ) ); player.sendNotice( "Killed {0}", targetActor->getId() );
break; break;
} }
case GmCommand::Icon: case GmCommand::Icon:
@ -250,31 +258,31 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
targetPlayer->sendToInRangeSet( makeActorControl142( player.getId(), SetStatusIcon, targetPlayer->sendToInRangeSet( makeActorControl142( player.getId(), SetStatusIcon,
static_cast< uint8_t >( player.getOnlineStatus() ) ), static_cast< uint8_t >( player.getOnlineStatus() ) ),
true ); true );
player.sendNotice( "Icon for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Icon for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Hp: case GmCommand::Hp:
{ {
targetPlayer->setHp( param1 ); targetPlayer->setHp( param1 );
player.sendNotice( "Hp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Hp for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Mp: case GmCommand::Mp:
{ {
targetPlayer->setMp( param1 ); targetPlayer->setMp( param1 );
player.sendNotice( "Mp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Mp for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Gp: case GmCommand::Gp:
{ {
targetPlayer->setHp( param1 ); targetPlayer->setHp( param1 );
player.sendNotice( "Gp for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) ); player.sendNotice( "Gp for {0} was set to {1}", targetPlayer->getName(), param1 );
break; break;
} }
case GmCommand::Exp: case GmCommand::Exp:
{ {
targetPlayer->gainExp( param1 ); targetPlayer->gainExp( param1 );
player.sendNotice( std::to_string( param1 ) + " Exp was added to " + targetPlayer->getName() ); player.sendNotice( "{0} Exp was added to {1}", param1, targetPlayer->getName() );
break; break;
} }
case GmCommand::Inv: case GmCommand::Inv:
@ -284,8 +292,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
else else
targetActor->getAsChara()->setInvincibilityType( Common::InvincibilityType::InvincibilityRefill ); targetActor->getAsChara()->setInvincibilityType( Common::InvincibilityType::InvincibilityRefill );
player.sendNotice( "Invincibility for " + targetPlayer->getName() + player.sendNotice( "Invincibility for {0} was switched.", targetPlayer->getName() );
" was switched." );
break; break;
} }
case GmCommand::Orchestrion: case GmCommand::Orchestrion:
@ -297,14 +304,12 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
for( uint8_t i = 0; i < 255; i++ ) for( uint8_t i = 0; i < 255; i++ )
targetActor->getAsPlayer()->learnSong( i, 0 ); targetActor->getAsPlayer()->learnSong( i, 0 );
player.sendNotice( "All Songs for " + targetPlayer->getName() + player.sendNotice( "All Songs for {0} were turned on.", targetPlayer->getName() );
" were turned on." );
} }
else else
{ {
targetActor->getAsPlayer()->learnSong( param2, 0 ); targetActor->getAsPlayer()->learnSong( param2, 0 );
player.sendNotice( "Song " + std::to_string( param2 ) + " for " + targetPlayer->getName() + player.sendNotice( "Song {0} for {1} was turned on.", param2, targetPlayer->getName() );
" was turned on." );
} }
} }
@ -326,13 +331,13 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
} }
if( !targetPlayer->addItem( param1, quantity ) ) if( !targetPlayer->addItem( param1, quantity ) )
player.sendUrgent( "Item " + std::to_string( param1 ) + " could not be added to inventory." ); player.sendUrgent( "Item #{0} could not be added to inventory.", param1 );
break; break;
} }
case GmCommand::Gil: case GmCommand::Gil:
{ {
targetPlayer->addCurrency( CurrencyType::Gil, param1 ); targetPlayer->addCurrency( CurrencyType::Gil, param1 );
player.sendNotice( "Added " + std::to_string( param1 ) + " Gil for " + targetPlayer->getName() ); player.sendNotice( "Added {0} Gil for {1}", param1, targetPlayer->getName() );
break; break;
} }
case GmCommand::Collect: case GmCommand::Collect:
@ -341,14 +346,12 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
if( gil < param1 ) if( gil < param1 )
{ {
player.sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" ); player.sendUrgent( "Player does not have enough Gil({0})", gil );
} }
else else
{ {
targetPlayer->removeCurrency( CurrencyType::Gil, param1 ); targetPlayer->removeCurrency( CurrencyType::Gil, param1 );
player.sendNotice( "Removed " + std::to_string( param1 ) + player.sendNotice( "Removed {0} Gil from {1} ({2} before)", param1, targetPlayer->getName(), gil );
" Gil from " + targetPlayer->getName() +
"(" + std::to_string( gil ) + " before)" );
} }
break; break;
} }
@ -380,17 +383,14 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
case GmCommand::GC: case GmCommand::GC:
{ {
targetPlayer->setGc( param1 ); targetPlayer->setGc( param1 );
player.sendNotice( "GC for " + targetPlayer->getName() + player.sendNotice( "GC for {0} was set to {1}", targetPlayer->getName(), targetPlayer->getGc() );
" was set to " + std::to_string( targetPlayer->getGc() ) );
break; break;
} }
case GmCommand::GCRank: case GmCommand::GCRank:
{ {
targetPlayer->setGcRankAt( targetPlayer->getGc() - 1, param1 ); targetPlayer->setGcRankAt( targetPlayer->getGc() - 1, param1 );
player.sendNotice( "GC Rank for " + targetPlayer->getName() + player.sendNotice( "GC Rank for {0} for GC {1} was set to {2}", targetPlayer->getName(), targetPlayer->getGc(),
" for GC " + std::to_string( targetPlayer->getGc() ) + targetPlayer->getGcRankArray()[ targetPlayer->getGc() - 1 ] );
" was set to " +
std::to_string( targetPlayer->getGcRankArray()[ targetPlayer->getGc() - 1 ] ) );
break; break;
} }
case GmCommand::Aetheryte: case GmCommand::Aetheryte:
@ -402,14 +402,12 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
for( uint8_t i = 0; i < 255; i++ ) for( uint8_t i = 0; i < 255; i++ )
targetActor->getAsPlayer()->registerAetheryte( i ); targetActor->getAsPlayer()->registerAetheryte( i );
player.sendNotice( "All Aetherytes for " + targetPlayer->getName() + player.sendNotice( "All Aetherytes for {0} were turned on.", targetPlayer->getName() );
" were turned on." );
} }
else else
{ {
targetActor->getAsPlayer()->registerAetheryte( param2 ); targetActor->getAsPlayer()->registerAetheryte( param2 );
player.sendNotice( "Aetheryte " + std::to_string( param2 ) + " for " + targetPlayer->getName() + player.sendNotice( "Aetheryte {0} for {1} was turned on.", param2, targetPlayer->getName() );
" was turned on." );
} }
} }
@ -419,7 +417,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
{ {
player.queuePacket( player.queuePacket(
std::make_shared< ActorControlPacket143 >( player.getId(), ActorControlType::ToggleWireframeRendering ) ); std::make_shared< ActorControlPacket143 >( player.getId(), ActorControlType::ToggleWireframeRendering ) );
player.sendNotice( "Wireframe Rendering for " + player.getName() + " was toggled" ); player.sendNotice( "Wireframe Rendering for {0} was toggled", player.getName() );
break; break;
} }
case GmCommand::Teri: case GmCommand::Teri:
@ -435,9 +433,8 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
// pInstance will be nullptr if you're accessing a normal zone via its allocated instance id rather than its zoneid // pInstance will be nullptr if you're accessing a normal zone via its allocated instance id rather than its zoneid
if( pInstance && !pInstance->isPlayerBound( player.getId() ) ) if( pInstance && !pInstance->isPlayerBound( player.getId() ) )
{ {
player.sendUrgent( "Not able to join instance: " + std::to_string( param1 ) ); player.sendUrgent( "Not able to join instance#{0}", param1 );
player.sendUrgent( player.sendUrgent( "Player not bound! ( run !instance bind <instanceId> first ) {0}", param1 );
"Player not bound! ( run !instance bind <instanceId> first ) " + std::to_string( param1 ) );
break; break;
} }
@ -445,20 +442,20 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
} }
else if( !pTeriMgr->isValidTerritory( param1 ) ) else if( !pTeriMgr->isValidTerritory( param1 ) )
{ {
player.sendUrgent( "Invalid zone " + std::to_string( param1 ) ); player.sendUrgent( "Invalid zone {0}", param1 );
} }
else else
{ {
auto pZone = pTeriMgr->getZoneByTerritoryTypeId( param1 ); auto pZone = pTeriMgr->getZoneByTerritoryTypeId( param1 );
if( !pZone ) if( !pZone )
{ {
player.sendUrgent( "No zone instance found for " + std::to_string( param1 ) ); player.sendUrgent( "No zone instance found for {0}", param1 );
break; break;
} }
if( !pTeriMgr->isDefaultTerritory( param1 ) ) if( !pTeriMgr->isDefaultTerritory( param1 ) )
{ {
player.sendUrgent( pZone->getName() + " is an instanced area - instance ID required to zone in." ); player.sendUrgent( "{0} is an instanced area - instance ID required to zone in.", pZone->getName() );
break; break;
} }
@ -497,8 +494,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 ); targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
} }
player.sendNotice( targetPlayer->getName() + " was warped to zone " + player.sendNotice( "{0} was warped to zone {1}", targetPlayer->getName(), param1, pZone->getName() );
std::to_string( param1 ) + " (" + pZone->getName() + ")" );
} }
break; break;
} }
@ -507,22 +503,27 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
// todo: this doesn't kill their session straight away, should do this properly but its good for when you get stuck for now // todo: this doesn't kill their session straight away, should do this properly but its good for when you get stuck for now
targetPlayer->setMarkedForRemoval(); targetPlayer->setMarkedForRemoval();
player.sendNotice( "Kicked " + targetPlayer->getName() ); player.sendNotice( "Kicked {0}", targetPlayer->getName() );
break; break;
} }
case GmCommand::TeriInfo: case GmCommand::TeriInfo:
{ {
auto pCurrentZone = player.getCurrentZone(); auto pCurrentZone = player.getCurrentZone();
player.sendNotice( "ZoneId: " + std::to_string( player.getZoneId() ) + player.sendNotice( "ZoneId: {0}"
"\nName: " + pCurrentZone->getName() + "\nName: {1}"
"\nInternalName: " + pCurrentZone->getInternalName() + "\nInternalName: {2}"
"\nGuId: " + std::to_string( pCurrentZone->getGuId() ) + "\nGuId: {3}"
"\nPopCount: " + std::to_string( pCurrentZone->getPopCount() ) + "\nPopCount: {4}"
"\nCurrentWeather: " + "\nCurrentWeather: {5}"
std::to_string( static_cast< uint8_t >( pCurrentZone->getCurrentWeather() ) ) + "\nNextWeather: {6}",
"\nNextWeather: " + player.getZoneId(),
std::to_string( static_cast< uint8_t >( pCurrentZone->getNextWeather() ) ) ); pCurrentZone->getName(),
pCurrentZone->getInternalName(),
pCurrentZone->getGuId(),
pCurrentZone->getPopCount(),
static_cast< uint8_t >( pCurrentZone->getCurrentWeather() ),
static_cast< uint8_t >( pCurrentZone->getNextWeather() ) );
break; break;
} }
case GmCommand::Jump: case GmCommand::Jump:
@ -533,12 +534,12 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z, player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
targetActor->getRot() ); targetActor->getRot() );
player.sendNotice( "Jumping to " + targetPlayer->getName() + " in range." ); player.sendNotice( "Jumping to {0} in range.", targetPlayer->getName() );
break; break;
} }
default: default:
player.sendUrgent( "GM1 Command not implemented: " + std::to_string( commandId ) ); player.sendUrgent( "GM1 Command not implemented: {0}", commandId );
break; break;
} }
@ -580,7 +581,7 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
} }
else else
{ {
player.sendUrgent( "Player " + target + " not found on this server." ); player.sendUrgent( "Player {0} not found on this server.", target );
return; return;
} }
} }
@ -604,7 +605,7 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
targetPlayer->sendToInRangeSet( makeActorControl142( player.getId(), SetStatus, targetPlayer->sendToInRangeSet( makeActorControl142( player.getId(), SetStatus,
static_cast< uint8_t >( Common::ActorStatus::Idle ) ), static_cast< uint8_t >( Common::ActorStatus::Idle ) ),
true ); true );
player.sendNotice( "Raised " + targetPlayer->getName() ); player.sendNotice( "Raised {0}", targetPlayer->getName() );
break; break;
} }
case GmCommand::Jump: case GmCommand::Jump:
@ -615,7 +616,7 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
} }
player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z, player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
targetActor->getRot() ); targetActor->getRot() );
player.sendNotice( "Jumping to " + targetPlayer->getName() ); player.sendNotice( "Jumping to {0}", targetPlayer->getName() );
break; break;
} }
case GmCommand::Call: case GmCommand::Call:
@ -630,11 +631,11 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
targetPlayer->setInstance( player.getCurrentZone() ); targetPlayer->setInstance( player.getCurrentZone() );
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() ); targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() );
player.sendNotice( "Calling " + targetPlayer->getName() ); player.sendNotice( "Calling {0}", targetPlayer->getName() );
break; break;
} }
default: default:
player.sendUrgent( "GM2 Command not implemented: " + std::to_string( commandId ) ); player.sendUrgent( "GM2 Command not implemented: {0}", commandId );
break; break;
} }

View file

@ -353,7 +353,7 @@ void Sapphire::Network::GameConnection::zoneLineHandler( FrameworkPtr pFw,
else else
{ {
// No zoneline found, revert to last zone // No zoneline found, revert to last zone
player.sendUrgent( "ZoneLine " + std::to_string( zoneLineId ) + " not found." ); player.sendUrgent( "ZoneLine {0} not found.", zoneLineId );
targetPos.x = 0; targetPos.x = 0;
targetPos.y = 0; targetPos.y = 0;
targetPos.z = 0; targetPos.z = 0;