mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-05-22 12:27:28 +00:00
LCEMP v1.1.0 Dedicated Server
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "MeCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerConnection.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.World/ChatPacket.h"
|
||||
|
||||
@@ -12,7 +13,22 @@ void MeCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftS
|
||||
src->warn(L"Usage: /me <action ...>");
|
||||
return;
|
||||
}
|
||||
wstring msg = L"* Server " + args;
|
||||
wstring senderName = L"Server";
|
||||
if (src != NULL)
|
||||
{
|
||||
senderName = src->getConsoleName();
|
||||
if (senderName.empty())
|
||||
{
|
||||
senderName = L"Server";
|
||||
}
|
||||
}
|
||||
|
||||
wstring msg = L"* " + senderName + L" " + args;
|
||||
server->getPlayers()->broadcastAll(shared_ptr<Packet>(new ChatPacket(msg)));
|
||||
src->info(msg);
|
||||
|
||||
// player sources already receive the broadcast chat line above
|
||||
if (dynamic_cast<PlayerConnection *>(src) == NULL)
|
||||
{
|
||||
src->info(msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user