mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 08:57:44 +00:00
change include order, make debugcommand shared_ptr type nicer
This commit is contained in:
parent
ed8958fb43
commit
b35dc0c25a
1 changed files with 13 additions and 12 deletions
|
@ -19,6 +19,7 @@
|
||||||
#include "Network/PacketWrappers/InitUIPacket.h"
|
#include "Network/PacketWrappers/InitUIPacket.h"
|
||||||
#include "Network/GameConnection.h"
|
#include "Network/GameConnection.h"
|
||||||
#include "Script/ScriptManager.h"
|
#include "Script/ScriptManager.h"
|
||||||
|
#include "Script/NativeScript.h"
|
||||||
|
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
#include "Actor/BattleNpc.h"
|
#include "Actor/BattleNpc.h"
|
||||||
|
@ -31,11 +32,11 @@
|
||||||
#include "Session.h"
|
#include "Session.h"
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "Script/NativeScript.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
|
using DebugCommandPtr = boost::shared_ptr< DebugCommand >;
|
||||||
|
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdData g_exdData;
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
@ -119,7 +120,7 @@ void Core::DebugCommandHandler::execCommand( char * data, Entity::Player& player
|
||||||
// Definition of the commands
|
// 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:" );
|
player.sendDebug( "Registered debug commands:" );
|
||||||
for ( auto cmd : m_commandMap )
|
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 subCommand = "";
|
||||||
std::string params = "";
|
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 subCommand;
|
||||||
std::string params = "";
|
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 subCommand;
|
||||||
std::string params = "";
|
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() );
|
auto pSession = g_serverZone.getSession( player.getId() );
|
||||||
if( pSession )
|
if( pSession )
|
||||||
pSession->getZoneConnection()->injectPacket( data + 7, player );
|
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() );
|
auto pSession = g_serverZone.getSession( player.getId() );
|
||||||
if( pSession )
|
if( pSession )
|
||||||
pSession->getChatConnection()->injectPacket( data + 8, player );
|
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;
|
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( "SapphireServer " + Version::VERSION + "\nRev: " + Version::GIT_HASH );
|
||||||
player.sendDebug( "Compiled: " __DATE__ " " __TIME__ );
|
player.sendDebug( "Compiled: " __DATE__ " " __TIME__ );
|
||||||
player.sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) );
|
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();
|
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 subCommand;
|
||||||
std::string params = "";
|
std::string params = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue