From 41c95fc5b6b1c8bc4b944d889414a4197a23837b Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 21 Sep 2024 12:48:36 +0200 Subject: reg: connection test --- server/src/data/index.rs | 17 ++++++++++++++ server/src/entity/tutorial.rs | 17 ++++++++++++++ server/src/register.rs | 54 +++++++++++++++++++++++++------------------ 3 files changed, 66 insertions(+), 22 deletions(-) (limited to 'server/src') diff --git a/server/src/data/index.rs b/server/src/data/index.rs index e056cfc0..650a70d6 100644 --- a/server/src/data/index.rs +++ b/server/src/data/index.rs @@ -1,3 +1,20 @@ +/* + Hurry Curry! - a game about cooking + Copyright 2024 metamuffin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, version 3 of the License only. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +*/ use hurrycurry_protocol::{Gamedata, ItemIndex, Recipe, RecipeIndex}; use std::collections::HashMap; diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs index 66533119..b1503004 100644 --- a/server/src/entity/tutorial.rs +++ b/server/src/entity/tutorial.rs @@ -1,3 +1,20 @@ +/* + Hurry Curry! - a game about cooking + Copyright 2024 metamuffin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, version 3 of the License only. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +*/ use super::{Entity, EntityContext}; use crate::{trm, TrError}; use anyhow::Result; diff --git a/server/src/register.rs b/server/src/register.rs index 2aaec770..b26768a2 100644 --- a/server/src/register.rs +++ b/server/src/register.rs @@ -1,5 +1,22 @@ +/* + Hurry Curry! - a game about cooking + Copyright 2024 metamuffin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, version 3 of the License only. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +*/ use crate::server::Server; -use anyhow::{bail, Context, Result}; +use anyhow::{bail, Result}; use hurrycurry_protocol::{registry::Submission, VERSION}; use log::{info, warn}; use rand::random; @@ -63,32 +80,25 @@ impl Register { } pub async fn register(&self) -> Result<()> { + info!("register update"); if let Some(uri) = &self.register_uri { self.register_with("uri", &self.inet_client, uri.to_owned()) .await?; } else { - let x = tokio::join!( - async { - self.register_with( - "ip4", - &self.ip4_client, - format!("ws://0.0.0.0:{}", self.port), - ) - .await - .context("ipv4") - }, - async { - self.register_with( - "ip6", - &self.ip6_client, - format!("ws://0.0.0.0:{}", self.port), - ) - .await - .context("ipv6") - } + let (v4, v6) = tokio::join!( + self.register_with( + "ip4", + &self.ip4_client, + format!("ws://0.0.0.0:{}", self.port), + ), + self.register_with( + "ip6", + &self.ip6_client, + format!("ws://0.0.0.0:{}", self.port), + ) ); - x.0?; - x.1?; + info!("v4: {v4:?}"); + info!("v6: {v6:?}"); } Ok(()) } -- cgit v1.2.3-70-g09d2