mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-05-22 17:24:49 +00:00
Initial commit
This commit is contained in:
18
Commands/SayCommand.cpp
Normal file
18
Commands/SayCommand.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "stdafx.h"
|
||||
#include "SayCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.World/ChatPacket.h"
|
||||
|
||||
void SayCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
if (args.empty())
|
||||
{
|
||||
src->warn(L"Usage: /say <message ...>");
|
||||
return;
|
||||
}
|
||||
wstring msg = L"[Server] " + args;
|
||||
server->getPlayers()->broadcastAll(shared_ptr<Packet>(new ChatPacket(msg)));
|
||||
src->info(L"\u00A7d[Server] " + args);
|
||||
}
|
||||
Reference in New Issue
Block a user