diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp index 471ca10f..26007799 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp +++ b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp @@ -19,6 +19,7 @@ #include "Network/PacketWrappers/InitUIPacket.h" #include "Network/GameConnection.h" #include "Script/ScriptManager.h" +#include "Script/NativeScript.h" #include "Actor/Player.h" #include "Actor/BattleNpc.h" @@ -31,11 +32,11 @@ #include "Session.h" #include -#include "Script/NativeScript.h" - #include +using DebugCommandPtr = boost::shared_ptr< DebugCommand >; + extern Core::Scripting::ScriptManager g_scriptMgr; extern Core::Data::ExdData g_exdData; extern Core::Logger g_log; @@ -119,7 +120,7 @@ void Core::DebugCommandHandler::execCommand( char * data, Entity::Player& player // Definition of the commands /////////////////////////////////////////////////////////////////////////////////////// -void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::help( char* data, Entity::Player& player, DebugCommandPtr command ) { player.sendDebug( "Registered debug commands:" ); for ( auto cmd : m_commandMap ) @@ -131,7 +132,7 @@ void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost: } } -void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::set( char * data, Entity::Player& player, DebugCommandPtr command ) { std::string subCommand = ""; std::string params = ""; @@ -283,7 +284,7 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost: } -void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::add( char * data, Entity::Player& player, DebugCommandPtr command ) { std::string subCommand; std::string params = ""; @@ -400,7 +401,7 @@ void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost: } -void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::get( char * data, Entity::Player& player, DebugCommandPtr command ) { std::string subCommand; std::string params = ""; @@ -444,21 +445,21 @@ void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost: } -void Core::DebugCommandHandler::injectPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::injectPacket( char * data, Entity::Player& player, DebugCommandPtr command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) pSession->getZoneConnection()->injectPacket( data + 7, player ); } -void Core::DebugCommandHandler::injectChatPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::injectChatPacket( char * data, Entity::Player& player, DebugCommandPtr command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) pSession->getChatConnection()->injectPacket( data + 8, player ); } -void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, DebugCommandPtr command ) { std::string subCommand; @@ -505,19 +506,19 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, boos } } -void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, DebugCommandPtr command ) { player.sendDebug( "SapphireServer " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); player.sendDebug( "Compiled: " __DATE__ " " __TIME__ ); player.sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) ); } -void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, DebugCommandPtr command ) { player.unlock(); } -void Core::DebugCommandHandler::script( char* data, Entity::Player &player, boost::shared_ptr< DebugCommand > command ) +void Core::DebugCommandHandler::script( char* data, Entity::Player &player, DebugCommandPtr command ) { std::string subCommand; std::string params = "";