Table of Contents

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

folder string
name string
onlineMode bool
ct CancellationToken

Returns

Task

OfflineUuid(string)

Offline UUID (same as Java: UUID v3 of "OfflinePlayer:<name>").

public static string OfflineUuid(string name)

Parameters

name string

Returns

string

ReadNames(string)

Returns the names of the players in the whitelist.

public List<string> ReadNames(string folder)

Parameters

folder string

Returns

List<string>

Remove(string, string)

Removes a player (by name) from whitelist.json.

public void Remove(string folder, string name)

Parameters

folder string
name string