1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00
sapphire/src/servers/sapphire_zone/DebugCommand/DebugCommandHandler.h

62 lines
1.9 KiB
C
Raw Normal View History

#ifndef _GAMECOMMANDHANDLER_H_
#define _GAMECOMMANDHANDLER_H_
#include <map>
2018-03-06 22:22:19 +01:00
#include <Common.h>
#include "DebugCommand.h"
#include "ForwardsZone.h"
namespace Core {
// handler for in game commands
class DebugCommandHandler
{
private:
// container mapping command string to command object
2018-10-25 12:44:51 +11:00
std::map< std::string, std::shared_ptr< DebugCommand > > m_commandMap;
public:
DebugCommandHandler();
~DebugCommandHandler();
// register command to command map
void registerCommand( const std::string& n, DebugCommand::pFunc, const std::string& hText, uint8_t uLevel );
// execute command if registered
void execCommand( char* data, Entity::Player& player );
// help command
2018-10-25 12:44:51 +11:00
void help( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
// command handler callbacks
2018-10-25 12:44:51 +11:00
void set( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void get( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11: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-10-25 12:44:51 +11:00
void injectPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void injectChatPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void replay( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void nudge( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void serverInfo( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void unlockCharacter( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void instance( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
2018-10-25 12:44:51 +11:00
void script( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command );
};
}
#endif