Compare commits

..

No commits in common. "a3e0be411752161953be0427675474a73b4df774" and "87bb318d6339340e2cafc0f66a5b51e85c0d547d" have entirely different histories.

7 changed files with 8 additions and 55 deletions

View file

@ -14,8 +14,6 @@ A Server emulator for the game [`Honkai: Star Rail`](https://hsr.hoyoverse.com/e
#### Requirements #### Requirements
- [Rust](https://www.rust-lang.org/tools/install) - [Rust](https://www.rust-lang.org/tools/install)
- [MongoDB](https://www.mongodb.com/try/download/community-edition)
- [Protobuf Compiler (protoc)](https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-win64.zip). You should manually extract it to somewhere and add `bin` subfolder to the system environment variable `PATH`.
#### Building #### Building
@ -64,22 +62,7 @@ edit sdkserver.json and gameserver.json files.
## Connecting ## Connecting
### For the latest 2.3 Beta patch [Get 2.3 beta client](https://autopatchos.starrails.com/client/Beta/20240501125700_dUBAjS7YiX9nF7mJ/StarRail_2.2.51.zip),
If you want to play the latest Beta patch, the `mhypbase.dll` patch for 2.2.51 OS is not usable. You should use a separate proxy like [FireflySR.Tool.Proxy](https://git.xeondev.com/YYHEggEgg/FireflySR.Tool.Proxy) (Prebuilt binary can be downloaded [here](https://git.xeondev.com/YYHEggEgg/FireflySR.Tool.Proxy/releases)).
Also, you need to configure `disable_password_check` in `sdkserver.json`. That is to say, if you have used a older version, you should go to the configuration file **in the root directory** and check if it's `true`.
Clients (2.3 Beta v3):
- [CN - 2.2.53](https://autopatchcn.bhsr.com/client/beta/20240517110535_d7lJoh4jYXkVGXI1/StarRail_2.2.53.zip)
- [OS - .2.53](https://autopatchos.starrails.com/client/Beta/20240517111205_PZfNSHVLH509e76v/StarRail_.2.53.zip)
Notice: **CN Package may not have languages other than Chinese, and vice versa**. Be careful when choosing which to download; luckily they are all compatiable with this server.
### For v1 Players
[Get 2.3 beta client v1(.51)](https://autopatchos.starrails.com/client/Beta/20240501125700_dUBAjS7YiX9nF7mJ/StarRail_2.2.51.zip),
replace [mhypbase.dll](https://git.xeondev.com/reversedrooms/FireflySR/raw/branch/master/mhypbase.dll) replace [mhypbase.dll](https://git.xeondev.com/reversedrooms/FireflySR/raw/branch/master/mhypbase.dll)
file in your game folder, it will redirect game traffic (and disable in-game censorship) file in your game folder, it will redirect game traffic (and disable in-game censorship)

View file

@ -17,18 +17,6 @@
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_7033392_aaca9c1b456b", "ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_7033392_aaca9c1b456b",
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_7050564_f05a0f949b10", "lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_7050564_f05a0f949b10",
"lua_version": "7050564" "lua_version": "7050564"
},
"CNBETAWin2.2.53": {
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_7128256_5f77b249238a",
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_7134377_b1f36fb2d9b8",
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_7120090_469169697c23",
"lua_version": "7120090"
},
"OSBETAWin2.2.53": {
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_7128256_5f77b249238a",
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_7134377_b1f36fb2d9b8",
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_7120090_469169697c23",
"lua_version": "7120090"
} }
} }
} }

View file

@ -13,16 +13,7 @@ macro_rules! commands {
let input = command[1..].split(" ").collect::<Vec<&str>>(); let input = command[1..].split(" ").collect::<Vec<&str>>();
let (Some(category), Some(action)) = (input.get(0), input.get(1)) else { let (Some(category), Some(action)) = (input.get(0), input.get(1)) else {
let mut help_text = "Available Commands: ".to_string(); return send_text(session, "Usage: /[category] [action] [arg1] [arg2] ...").await;
$(
help_text.push_str(stringify!($category));
help_text.push_str(" ");
help_text.push_str(stringify!($action));
help_text.push_str("; ");
)*
let _ = send_text(session, &help_text).await;
let _ = send_text(session, "Usage: /[category] [action] [arg1] [arg2] ...").await;
return send_text(session, "Type /[category] [action] to get more detailed help.").await;
}; };
let args = &input[2..]; let args = &input[2..];

View file

@ -1,4 +1,3 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlayerBasicCompBin { pub struct PlayerBasicCompBin {

View file

@ -1,7 +1,6 @@
{ {
"http_port": 21000, "http_port": 21000,
"dispatch_endpoint": "http://127.0.0.1:21041", "dispatch_endpoint": "http://127.0.0.1:21041",
"disable_password_check": true,
"database": { "database": {
"connection_string": "mongodb://127.0.0.1:27017", "connection_string": "mongodb://127.0.0.1:27017",
"name": "FireflySR", "name": "FireflySR",

View file

@ -14,7 +14,6 @@ pub struct SDKServerConfiguration {
pub http_port: u16, pub http_port: u16,
pub dispatch_endpoint: String, pub dispatch_endpoint: String,
pub database: DatabaseConfig, pub database: DatabaseConfig,
pub disable_password_check: bool,
} }
lazy_static! { lazy_static! {

View file

@ -3,7 +3,7 @@ use common::document::AccountDocument;
use serde::Deserialize; use serde::Deserialize;
use serde_json::json; use serde_json::json;
use crate::{config::CONFIGURATION, database, util, SdkContext}; use crate::{database, util, SdkContext};
const LOGIN: &str = "/:product_name/mdk/shield/api/login"; const LOGIN: &str = "/:product_name/mdk/shield/api/login";
const VERIFY: &str = "/:product_name/mdk/shield/api/verify"; const VERIFY: &str = "/:product_name/mdk/shield/api/verify";
@ -38,15 +38,9 @@ async fn login(
); );
} }
let mut password_opt: Option<String> = None; let Ok(password) = util::decrypt_string(&request.password) else {
if !CONFIGURATION.disable_password_check return fail_json(-10, "Your patch is outdated.\r\nGet new one at https://discord.gg/reversedrooms\r\n(Password decryption failed)");
{ };
if let Ok(password) = util::decrypt_string(&request.password) {
password_opt = Some(password);
} else {
return fail_json(-10, "Your patch is outdated.\r\nGet new one at https://discord.gg/reversedrooms\r\n(Password decryption failed)");
};
}
let account = match database::get_account_by_name(&context.db_client, &request.account).await { let account = match database::get_account_by_name(&context.db_client, &request.account).await {
Ok(Some(account)) => account, Ok(Some(account)) => account,
@ -54,7 +48,7 @@ async fn login(
Err(_) => return fail_json(-1, "Internal server error"), Err(_) => return fail_json(-1, "Internal server error"),
}; };
if !CONFIGURATION.disable_password_check && util::verify_password(&password_opt.unwrap(), &account.account_password).is_err() { if util::verify_password(&password, &account.account_password).is_err() {
return fail_json(-101, "Account or password error"); return fail_json(-101, "Account or password error");
} }