aboutsummaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-03-01 21:55:16 +0100
committermetamuffin <metamuffin@disroot.org>2026-03-01 21:55:16 +0100
commit74ffa47147d2bb989057b4513075975c44c2bc42 (patch)
tree0a2242b25fefcf62f94ac6b712c9e937e3b8e35c /server/src/main.rs
parentd6acbd76a81bb97c1ff74a66a2af9b00713ca6d0 (diff)
downloadhurrycurry-74ffa47147d2bb989057b4513075975c44c2bc42.tar
hurrycurry-74ffa47147d2bb989057b4513075975c44c2bc42.tar.bz2
hurrycurry-74ffa47147d2bb989057b4513075975c44c2bc42.tar.zst
add serverdata packet with data fields that dont change across games; add motd and server name
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index cf133203..f1af7c54 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -68,10 +68,12 @@ pub(crate) struct Args {
#[arg(long)]
upnp: bool,
/// Server name
- #[cfg(any(feature = "register", feature = "mdns"))]
#[arg(long, short = 'N', default_value = "A Hurry Curry! Server")]
server_name: String,
- /// Uri for connecting remotely for registry submission
+ /// Message of the day
+ #[arg(long, short = 'M')]
+ motd: Option<String>,
+ /// URI for connecting remotely for registry submission
#[cfg(feature = "register")]
#[arg(long)]
register_uri: Option<String>,
@@ -140,6 +142,8 @@ async fn run(data_path: PathBuf, args: Args) -> anyhow::Result<()> {
inactivity_timeout: args.inactivity_timeout,
lobby: args.lobby,
data_path,
+ motd: args.motd,
+ name: args.server_name.clone(),
};
let mut state = Server::new(config, tx)?;
@@ -342,7 +346,7 @@ fn find_data_path() -> Result<PathBuf> {
#[cfg(test)]
mod test {
- use hurrycurry_data::build_data;
+ use hurrycurry_data::build_gamedata;
use hurrycurry_protocol::{Character, PacketS, PlayerClass, PlayerID};
use hurrycurry_server::{
ConnectionID,
@@ -376,7 +380,7 @@ mod test {
fn map_load() {
let mut s = server();
s.load(
- build_data(&s.config.data_path, "junior", false).unwrap(),
+ build_gamedata(&s.config.data_path, "junior", false).unwrap(),
None,
);
}
@@ -384,7 +388,7 @@ mod test {
fn map_load_book() {
let mut s = server();
s.load(
- build_data(&s.config.data_path, "junior", true).unwrap(),
+ build_gamedata(&s.config.data_path, "junior", true).unwrap(),
None,
);
}