mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Improve net security against snooping, make configurable
This commit is contained in:
@@ -637,4 +637,8 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
defederated: self.federation.defederated.clone(),
|
||||
})
|
||||
}
|
||||
|
||||
fn polariton_operation_modifier(&self) -> crate::OpModImpl {
|
||||
crate::OpModImpl::new(self.settings.polariton.clone())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn redacted_json(&self) -> String;
|
||||
/// None when federation is not enabled
|
||||
fn federation(&self) -> Option<Federation>;
|
||||
fn polariton_operation_modifier(&self) -> crate::OpModImpl;
|
||||
}
|
||||
|
||||
pub struct DevMessageProvider<C: Clone> {
|
||||
|
||||
@@ -28,6 +28,7 @@ pub use client_config::{GameplaySettings, PlatformSettings};
|
||||
|
||||
mod settings;
|
||||
pub use settings::{Settings, QueueMode};
|
||||
pub(crate) use settings::PolaritonSettings;
|
||||
|
||||
mod chat;
|
||||
pub use chat::{ChatConfig, ChatCommand, ChatOperation, BuiltInChatOperation, IntercomChatOperation, ChatPermission, SystemChatOperation};
|
||||
|
||||
@@ -10,6 +10,10 @@ pub struct Settings {
|
||||
pub garage_upgrades: Vec<GarageSlotUpgrade>,
|
||||
#[serde(default = "default_server_conf")]
|
||||
pub server: ServerSettings,
|
||||
#[serde(default = "default_pun_conf", alias = "photon")]
|
||||
pub polariton: PolaritonSettings,
|
||||
#[serde(default = "default_lnl_conf", alias = "lnl")]
|
||||
pub lrl: LiteRustLibSettings,
|
||||
}
|
||||
|
||||
impl super::config::SelfValidator for Settings {
|
||||
@@ -27,6 +31,8 @@ impl super::config::RedactedClone for Settings {
|
||||
banners: self.banners.clone(),
|
||||
garage_upgrades: self.garage_upgrades.clone(),
|
||||
server: self.server.redacted_clone(),
|
||||
polariton: self.polariton.clone(),
|
||||
lrl: self.lrl.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,3 +220,29 @@ fn default_game_version() -> u32 {
|
||||
fn default_true() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct PolaritonSettings {
|
||||
#[serde(default = "default_true")]
|
||||
pub force_encrypt_responses: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub add_unique_response_param: bool,
|
||||
}
|
||||
|
||||
fn default_pun_conf() -> PolaritonSettings {
|
||||
PolaritonSettings {
|
||||
force_encrypt_responses: true,
|
||||
add_unique_response_param: true,
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||
pub struct LiteRustLibSettings {
|
||||
|
||||
}
|
||||
|
||||
fn default_lnl_conf() -> LiteRustLibSettings {
|
||||
LiteRustLibSettings {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user