mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add basic RC steam and user/pass authentication
This commit is contained in:
10
rc_static_data/Cargo.toml
Normal file
10
rc_static_data/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "rc_static_data"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
rocket.workspace = true
|
||||
libfj.workspace = true
|
||||
log.workspace = true
|
||||
env_logger.workspace = true
|
||||
12
rc_static_data/Rocket.toml
Normal file
12
rc_static_data/Rocket.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
## defaults for _all_ profiles
|
||||
[default]
|
||||
address = "127.0.0.1"
|
||||
port = 8010
|
||||
|
||||
## set only when compiled in debug mode, i.e, `cargo build`
|
||||
[debug]
|
||||
port = 80
|
||||
|
||||
## set only when compiled in release mode, i.e, `cargo build --release`
|
||||
[release]
|
||||
address = "0.0.0.0"
|
||||
3
rc_static_data/build_arm64.sh
Executable file
3
rc_static_data/build_arm64.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
cargo build --release --target aarch64-unknown-linux-musl
|
||||
3
rc_static_data/run_debug.sh
Executable file
3
rc_static_data/run_debug.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cargo build
|
||||
RUST_LOG=debug sudo -HE ../target/debug/rc_static_data
|
||||
14
rc_static_data/src/main.rs
Normal file
14
rc_static_data/src/main.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
mod robocraft;
|
||||
|
||||
#[rocket::get("/")]
|
||||
fn index() -> &'static str {
|
||||
"Hello, world!"
|
||||
}
|
||||
|
||||
#[rocket::launch]
|
||||
fn rocket() -> _ {
|
||||
env_logger::init();
|
||||
rocket::build().mount("/", rocket::routes![index])
|
||||
.attach(robocraft::stage())
|
||||
}
|
||||
|
||||
58
rc_static_data/src/robocraft/live_data.rs
Normal file
58
rc_static_data/src/robocraft/live_data.rs
Normal file
@@ -0,0 +1,58 @@
|
||||
use rocket::{get, routes, serde::json::Json};
|
||||
|
||||
#[get("/live/data.json")]
|
||||
pub fn static_live_data() -> Json<libfj::robocraft::StaticDataRaw> {
|
||||
Json(libfj::robocraft::StaticDataRaw {
|
||||
MaintenanceMode: "false".into(),
|
||||
MaintenanceRegex: "".into(),
|
||||
EacEnabled: "true".into(),
|
||||
MinimumVersion: "2855".into(),
|
||||
PhotonSocialServer: "rc-backend.servers.robocraftgame.com:4534".into(),
|
||||
PhotonServicesServer: "rc-backend.servers.robocraftgame.com:4532".into(),
|
||||
PhotonChatServer: "rc-backend.servers.robocraftgame.com:4530".into(),
|
||||
PhotonSinglePlayerServer: "rc-backend.servers.robocraftgame.com:4536".into(),
|
||||
GameplayServerServiceAddress: "rc-backend.servers.robocraftgame.com:4538".into(),
|
||||
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: "https://pay.robocraftgame.com/".into(),
|
||||
enterBattleLogGenerationTimeout: "60".into(),
|
||||
GameServerConnectionTestTimeout: 10,
|
||||
AvatarCdnUrl: "https://rc-cdn-images.robocraftgame.com/customavatar/Live/".into(),
|
||||
ClanAvatarCdnUrl: "https://rc-cdn-images.robocraftgame.com/clanavatar/Live/".into(),
|
||||
FeatureThrottlerOnPercent: "100".into(),
|
||||
EmailCaptureEnabled: "true".into(),
|
||||
UnreliableMessages: "true".into(),
|
||||
MessageQueueEnabled: "true".into(),
|
||||
BrawlDataUrl: "https://rc-cdn-images.robocraftgame.com/brawldata/Live/".into(),
|
||||
CampaignDataUrl: "https://rc-cdn-images.robocraftgame.com/campaigndata/Live/".into(),
|
||||
LeaderboardsUrl: "https://leaderboards.robocraftgame.com".into(),
|
||||
NetworkChannelTypes: "3113".into(),
|
||||
MaxSentMessageQueueSize: 64,
|
||||
IsAcksLong: 1,
|
||||
NetworkDropThreshold: 80,
|
||||
PacketSize: 1200,
|
||||
MaxPacketSize: 5888,
|
||||
MaxCombinedReliableMessageCount: 20,
|
||||
MaxCombinedReliableMessageSize: 200,
|
||||
MaxDelay: 1,
|
||||
OverflowThreshold: 10,
|
||||
MinUpdateTimeout: 1,
|
||||
DevMessageRefresh: 60,
|
||||
MaintenanceRefresh: 30,
|
||||
SaveRequestOnPhoton: "false".into(),
|
||||
UseS3System: "true".into(),
|
||||
authMigrationUrl: "http://88.150.159.132:3000/auth-migration".into(),
|
||||
xsollaEnabled: "true".into(),
|
||||
MaintenanceMessage: "Robocraft is currently undergoing server maintenance. ".into(),
|
||||
DevMessage: "NGnius says hello".into(),
|
||||
DevMessageDisplayTime: "10".into(),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn stage() -> rocket::fairing::AdHoc {
|
||||
rocket::fairing::AdHoc::on_ignite("Robocraft live data.json", |rocket| async {
|
||||
rocket.mount("/", routes![static_live_data])
|
||||
})
|
||||
}
|
||||
7
rc_static_data/src/robocraft/mod.rs
Normal file
7
rc_static_data/src/robocraft/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
mod live_data;
|
||||
|
||||
pub fn stage() -> rocket::fairing::AdHoc {
|
||||
rocket::fairing::AdHoc::on_ignite("JSON", |rocket| async {
|
||||
rocket.attach(live_data::stage())
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user