b859b22111
Port CachedUserNameToIdResolver to the dedicated server, in place of the in-memory name cache: usercache.json in the universe folder is loaded at startup (bad entries skipped, a bad date warned about), players are added when they join and kept for a month, and the file keeps the 1000 most recently used, newest first, as Gson writes it. The console's op, deop, ban, pardon and whitelist find players by name through it, in any case. A name it doesn't hold is asked of the profile service (profiles::find_by_name) on offline servers too, as vanilla does; one the service doesn't know is the offline player of the lower-case name on an offline server, and "That player does not exist" on an online one. tools/test_user_cache_parity.py runs vanilla's server and Horizon's with a mock profile service and compares the replies, the names looked up and the files; the dedicated-server harness now compares usercache.json too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
526 B
Rust
14 lines
526 B
Rust
//! The dedicated server's files and settings, ported from
|
|
//! net.minecraft.server.dedicated and net.minecraft.server.players:
|
|
//! server.properties, eula.txt, the four user lists, usercache.json and
|
|
//! looking players up by name. The game's dedicated server
|
|
//! (`horizon-client --dedicated`) reads them, and `horizon-server` manages
|
|
//! them; this crate needs neither a window nor the game.
|
|
pub mod eula;
|
|
pub mod java_properties;
|
|
pub mod json;
|
|
pub mod profiles;
|
|
pub mod properties;
|
|
pub mod user_cache;
|
|
pub mod user_lists;
|