the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "MinecraftServer.h"
3#include "PlayerList.h"
4#include "ServerPlayer.h"
5#include "..\Minecraft.World\net.minecraft.commands.h"
6#include "..\Minecraft.World\net.minecraft.commands.common.h"
7#include "TeleportCommand.h"
8#include "ServerCommandDispatcher.h"
9
10ServerCommandDispatcher::ServerCommandDispatcher()
11{
12 addCommand(new TimeCommand());
13 addCommand(new GameModeCommand());
14 addCommand(new DefaultGameModeCommand());
15 addCommand(new KillCommand());
16 addCommand(new ToggleDownfallCommand());
17 addCommand(new ExperienceCommand());
18 addCommand(new TeleportCommand());
19 addCommand(new GiveItemCommand());
20 addCommand(new EnchantItemCommand());
21 //addCommand(new EmoteCommand());
22 //addCommand(new ShowSeedCommand());
23 //addCommand(new HelpCommand());
24 //addCommand(new DebugCommand());
25 //addCommand(new MessageCommand());
26
27 //if (MinecraftServer::getInstance()->isDedicatedServer())
28 //{
29 // addCommand(new OpCommand());
30 // addCommand(new DeOpCommand());
31 // addCommand(new StopCommand());
32 // addCommand(new SaveAllCommand());
33 // addCommand(new SaveOffCommand());
34 // addCommand(new SaveOnCommand());
35 // addCommand(new BanIpCommand());
36 // addCommand(new PardonIpCommand());
37 // addCommand(new BanPlayerCommand());
38 // addCommand(new ListBansCommand());
39 // addCommand(new PardonPlayerCommand());
40 // addCommand(new KickCommand());
41 // addCommand(new ListPlayersCommand());
42 // addCommand(new BroadcastCommand());
43 // addCommand(new WhitelistCommand());
44 //}
45 //else
46 //{
47 // addCommand(new PublishLocalServerCommand());
48 //}
49
50 // addCommand(new ServerTempDebugCommand());
51
52 Command::setLogger(this);
53}
54
55void ServerCommandDispatcher::logAdminCommand(shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage)
56{
57 PlayerList *playerList = MinecraftServer::getInstance()->getPlayers();
58 //for (Player player : MinecraftServer.getInstance().getPlayers().players)
59 for(AUTO_VAR(it, playerList->players.begin()); it != playerList->players.end(); ++it)
60 {
61 shared_ptr<ServerPlayer> player = *it;
62 if (player != source && playerList->isOp(player))
63 {
64 // TODO: Change chat packet to be able to send more bits of data
65 // 4J Stu - Take this out until we can add the name of the player performing the action. Also if the target is a mod then maybe don't need the message?
66 //player->sendMessage(message, messageType, customData, additionalMessage);
67 //player->sendMessage("\u00A77\u00A7o[" + source.getName() + ": " + player.localize(message, args) + "]");
68 }
69 }
70
71 if ((type & LOGTYPE_DONT_SHOW_TO_SELF) != LOGTYPE_DONT_SHOW_TO_SELF)
72 {
73 source->sendMessage(message, messageType, customData, additionalMessage);
74 }
75}