Class WhitelistService
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Manages a server's whitelist.json file (list of allowed players). Each entry has uuid + name. It resolves the UUID from Mojang (online mode) or computes it offline when the server does not use official accounts.
public class WhitelistService
- Inheritance
-
WhitelistService
- Inherited Members
Methods
AddAsync(string, string, bool, CancellationToken)
Adds a player to whitelist.json (resolving their UUID). Does not duplicate.
public Task AddAsync(string folder, string name, bool onlineMode, CancellationToken ct = default)
Parameters
folderstringnamestringonlineModeboolctCancellationToken
Returns
OfflineUuid(string)
Offline UUID (same as Java: UUID v3 of "OfflinePlayer:<name>").
public static string OfflineUuid(string name)
Parameters
namestring
Returns
ReadNames(string)
Returns the names of the players in the whitelist.
public List<string> ReadNames(string folder)
Parameters
folderstring
Returns
Remove(string, string)
Removes a player (by name) from whitelist.json.
public void Remove(string folder, string name)