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

change include order, make debugcommand shared_ptr type nicer

This commit is contained in:
GokuWeedLord 2017-12-12 14:58:36 +11:00
parent ed8958fb43
commit b35dc0c25a

View file

@ -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 <boost/make_shared.hpp>
#include "Script/NativeScript.h"
#include <cinttypes>
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 = "";