feat: velocity routing, server registry and RampartVelocity tests

This commit is contained in:
Loki 2026-08-03 10:54:28 +02:00
parent c50cb67d9e
commit cb183d42a2
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
41 changed files with 1239 additions and 532 deletions

View file

@ -65,17 +65,24 @@ pub struct HmacConfig {
pub secret: String,
#[serde(default = "default_key_rotation")]
pub key_rotation_interval_secs: u64,
#[serde(default = "default_signature_ttl")]
pub signature_ttl_secs: u64,
}
fn default_key_rotation() -> u64 {
3600
}
fn default_signature_ttl() -> u64 {
60
}
impl Default for HmacConfig {
fn default() -> Self {
Self {
secret: String::new(),
key_rotation_interval_secs: 3600,
signature_ttl_secs: 60,
}
}
}
@ -262,7 +269,12 @@ pub struct PowConfig {
}
fn default_pow_enabled() -> bool {
true
// PoW выключен по умолчанию: текущий текстовый challenge отправляется до
// handshake и несовместим с ванильными MC-клиентами — они не умеют его
// решать, поэтому при enabled=true никто не сможет зайти на сервер.
// Включать только после появления клиентского мода или PoW, совместимого
// с протоколом Minecraft.
false
}
fn default_pow_difficulty() -> u8 {
@ -272,7 +284,7 @@ fn default_pow_difficulty() -> u8 {
impl Default for PowConfig {
fn default() -> Self {
Self {
enabled: true,
enabled: false,
difficulty: 4,
}
}