2021-12-05 17:54:36 +00:00
|
|
|
/*
|
|
|
|
* Darkflame Universe
|
|
|
|
* Copyright 2018
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SLASHCOMMANDHANDLER_H
|
|
|
|
#define SLASHCOMMANDHANDLER_H
|
|
|
|
|
|
|
|
#include "RakNetTypes.h"
|
2024-04-08 20:11:59 +00:00
|
|
|
#include "eGameMasterLevel.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class Entity;
|
|
|
|
|
2024-04-08 20:11:59 +00:00
|
|
|
struct Command {
|
|
|
|
std::string help;
|
|
|
|
std::string info;
|
|
|
|
std::vector<std::string> aliases;
|
|
|
|
std::function<void(Entity*, const SystemAddress&,const std::string)> handle;
|
|
|
|
eGameMasterLevel requiredLevel = eGameMasterLevel::OPERATOR;
|
|
|
|
};
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
namespace SlashCommandHandler {
|
|
|
|
void HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr);
|
|
|
|
void SendAnnouncement(const std::string& title, const std::string& message);
|
2024-04-08 20:11:59 +00:00
|
|
|
void RegisterCommand(Command info);
|
2024-04-10 01:15:51 +00:00
|
|
|
void Startup();
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
2024-04-08 20:11:59 +00:00
|
|
|
namespace GMZeroCommands {
|
|
|
|
void Help(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
|
|
|
}
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
#endif // SLASHCOMMANDHANDLER_H
|