2017-08-08 13:53:47 +02:00
|
|
|
#ifndef _GAMECOMMANDHANDLER_H_
|
|
|
|
#define _GAMECOMMANDHANDLER_H_
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2017-08-18 17:16:15 +02:00
|
|
|
#include "DebugCommand.h"
|
2017-08-19 00:18:40 +02:00
|
|
|
#include <src/servers/Server_Common/Common.h>
|
2017-08-18 17:16:15 +02:00
|
|
|
#include "src/servers/Server_Zone/Forwards.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
|
|
|
|
// handler for in game commands
|
2017-08-18 17:16:15 +02:00
|
|
|
class DebugCommandHandler
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
// container mapping command string to command object
|
2017-08-18 17:16:15 +02:00
|
|
|
std::map<std::string, boost::shared_ptr<DebugCommand> > m_commandMap;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
public:
|
2017-08-18 17:16:15 +02:00
|
|
|
DebugCommandHandler();
|
|
|
|
~DebugCommandHandler();
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
// register command to command map
|
2017-09-18 18:44:38 +02:00
|
|
|
void registerCommand( const std::string& n, DebugCommand::pFunc, const std::string& hText, uint8_t uLevel );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
// execute command if registered
|
|
|
|
void execCommand( char * data, Entity::PlayerPtr pPlayer );
|
|
|
|
|
|
|
|
// command handler callbacks
|
2017-08-18 17:16:15 +02:00
|
|
|
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 );
|
2017-08-22 23:53:20 +02:00
|
|
|
void injectChatPacket( char * data, Entity::PlayerPtr pPlayer, boost::shared_ptr<DebugCommand> command );
|
2017-08-18 17:16:15 +02:00
|
|
|
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
|