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-12-08 15:38:25 +01:00
|
|
|
#include <Server_Common/Common.h>
|
|
|
|
#include "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-12-08 11:46:47 +01: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
|
2017-12-08 11:46:47 +01:00
|
|
|
void execCommand( char * data, Entity::Player& player );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-10-21 23:41:09 +11:00
|
|
|
// help command
|
2017-12-08 11:46:47 +01:00
|
|
|
void help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
2017-10-21 23:41:09 +11:00
|
|
|
|
2017-08-08 13:53:47 +02:00
|
|
|
// command handler callbacks
|
2017-12-08 11:46:47 +01:00
|
|
|
void set( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void get( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void add( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
//void debug( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void scriptReload( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
|
|
|
|
void injectPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void injectChatPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void nudge( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void serverInfo( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
|
|
|
|
void unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
|
|
|
void targetInfo( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command );
|
2017-10-21 23:41:09 +11:00
|
|
|
|
2017-08-08 13:53:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|