1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00
sapphire/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.h

46 lines
1.7 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _GAMECOMMANDHANDLER_H_
#define _GAMECOMMANDHANDLER_H_
#include <map>
#include "DebugCommand.h"
2017-08-19 00:18:40 +02:00
#include <src/servers/Server_Common/Common.h>
#include "src/servers/Server_Zone/Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core {
// handler for in game commands
class DebugCommandHandler
2017-08-08 13:53:47 +02:00
{
private:
// container mapping command string to command object
std::map<std::string, boost::shared_ptr<DebugCommand> > m_commandMap;
2017-08-08 13:53:47 +02:00
public:
DebugCommandHandler();
~DebugCommandHandler();
2017-08-08 13:53:47 +02:00
// register command to command map
void registerCommand( const std::string& n, DebugCommand::pFunc, const std::string& hText, Common::UserLevel uLevel );
2017-08-08 13:53:47 +02:00
// execute command if registered
void execCommand( char * data, Entity::PlayerPtr pPlayer );
// command handler callbacks
void set( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void get( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void add( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
//void debug( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void scriptReload( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void injectPacket( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void injectChatPacket( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
void nudge( char* data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
2017-09-14 17:19:44 +02:00
void serverInfo( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
2017-08-08 13:53:47 +02:00
};
}
#endif