Compare commits

...

5 commits

Author SHA1 Message Date
Anonymous Proxy
a3e0be4117 Update Client, Proxy, Build Prerequisities links 2024-05-23 00:43:27 +08:00
Miyabi
26c0111a10 Update README (WIP) 2024-05-22 22:13:37 +08:00
Miyabi
5cf7c4f6f7 bugfix & command help 2024-05-22 19:18:22 +08:00
Soldier 11
26b54248a6 2.2.53 hotfix url 2024-05-22 17:20:53 +08:00
Soldier 11
04b9d60ab4 Disable password check 2024-05-22 17:17:14 +08:00
7 changed files with 55 additions and 8 deletions

View file

@ -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
@ -62,7 +64,22 @@ 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 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)
file in your game folder, it will redirect game traffic (and disable in-game censorship)

View file

@ -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"
}
}
}
}

View file

@ -13,7 +13,16 @@ macro_rules! commands {
let input = command[1..].split(" ").collect::<Vec<&str>>();
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..];

View file

@ -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 {

View file

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

View file

@ -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! {

View file

@ -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<String> = 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");
}