the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3// 4J Stu - Based loosely on the Java versions
4
5#include "CommandsEnum.h"
6#include "ChatPacket.h"
7
8class AdminLogCommand;
9class CommandSender;
10class ServerPlayer;
11
12class Command
13{
14public:
15 // commands such as "help" and "emote"
16 static const int LEVEL_ALL = 0;
17 // commands such as "mute"
18 static const int LEVEL_MODERATORS = 1;
19 // commands such as "seed", "tp", "spawnpoint" and "give"
20 static const int LEVEL_GAMEMASTERS = 2;
21 // commands such as "whitelist", "ban", etc
22 static const int LEVEL_ADMINS = 3;
23 // commands such as "stop", "save-all", etc
24 static const int LEVEL_OWNERS = 4;
25
26private:
27 static AdminLogCommand *logger;
28
29public:
30 virtual EGameCommand getId() = 0;
31 virtual int getPermissionLevel();
32 virtual void execute(shared_ptr<CommandSender> source, byteArray commandData) = 0;
33 virtual bool canExecute(shared_ptr<CommandSender> source);
34
35 static void logAdminAction(shared_ptr<CommandSender> source, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L"");
36 static void logAdminAction(shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L"");
37 static void setLogger(AdminLogCommand *logger);
38
39protected:
40 shared_ptr<ServerPlayer> getPlayer(PlayerUID playerId);
41};