From 04b9d60ab42e27b526e1e2553dfa104282e6917f Mon Sep 17 00:00:00 2001 From: Soldier 11 <53960525+YYHEggEgg@users.noreply.github.com> Date: Wed, 22 May 2024 17:17:14 +0800 Subject: [PATCH 1/5] Disable password check --- proto/out/bin.rs | 1 + sdkserver/sdkserver.json | 1 + sdkserver/src/config.rs | 1 + sdkserver/src/services/mdk_shield.rs | 16 +++++++++++----- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/proto/out/bin.rs b/proto/out/bin.rs index 5a0f9a1..73bc372 100644 --- a/proto/out/bin.rs +++ b/proto/out/bin.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PlayerBasicCompBin { diff --git a/sdkserver/sdkserver.json b/sdkserver/sdkserver.json index c2f10df..9adef00 100644 --- a/sdkserver/sdkserver.json +++ b/sdkserver/sdkserver.json @@ -1,6 +1,7 @@ { "http_port": 21000, "dispatch_endpoint": "http://127.0.0.1:21041", + "disable_password_check": false, "database": { "connection_string": "mongodb://127.0.0.1:27017", "name": "FireflySR", diff --git a/sdkserver/src/config.rs b/sdkserver/src/config.rs index 4440fd2..6ea7a28 100644 --- a/sdkserver/src/config.rs +++ b/sdkserver/src/config.rs @@ -14,6 +14,7 @@ pub struct SDKServerConfiguration { pub http_port: u16, pub dispatch_endpoint: String, pub database: DatabaseConfig, + pub disable_password_check: bool, } lazy_static! { diff --git a/sdkserver/src/services/mdk_shield.rs b/sdkserver/src/services/mdk_shield.rs index 44a4538..16e9655 100644 --- a/sdkserver/src/services/mdk_shield.rs +++ b/sdkserver/src/services/mdk_shield.rs @@ -3,7 +3,7 @@ use common::document::AccountDocument; use serde::Deserialize; use serde_json::json; -use crate::{database, util, SdkContext}; +use crate::{config::CONFIGURATION, database, util, SdkContext}; const LOGIN: &str = "/:product_name/mdk/shield/api/login"; const VERIFY: &str = "/:product_name/mdk/shield/api/verify"; @@ -38,9 +38,15 @@ async fn login( ); } - let Ok(password) = util::decrypt_string(&request.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 mut password_opt: Option = None; + if !CONFIGURATION.disable_password_check + { + 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 { Ok(Some(account)) => account, @@ -48,7 +54,7 @@ async fn login( Err(_) => return fail_json(-1, "Internal server error"), }; - if util::verify_password(&password, &account.account_password).is_err() { + if CONFIGURATION.disable_password_check || util::verify_password(&password_opt.unwrap(), &account.account_password).is_err() { return fail_json(-101, "Account or password error"); } -- 2.34.1 From 26b54248a616422a8365369f5bb70a6b1d91a777 Mon Sep 17 00:00:00 2001 From: Soldier 11 <53960525+YYHEggEgg@users.noreply.github.com> Date: Wed, 22 May 2024 17:20:53 +0800 Subject: [PATCH 2/5] 2.2.53 hotfix url --- dispatch/dispatch.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dispatch/dispatch.json b/dispatch/dispatch.json index e0c7de4..6829378 100644 --- a/dispatch/dispatch.json +++ b/dispatch/dispatch.json @@ -17,6 +17,18 @@ "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_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" } } -} +} \ No newline at end of file -- 2.34.1 From 5cf7c4f6f728b80216e105bb094e1f0163734b78 Mon Sep 17 00:00:00 2001 From: Miyabi <53960525+YYHEggEgg@users.noreply.github.com> Date: Wed, 22 May 2024 19:18:22 +0800 Subject: [PATCH 3/5] bugfix & command help --- gameserver/src/game/commands/mod.rs | 11 ++++++++++- sdkserver/sdkserver.json | 2 +- sdkserver/src/services/mdk_shield.rs | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gameserver/src/game/commands/mod.rs b/gameserver/src/game/commands/mod.rs index b251193..5d3bfff 100644 --- a/gameserver/src/game/commands/mod.rs +++ b/gameserver/src/game/commands/mod.rs @@ -13,7 +13,16 @@ macro_rules! commands { let input = command[1..].split(" ").collect::>(); let (Some(category), Some(action)) = (input.get(0), input.get(1)) else { - return send_text(session, "Usage: /[category] [action] [arg1] [arg2] ...").await; + let mut help_text = "Available Commands: ".to_string(); + $( + 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..]; diff --git a/sdkserver/sdkserver.json b/sdkserver/sdkserver.json index 9adef00..ba931d2 100644 --- a/sdkserver/sdkserver.json +++ b/sdkserver/sdkserver.json @@ -1,7 +1,7 @@ { "http_port": 21000, "dispatch_endpoint": "http://127.0.0.1:21041", - "disable_password_check": false, + "disable_password_check": true, "database": { "connection_string": "mongodb://127.0.0.1:27017", "name": "FireflySR", diff --git a/sdkserver/src/services/mdk_shield.rs b/sdkserver/src/services/mdk_shield.rs index 16e9655..b9657b2 100644 --- a/sdkserver/src/services/mdk_shield.rs +++ b/sdkserver/src/services/mdk_shield.rs @@ -54,7 +54,7 @@ async fn login( 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 !CONFIGURATION.disable_password_check && util::verify_password(&password_opt.unwrap(), &account.account_password).is_err() { return fail_json(-101, "Account or password error"); } -- 2.34.1 From 26c0111a109fca36c38ce2af104114b462338be3 Mon Sep 17 00:00:00 2001 From: Miyabi <53960525+YYHEggEgg@users.noreply.github.com> Date: Wed, 22 May 2024 22:13:37 +0800 Subject: [PATCH 4/5] Update README (WIP) --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f4bfa0..a85dc32 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,20 @@ edit sdkserver.json and gameserver.json files. ## Connecting -[Get 2.3 beta client](https://autopatchos.starrails.com/client/Beta/20240501125700_dUBAjS7YiX9nF7mJ/StarRail_2.2.51.zip), +### For the latest 2.3 Beta patch + +If you want to play the latest Beta patch, the `mhypbase.dll` patch is not usable. You should use a separate proxy like this: [FireflySR.Tool.Proxy](https://git.xeondev.com/YYHEggEgg/FireflySR.Tool.Proxy). + +Also, you need to configure `disable_password_check` in `sdkserver.json`. Check if it's `true`. + +Clients: + +- +- + +### 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) file in your game folder, it will redirect game traffic (and disable in-game censorship) -- 2.34.1 From a3e0be411752161953be0427675474a73b4df774 Mon Sep 17 00:00:00 2001 From: Anonymous Proxy <53960525+YYHEggEgg@users.noreply.github.com> Date: Thu, 23 May 2024 00:43:27 +0800 Subject: [PATCH 5/5] Update Client, Proxy, Build Prerequisities links --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a85dc32..915dc9d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ A Server emulator for the game [`Honkai: Star Rail`](https://hsr.hoyoverse.com/e #### Requirements - [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 @@ -64,14 +66,16 @@ edit sdkserver.json and gameserver.json files. ### For the latest 2.3 Beta patch -If you want to play the latest Beta patch, the `mhypbase.dll` patch is not usable. You should use a separate proxy like this: [FireflySR.Tool.Proxy](https://git.xeondev.com/YYHEggEgg/FireflySR.Tool.Proxy). +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`. Check if it's `true`. +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: +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 -- 2.34.1