Allow disable encryption

This commit is contained in:
Snowiiii committed 2024-09-28 13:03:31 +02:00
1 parent 92fef82bda
commit 1ddaca1406
14 files changed
+117 -101

No files matched your search

+20 -5
View File
@@ -1,24 +1,39 @@
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
// Packet compression
/// Packet compression
pub struct CompressionConfig {
/// Is compression enabled ?
pub enabled: bool,
#[serde(flatten)]
pub compression_info: CompressionInfo,
}
#[derive(Deserialize, Serialize, Clone)]
/// We have this in a Seperate struct so we can use it outside of the Config
pub struct CompressionInfo {
/// The compression threshold used when compression is enabled
pub compression_threshold: u32,
pub threshold: u32,
/// A value between 0..9
/// 1 = Optimize for the best speed of encoding.
/// 9 = Optimize for the size of data being encoded.
pub compression_level: u32,
pub level: u32,
}
impl Default for CompressionInfo {
fn default() -> Self {
Self {
threshold: 256,
level: 4,
}
}
}
impl Default for CompressionConfig {
fn default() -> Self {
Self {
enabled: true,
compression_threshold: 256,
compression_level: 4,
compression_info: Default::default(),
}
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ pub use pvp::PVPConfig;
pub use rcon::RCONConfig;
mod commands;
mod compression;
pub mod compression;
mod pvp;
mod rcon;