2018-01-28 11:16:34 +01:00
|
|
|
#ifndef _GAMECOMMANDHANDLER_H_
|
|
|
|
#define _GAMECOMMANDHANDLER_H_
|
|
|
|
|
|
|
|
#include <map>
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Common.h>
|
2018-01-28 11:16:34 +01:00
|
|
|
|
|
|
|
#include "DebugCommand.h"
|
2018-09-09 23:56:22 +02:00
|
|
|
#include "ForwardsZone.h"
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
namespace Core
|
2018-01-28 11:16:34 +01:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// handler for in game commands
|
|
|
|
class DebugCommandHandler
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// container mapping command string to command object
|
|
|
|
std::map< std::string, std::shared_ptr< DebugCommand > > m_commandMap;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DebugCommandHandler();
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
~DebugCommandHandler();
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// register command to command map
|
|
|
|
void registerCommand( const std::string& n, DebugCommand::pFunc, const std::string& hText, uint8_t uLevel );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// execute command if registered
|
|
|
|
void execCommand( char* data, Entity::Player& player );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// help command
|
|
|
|
void help( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// command handler callbacks
|
|
|
|
void set( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void get( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void add( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
|
|
|
//void debug( char * data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-01-28 23:53:58 +11:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void injectPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void injectChatPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void replay( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void nudge( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void serverInfo( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void unlockCharacter( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void instance( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-11-08 10:54:37 +01:00
|
|
|
void housing( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command) ;
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
void script( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
|
2018-01-28 11:16:34 +01:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
2018-01-28 11:16:34 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|