mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
- add Access frontend that publishes thread-safe ban manager snapshots for dedicated server use - add BanManager storage for banned-players.json and banned-ips.json with load/save/update flows - add persistent player and IP ban checks during dedicated server connection handling - add UTF-8 BOM-safe JSON parsing and shared file helpers backed by nlohmann/json - add Unicode-safe ban file read/write and safer atomic replacement behavior on Windows - add active-ban snapshot APIs and expiry-aware filtering for expires metadata - add RAII-based dedicated access shutdown handling during server startup and teardown
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "BanManager.h"
|
|
|
|
namespace ServerRuntime
|
|
{
|
|
/**
|
|
* A frontend that will be general-purpose, assuming the implementation of whitelists and ops in the future.
|
|
*/
|
|
namespace Access
|
|
{
|
|
bool Initialize(const std::string &baseDirectory = ".");
|
|
void Shutdown();
|
|
bool Reload();
|
|
bool IsInitialized();
|
|
|
|
bool IsPlayerBanned(PlayerUID xuid);
|
|
bool IsIpBanned(const std::string &ip);
|
|
|
|
bool AddPlayerBan(PlayerUID xuid, const std::string &name, const BanMetadata &metadata);
|
|
bool AddIpBan(const std::string &ip, const BanMetadata &metadata);
|
|
bool RemovePlayerBan(PlayerUID xuid);
|
|
bool RemoveIpBan(const std::string &ip);
|
|
|
|
/**
|
|
* Copies the current cached player bans for inspection or command output
|
|
* 現在のプレイヤーBAN一覧を複製取得
|
|
*/
|
|
bool SnapshotBannedPlayers(std::vector<BannedPlayerEntry> *outEntries);
|
|
/**
|
|
* Copies the current cached IP bans for inspection or command output
|
|
* 現在のIP BAN一覧を複製取得
|
|
*/
|
|
bool SnapshotBannedIps(std::vector<BannedIpEntry> *outEntries);
|
|
|
|
std::string FormatXuid(PlayerUID xuid);
|
|
}
|
|
}
|