Initial commit

This commit is contained in:
NOTPIES
2026-03-15 22:25:51 -03:00
commit c356c7b911
100 changed files with 8788 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include "stdafx.h"
#include "BanListCommand.h"
#include "ServerTextList.h"
#include "../../Minecraft.Client/ConsoleInputSource.h"
#include "../../Minecraft.Client/MinecraftServer.h"
#include "../Core/ServerLists.h"
#include "ServerTextList.h"
#include <sstream>
void BanListCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
{
wstringstream ss(args);
wstring type;
ss >> type;
if (type == L"ips")
{
const set<wstring>& entries = ServerLists_GetBannedIPs()->getEntries();
wchar_t buf[128];
swprintf_s(buf, 128, L"There are %d banned IP addresses:", (int)entries.size());
src->info(wstring(buf));
wstring list;
for (set<wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
{
if (!list.empty()) list += L", ";
list += *it;
}
if (!list.empty()) src->info(list);
}
else
{
const set<wstring>& entries = ServerLists_GetBannedPlayers()->getEntries();
wchar_t buf[128];
swprintf_s(buf, 128, L"There are %d banned players:", (int)entries.size());
src->info(wstring(buf));
wstring list;
for (set<wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
{
if (!list.empty()) list += L", ";
list += *it;
}
if (!list.empty()) src->info(list);
}
}