mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-05-25 22:45:28 +00:00
Initial commit
This commit is contained in:
19
Commands/ListServerCommand.cpp
Normal file
19
Commands/ListServerCommand.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "stdafx.h"
|
||||
#include "ListServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
|
||||
void ListServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
PlayerList *playerList = server->getPlayers();
|
||||
int count = playerList->getPlayerCount();
|
||||
int max = playerList->getMaxPlayers();
|
||||
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"There are %d/%d players online:", count, max);
|
||||
src->info(wstring(buf));
|
||||
src->info(playerList->getPlayerNames());
|
||||
}
|
||||
Reference in New Issue
Block a user