# USER=rustcargo target/debug/otter --config ~ian/Rustup/Game/server/server.toml --scope-server reset --reset-table ~ian/Rustup/Game/server/demo/test.table.toml dummy ~ian/Rustup/Game/server/demo/test.game.toml
+public_url = "http://localhost:8000"
+
save_directory = "/home/rustcargo/Rustup/Game/server"
template_dir = "/home/ian/Rustup/Game/server/templates"
bundled_sources = "/home/rustcargo/Rustup/Game/server/target/bundled-sources"
pub command_socket: Option<String>,
pub debug: Option<bool>,
pub http_port: Option<u16>,
+ pub public_url: String,
pub rocket_workers: Option<u16>,
pub template_dir: Option<String>,
pub wasm_dir: Option<String>,
pub command_socket: String,
pub debug: bool,
pub http_port: Option<u16>,
+ pub public_url: String,
pub rocket_workers: u16,
pub template_dir: String,
pub wasm_dir: String,
fn try_from(spec: ServerConfigSpec) -> ServerConfig {
let ServerConfigSpec {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir, wasm_dir,
+ http_port, public_url, rocket_workers, template_dir, wasm_dir,
log, bundled_sources, shapelibs,
} = spec;
ServerConfig {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir, wasm_dir,
+ http_port, public_url, rocket_workers, template_dir, wasm_dir,
log, bundled_sources, shapelibs,
}
}
let ipl = &self.c.g.iplayers.byid(player)?.ipl;
let gpl = self.c.g.gs.players.byid(player)?;
- let report = AccessTokenReport {
- url: format!("http://localhost:8000/{}", token.0), // xxx
- };
+ let url = format!("{}/{}",
+ &config().public_url.trim_start_matches("/"),
+ token.0);
+ let report = AccessTokenReport { url };
let report = access
.server_deliver(&gpl, &ipl, &report)?;
report.cloned()