diff --git a/Cargo.lock b/Cargo.lock index 27c95ca..00f77f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1954,6 +1954,7 @@ dependencies = [ name = "rc_static_data" version = "0.1.0" dependencies = [ + "clap", "env_logger", "libfj", "log", diff --git a/Cargo.toml b/Cargo.toml index f2ccc7c..c6545d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,15 @@ [package] name = "servers" +version.workspace = true +edition.workspace = true + +[workspace.package] version = "0.1.0" edition = "2021" +repository = "https://git.ngram.ca/OpenJam/servers" +license = "GPLv3" +authors = ["NGnius "] +readme = "README.md" [workspace] members = [ diff --git a/README.md b/README.md index a3b8d5f..991c68a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ In most cases, these means no data is collected or logged except some debug log Some personal identifiers are sent but only exist ephemerally. The exception is Robocraft servers, which store the minimum account info possible on disk. This includes a unique user identifier, username, vehicle data, and user configuration data. -The current PC's MAC address is also sent to the server (this is a Robocraft client """feature""", it is not recorded by any server). +The current PC's MAC address is also sent to the server (this is a Robocraft client feature, it is not recorded by any server). ## Development @@ -36,3 +36,10 @@ It is possible to remove the obfuscation from the Robocraft's `Assembly-CSharp.d If you can program or are learning Rust, pull requests are appreciated! If you can't and would prefer not to learn, reporting issues is also welcome. If you'd like to discuss, contact NGnius on Signal `rfc.1149` or email `ngniusness@gmail.com`. I'll make a Signal group chat if there's enough interest. + +# Acknowledgements + +A big thanks to the RC15 team for their work on deobfuscating Robocraft .NET assemblies and specifically to RandomScientist for hooking me up with a deobfuscated assembly. Without them, progress would have been too slow and frustrating. + +Thanks for the moral support from community members who reached out and the few IRL people who I went into unnecessary detail with. + diff --git a/assets/robocraft/servenvmulti.config b/assets/robocraft/servenvmulti.config index a60934c..e7aabca 100644 --- a/assets/robocraft/servenvmulti.config +++ b/assets/robocraft/servenvmulti.config @@ -1,5 +1,5 @@ - dev + ngram robocraft @@ -14,5 +14,18 @@ http://127.0.0.1:8001/ http://127.0.0.1:8010/live/data.json + + ws.services.rc.ngram.ca:4532 + :4533 + s.services.rc.ngram.ca:4534 + :4535 + c.services.rc.ngram.ca:4536 + :4537 + sp.services.rc.ngram.ca:4538 + :4539 + https://live-auth.rc.ngram.ca/ + https://static.rc.ngram.ca/live/data.json + https://pay.rc.ngram.ca/live/data.json + diff --git a/auth/Cargo.toml b/auth/Cargo.toml index fc224e3..d7f493f 100644 --- a/auth/Cargo.toml +++ b/auth/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "auth" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [features] steam = ["steamworks"] diff --git a/auth/src/main.rs b/auth/src/main.rs index d571141..27ccdf0 100644 --- a/auth/src/main.rs +++ b/auth/src/main.rs @@ -6,8 +6,13 @@ mod cardlife; mod robocraft; #[rocket::get("/")] -fn index() -> &'static str { - "Hello, world!" +fn index() -> String { + let name = env!("CARGO_PKG_NAME"); + let version = env!("CARGO_PKG_VERSION"); + let authors = env!("CARGO_PKG_AUTHORS"); + let license = env!("CARGO_PKG_LICENSE"); + let repo = env!("CARGO_PKG_REPOSITORY"); + format!("{} {} by [{}]\n{}\n{}", name, version, authors, license, repo) } #[rocket::launch] diff --git a/polariton_auth/Cargo.toml b/polariton_auth/Cargo.toml index e1a2974..ea446fb 100644 --- a/polariton_auth/Cargo.toml +++ b/polariton_auth/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "polariton_auth" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_chat/Cargo.toml b/rc_chat/Cargo.toml index d935953..26e274d 100644 --- a/rc_chat/Cargo.toml +++ b/rc_chat/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_chat" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_chat_room/Cargo.toml b/rc_chat_room/Cargo.toml index 6512a69..baa8114 100644 --- a/rc_chat_room/Cargo.toml +++ b/rc_chat_room/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_chat_room" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_core/Cargo.toml b/rc_core/Cargo.toml index 3e5a0b8..a70fe94 100644 --- a/rc_core/Cargo.toml +++ b/rc_core/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_core" -version = "0.1.0" -edition = "2024" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_microtransactions/Cargo.toml b/rc_microtransactions/Cargo.toml index 66cfaca..06d36b2 100644 --- a/rc_microtransactions/Cargo.toml +++ b/rc_microtransactions/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_microtransactions" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] rocket.workspace = true diff --git a/rc_microtransactions/src/main.rs b/rc_microtransactions/src/main.rs index 461238e..b854927 100644 --- a/rc_microtransactions/src/main.rs +++ b/rc_microtransactions/src/main.rs @@ -1,8 +1,13 @@ mod robocraft; #[rocket::get("/")] -fn index() -> &'static str { - "Hello, world!" +fn index() -> String { + let name = env!("CARGO_PKG_NAME"); + let version = env!("CARGO_PKG_VERSION"); + let authors = env!("CARGO_PKG_AUTHORS"); + let license = env!("CARGO_PKG_LICENSE"); + let repo = env!("CARGO_PKG_REPOSITORY"); + format!("{} {} by [{}]\n{}\n{}", name, version, authors, license, repo) } #[rocket::launch] diff --git a/rc_services/Cargo.toml b/rc_services/Cargo.toml index 5ba1b9a..ff276a5 100644 --- a/rc_services/Cargo.toml +++ b/rc_services/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_services" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_services_room/Cargo.toml b/rc_services_room/Cargo.toml index 321bbe8..ed7942f 100644 --- a/rc_services_room/Cargo.toml +++ b/rc_services_room/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_services_room" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_singleplayer/Cargo.toml b/rc_singleplayer/Cargo.toml index 7e41ab0..b6165ee 100644 --- a/rc_singleplayer/Cargo.toml +++ b/rc_singleplayer/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_singleplayer" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_singleplayer_room/Cargo.toml b/rc_singleplayer_room/Cargo.toml index 363c0c3..1eee753 100644 --- a/rc_singleplayer_room/Cargo.toml +++ b/rc_singleplayer_room/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_singleplayer_room" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_social/Cargo.toml b/rc_social/Cargo.toml index aed827b..fbbce08 100644 --- a/rc_social/Cargo.toml +++ b/rc_social/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_social" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_social_room/Cargo.toml b/rc_social_room/Cargo.toml index 743ac02..5118239 100644 --- a/rc_social_room/Cargo.toml +++ b/rc_social_room/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "rc_social_room" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] log.workspace = true diff --git a/rc_static_data/Cargo.toml b/rc_static_data/Cargo.toml index 1dc6473..ea72e78 100644 --- a/rc_static_data/Cargo.toml +++ b/rc_static_data/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "rc_static_data" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +readme.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true [dependencies] rocket.workspace = true libfj.workspace = true log.workspace = true env_logger.workspace = true +clap.workspace = true diff --git a/rc_static_data/src/cli.rs b/rc_static_data/src/cli.rs new file mode 100644 index 0000000..e8034cb --- /dev/null +++ b/rc_static_data/src/cli.rs @@ -0,0 +1,18 @@ +use clap::Parser; + +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +pub struct CliArgs { + /// URL of authentication web server + #[arg(long, default_value_t = {"http://127.0.0.1:8001/".to_string()})] + pub auth: String, + /// URL of microtransactions web server + #[arg(long, default_value_t = {"http://127.0.0.1:8011/".to_string()})] + pub pay: String, +} + +impl CliArgs { + pub fn get() -> Self { + Self::parse() + } +} diff --git a/rc_static_data/src/main.rs b/rc_static_data/src/main.rs index 461238e..af3dd14 100644 --- a/rc_static_data/src/main.rs +++ b/rc_static_data/src/main.rs @@ -1,14 +1,22 @@ mod robocraft; +mod cli; #[rocket::get("/")] -fn index() -> &'static str { - "Hello, world!" +fn index() -> String { + let name = env!("CARGO_PKG_NAME"); + let version = env!("CARGO_PKG_VERSION"); + let authors = env!("CARGO_PKG_AUTHORS"); + let license = env!("CARGO_PKG_LICENSE"); + let repo = env!("CARGO_PKG_REPOSITORY"); + format!("{} {} by [{}]\n{}\n{}", name, version, authors, license, repo) } #[rocket::launch] fn rocket() -> _ { env_logger::init(); + let args = cli::CliArgs::get(); rocket::build().mount("/", rocket::routes![index]) .attach(robocraft::stage()) + .manage(args) } diff --git a/rc_static_data/src/robocraft/live_data.rs b/rc_static_data/src/robocraft/live_data.rs index e25fdab..eccdd9c 100644 --- a/rc_static_data/src/robocraft/live_data.rs +++ b/rc_static_data/src/robocraft/live_data.rs @@ -1,7 +1,7 @@ -use rocket::{get, routes, serde::json::Json}; +use rocket::{get, routes, serde::json::Json, State}; #[get("/live/data.json")] -pub fn static_live_data() -> Json { +pub fn static_live_data(cli: &State) -> Json { Json(libfj::robocraft::StaticDataRaw { MaintenanceMode: "false".into(), MaintenanceRegex: "".into(), @@ -15,8 +15,8 @@ pub fn static_live_data() -> Json { PhotonLobbyServer: "rc-backend.servers.robocraftgame.com:4540".into(), ErrorLogAddress: "logs.freejamgames.com:4561".into(), ServerErrorLogAddress: "logs.freejamgames.com:4562".into(), - authUrl: "http://127.0.0.1:8001/".into(), // originally "https://auth-backend.freejamgames.com/" - paymentUrl: "http://127.0.0.1:8011/".into(), + authUrl: cli.auth.clone(), // originally "https://auth-backend.freejamgames.com/" + paymentUrl: cli.pay.clone(), enterBattleLogGenerationTimeout: "60".into(), GameServerConnectionTestTimeout: 10, AvatarCdnUrl: "https://rc-cdn-images.robocraftgame.com/customavatar/Live/".into(),