2025-03-17 16:58:48 -04:00
|
|
|
//! A server replacement for a certain MMO.
|
|
|
|
|
2025-03-23 18:14:14 -04:00
|
|
|
#![allow(clippy::large_enum_variant)]
|
|
|
|
|
2025-03-23 08:21:43 -04:00
|
|
|
use std::collections::HashMap;
|
|
|
|
|
2024-05-11 13:58:58 -04:00
|
|
|
use minijinja::Environment;
|
2025-03-23 08:21:43 -04:00
|
|
|
use patch::Version;
|
2024-05-11 13:50:05 -04:00
|
|
|
|
2025-03-16 15:42:46 -04:00
|
|
|
/// The blowfish implementation used for packet encryption.
|
2025-03-11 18:39:30 -04:00
|
|
|
pub mod blowfish;
|
2025-03-16 15:42:46 -04:00
|
|
|
|
|
|
|
/// Common functions, structures used between all servers.
|
2025-03-16 15:39:44 -04:00
|
|
|
pub mod common;
|
2025-03-16 15:42:46 -04:00
|
|
|
|
|
|
|
/// Config management.
|
2024-05-11 13:50:05 -04:00
|
|
|
pub mod config;
|
2025-03-17 16:44:17 -04:00
|
|
|
|
|
|
|
/// Bindings for Oodle network compression.
|
2025-03-10 21:31:21 -04:00
|
|
|
pub mod oodle;
|
2025-03-16 15:42:46 -04:00
|
|
|
|
|
|
|
/// Lobby server-specific code.
|
|
|
|
pub mod lobby;
|
|
|
|
|
|
|
|
/// World server-specific code.
|
2025-03-12 17:47:58 -04:00
|
|
|
pub mod world;
|
2024-05-11 13:50:05 -04:00
|
|
|
|
2025-03-16 17:43:29 -04:00
|
|
|
/// Everything packet parsing related.
|
|
|
|
pub mod packet;
|
|
|
|
|
2025-03-22 16:15:29 -04:00
|
|
|
/// Logic server-specific code.
|
|
|
|
pub mod login;
|
|
|
|
|
2025-03-23 08:21:43 -04:00
|
|
|
/// Patch server-specific code.
|
|
|
|
pub mod patch;
|
|
|
|
|
2025-03-23 08:33:07 -04:00
|
|
|
/// Used in the encryption key.
|
|
|
|
const GAME_VERSION: u16 = 7000;
|
|
|
|
|
2025-03-23 08:21:43 -04:00
|
|
|
/// Supported boot version.
|
|
|
|
pub const SUPPORTED_BOOT_VERSION: Version = Version("2025.01.10.0000.0001");
|
|
|
|
|
|
|
|
/// Supported game version.
|
2025-03-25 16:45:47 -04:00
|
|
|
pub const SUPPORTED_GAME_VERSION: Version = Version("2025.03.18.0000.0000");
|
2025-03-23 08:21:43 -04:00
|
|
|
|
|
|
|
const SUPPORTED_EXPAC_VERSIONS: [(&str, Version); 5] = [
|
2025-03-25 16:45:47 -04:00
|
|
|
("ex1", Version("2025.03.14.0000.0000")),
|
|
|
|
("ex2", Version("2025.03.18.0000.0000")),
|
|
|
|
("ex3", Version("2025.03.18.0000.0000")),
|
|
|
|
("ex4", Version("2025.03.18.0000.0000")),
|
|
|
|
("ex5", Version("2025.03.18.0000.0000")),
|
2025-03-23 08:21:43 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
/// Supported expansion versions.
|
|
|
|
pub fn get_supported_expac_versions() -> HashMap<&'static str, Version<'static>> {
|
|
|
|
HashMap::from(SUPPORTED_EXPAC_VERSIONS)
|
|
|
|
}
|
|
|
|
|
2024-05-11 13:58:58 -04:00
|
|
|
pub fn setup_default_environment() -> Environment<'static> {
|
|
|
|
let mut env = Environment::new();
|
2025-03-08 13:27:41 -05:00
|
|
|
env.add_template("admin.html", include_str!("../templates/admin.html"))
|
|
|
|
.unwrap();
|
|
|
|
env.add_template("web.html", include_str!("../templates/web.html"))
|
|
|
|
.unwrap();
|
|
|
|
env.add_template("login.html", include_str!("../templates/login.html"))
|
|
|
|
.unwrap();
|
|
|
|
env.add_template("register.html", include_str!("../templates/register.html"))
|
|
|
|
.unwrap();
|
|
|
|
env.add_template(
|
|
|
|
"worldstatus.html",
|
|
|
|
include_str!("../templates/worldstatus.html"),
|
|
|
|
)
|
|
|
|
.unwrap();
|
2024-05-11 13:58:58 -04:00
|
|
|
|
|
|
|
env
|
2025-03-08 13:27:41 -05:00
|
|
|
}
|