From 64cb1207fac4a86bebae1ea1cd64547fa7a5b22b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 27 Apr 2021 17:02:09 -0700 Subject: feature: New configuration file format --- src/server/cmd/commands/property/create.rs | 8 ++++---- src/server/cmd/commands/room/create.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/cmd') diff --git a/src/server/cmd/commands/property/create.rs b/src/server/cmd/commands/property/create.rs index 8521a8e..948f434 100644 --- a/src/server/cmd/commands/property/create.rs +++ b/src/server/cmd/commands/property/create.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::{ - config::get_config, + config::Config, server::{ cmd::constants::{PROPUPD, SESSINIT}, net::{ @@ -57,7 +57,7 @@ pub fn create_property_update_as_distributor() -> Vec { }, NetworkProperty { prop_id: VAR_APPNAME, - value: get_config().unwrap().worldsmaster_username, + value: Config::get().unwrap().whirlsplash.worldsmaster_username, }, ], ) @@ -98,7 +98,7 @@ pub fn create_property_update_as_hub() -> Vec { }, NetworkProperty { prop_id: VAR_APPNAME, - value: get_config().unwrap().worldsmaster_username, + value: Config::get().unwrap().whirlsplash.worldsmaster_username, }, ], ) @@ -115,7 +115,7 @@ pub fn create_property_request_as_distributor() -> Vec { }, NetworkProperty { prop_id: VAR_APPNAME, - value: get_config().unwrap().worldsmaster_username, + value: Config::get().unwrap().whirlsplash.worldsmaster_username, }, NetworkProperty { prop_id: VAR_PROTOCOL, diff --git a/src/server/cmd/commands/room/create.rs b/src/server/cmd/commands/room/create.rs index a195936..598d39b 100644 --- a/src/server/cmd/commands/room/create.rs +++ b/src/server/cmd/commands/room/create.rs @@ -3,7 +3,7 @@ use bytes::{BufMut, BytesMut}; -use crate::{config::get_config, server::cmd::constants::REDIRID}; +use crate::{config::Config, server::cmd::constants::REDIRID}; pub fn create_room_id_request(room: &str, room_id: u8) -> Vec { let mut command = BytesMut::new(); @@ -23,7 +23,7 @@ pub fn create_room_id_request(room: &str, room_id: u8) -> Vec { for byte in "0.0.0.0".split('.') { command.put_u8(byte.parse::().unwrap()); } - command.put_u16(get_config().unwrap().hub_port as u16); // Port + command.put_u16(Config::get().unwrap().hub.port as u16); // Port // Length let mut command_as_vec = command.to_vec(); -- cgit v1.2.3