aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/data/index.rs17
-rw-r--r--server/src/entity/tutorial.rs17
-rw-r--r--server/src/register.rs54
3 files changed, 66 insertions, 22 deletions
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 <https://www.gnu.org/licenses/>.
+
+*/
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 <https://www.gnu.org/licenses/>.
+
+*/
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 <https://www.gnu.org/licenses/>.
+
+*/
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(())
}