![]() |
fCraft
0.638
Custom Minecraft Server
|
Persistent database of player information. More...
Static Public Member Functions | |
| static PlayerInfo | AddFakeEntry ([NotNull] string name, RankChangeType rankChangeType) |
| static void | Save () |
| static PlayerInfo | FindOrCreateInfoForPlayer ([NotNull] string name,[NotNull] IPAddress lastIP) |
| static PlayerInfo[] | FindPlayers ([NotNull] IPAddress address) |
| static PlayerInfo[] | FindPlayers ([NotNull] IPAddress address, int limit) |
| static PlayerInfo[] | FindPlayersCidr ([NotNull] IPAddress address, byte range) |
| static PlayerInfo[] | FindPlayersCidr ([NotNull] IPAddress address, byte range, int limit) |
| static PlayerInfo[] | FindPlayers ([NotNull] Regex regex) |
| static PlayerInfo[] | FindPlayers ([NotNull] Regex regex, int limit) |
| static PlayerInfo[] | FindPlayers ([NotNull] string namePart) |
| static PlayerInfo[] | FindPlayers ([NotNull] string namePart, int limit) |
| static PlayerInfo | FindPlayerInfoExact ([NotNull] string fullName) |
| Finds player by exact name. | |
| static PlayerInfo | FindPlayerInfoOrPrintMatches ([NotNull] Player player,[NotNull] string partialName, bool includeSelf) |
| Searches for player names starting with namePart. If exactly one player matched, returns the corresponding PlayerInfo object. If name format is incorrect, or if no matches were found, an appropriate message is printed to the player. If multiple players were found matching the partialName, first 25 matches are printed. | |
| static string | FindExactClassyName ([CanBeNull] string name) |
| static int | GetNextID () |
| static PlayerInfo | FindPlayerInfoByID (int id) |
| Finds PlayerInfo by ID. Returns null of not found. | |
| static int | MassRankChange ([NotNull] Player player,[NotNull] Rank from,[NotNull] Rank to,[NotNull] string reason) |
| static StringBuilder | AppendEscaped ([NotNull] this StringBuilder sb,[CanBeNull] string str) |
| Escapes special characters (comma, newline, carriage return) and appends the processed string to the given StringBuilder. Used on all string fields of PlayerInfo and IPBanInfo. | |
| static string | Escape ([CanBeNull] string str) |
| Escapes special characters (comma, newline, carriage return) in the given string. | |
| static string | Unescape ([NotNull] string str) |
| Restores escaped special characters (comma, newline, carriage return). Used on all string fields of PlayerInfo and IPBanInfo records, at load time. | |
Public Attributes | |
| const int | FormatVersion = 5 |
Properties | |
| static PlayerInfo[] | PlayerInfoList [get, set] |
| Cached list of all players in the database. May be quite long. Make sure to copy a reference to the list before accessing it in a loop, since this array be frequently be replaced by an updated one. | |
| static bool | IsLoaded [get, set] |
| Whether PlayerDB has been loaded. Ranks cannot be modified after PlayerDB is loaded. | |
| static TimeSpan | SaveInterval [get, set] |
| Interval at which PlayerDB should be saved. Default is 90s. | |
| static int | BannedCount [get] |
| static float | BannedPercentage [get] |
| static int | Size [get] |
Persistent database of player information.
|
static |
|
static |
Escapes special characters (comma, newline, carriage return) and appends the processed string to the given StringBuilder. Used on all string fields of PlayerInfo and IPBanInfo.
| sb | StringBuilder to which string should be appended. May not be null. |
| str | String to process and append. If this string is null or empty, nothing is appended. |
| ArgumentNullException | sb is null. |
|
static |
Escapes special characters (comma, newline, carriage return) in the given string.
| str | String to process. If this string is null, an empty string is returned. |
|
static |
|
static |
|
static |
Finds PlayerInfo by ID. Returns null of not found.
|
static |
Finds player by exact name.
| fullName | Full, case-insensitive name of the player. |
|
static |
Searches for player names starting with namePart. If exactly one player matched, returns the corresponding PlayerInfo object. If name format is incorrect, or if no matches were found, an appropriate message is printed to the player. If multiple players were found matching the partialName, first 25 matches are printed.
| player | Player to print feedback to. |
| partialName | Partial or full player name. |
| includeSelf | Whether player themself should be considered. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Restores escaped special characters (comma, newline, carriage return). Used on all string fields of PlayerInfo and IPBanInfo records, at load time.
| str | String to unescape. |
| ArgumentNullException | str is null. |
| const int fCraft.PlayerDB.FormatVersion = 5 |
|
staticget |
|
staticget |
|
staticgetset |
|
staticgetset |
Cached list of all players in the database. May be quite long. Make sure to copy a reference to the list before accessing it in a loop, since this array be frequently be replaced by an updated one.
|
staticgetset |
Interval at which PlayerDB should be saved. Default is 90s.
|
staticget |