forked from endernon/JadeSR-origin-DONOTUSE
Compare commits
No commits in common. "master" and "master" have entirely different histories.
11 changed files with 42 additions and 74 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,4 +2,5 @@ target/
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
proto/StarRail.proto
|
proto/StarRail.proto
|
||||||
proto/nameTranslation.txt
|
proto/nameTranslation.txt
|
||||||
./.idea/
|
/*.json
|
||||||
|
./.idea
|
|
@ -2,7 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/JadeSR-fork.iml" filepath="$PROJECT_DIR$/.idea/JadeSR-fork.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/JadeSR-WithInventory.iml" filepath="$PROJECT_DIR$/.idea/JadeSR-WithInventory.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
27
README.md
27
README.md
|
@ -1,8 +1,7 @@
|
||||||
# JadeSR
|
# JadeSR
|
||||||
(i want to protect this from search indexing please don't mention the animegame or company)
|
|
||||||
### A Server emulator for the game `Hon Aki: Railway Game`
|
A Server emulator for the game [`Honkai: Star Rail`](https://hsr.hoyoverse.com/en-us/)
|
||||||
### except, it's a fork with some more features. Namely...
|
![screenshot](https://git.xeondev.com/reversedrooms/JadeSR/raw/branch/master/screenshot.png)
|
||||||
1) RUNPS.bat (this builds the ps)
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -14,12 +13,6 @@
|
||||||
|
|
||||||
#### Building
|
#### Building
|
||||||
|
|
||||||
##### Using xtasks (use this if stupid)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cargo xtask run
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Manually
|
##### Manually
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -30,16 +23,22 @@ cargo build --bin dispatch
|
||||||
cargo build --bin sdkserver
|
cargo build --bin sdkserver
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Using xtasks (use this if stupid)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo xtask run
|
||||||
|
```
|
||||||
|
|
||||||
##### To run it with automatic recompilation when any Rust files are changed
|
##### To run it with automatic recompilation when any Rust files are changed
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo xtask watch
|
cargo xtask watch
|
||||||
```
|
```
|
||||||
|
|
||||||
### ~~From Pre-built Binaries~~
|
### From Pre-built Binaries
|
||||||
I haven't got prebuilt binaries. Build it yourself using above commands. Or, just use RUNPS.bat
|
|
||||||
~~Navigate to the [Releases](https://git.xeondev.com/reversedrooms/JadeSR/releases)
|
Navigate to the [Releases](https://git.xeondev.com/reversedrooms/JadeSR/releases)
|
||||||
page and download the latest release for your platform.~~
|
page and download the latest release for your platform.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
cargo xtask run
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"http_port": 21041,
|
|
||||||
"game_servers": {
|
|
||||||
"jade_sr": {
|
|
||||||
"name": "JadeSR",
|
|
||||||
"title": "JadeSR",
|
|
||||||
"dispatch_url": "http://127.0.0.1:21041/query_gateway/jade_sr",
|
|
||||||
"env_type": "2",
|
|
||||||
"gateserver_ip": "127.0.0.1",
|
|
||||||
"gateserver_port": 23301,
|
|
||||||
"gateserver_protocol": "Tcp"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"versions": {
|
|
||||||
"OSBETAWin2.2.51": {
|
|
||||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_7037158_b67f5a6a68fb",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -21,8 +21,8 @@ paste.workspace = true
|
||||||
rbase64.workspace = true
|
rbase64.workspace = true
|
||||||
sysinfo.workspace = true
|
sysinfo.workspace = true
|
||||||
|
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
tokio-util.workspace = true
|
tokio-util.workspace = true
|
||||||
|
|
|
@ -22,11 +22,7 @@ pub async fn on_start_cocoon_stage_cs_req(
|
||||||
.iter()
|
.iter()
|
||||||
.map(|avatar| BattleAvatar {
|
.map(|avatar| BattleAvatar {
|
||||||
index: avatar.slot,
|
index: avatar.slot,
|
||||||
id: if avatar.id == 8001 {
|
id: avatar.id,
|
||||||
player_info.hero_basic_type as u32
|
|
||||||
} else {
|
|
||||||
avatar.id
|
|
||||||
},
|
|
||||||
level: 80,
|
level: 80,
|
||||||
promotion: 6,
|
promotion: 6,
|
||||||
rank: 6,
|
rank: 6,
|
||||||
|
@ -91,4 +87,4 @@ pub async fn on_pve_battle_result_cs_req(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
|
@ -9,16 +9,25 @@ use std::fs;
|
||||||
use crate::{net::PlayerSession, util};
|
use crate::{net::PlayerSession, util};
|
||||||
|
|
||||||
pub async fn on_get_bag_cs_req(session: &PlayerSession, _: &GetBagCsReq) -> Result<()> {
|
pub async fn on_get_bag_cs_req(session: &PlayerSession, _: &GetBagCsReq) -> Result<()> {
|
||||||
let json_data = fs::read_to_string("inventory.json").expect("Failed to read inventory.json");
|
let json_data = fs::read_to_string("C:/Users/Al-Shebli/Downloads/HSR 2.3 beta/JadeSR-masters/jadesr/gameserver/src/net/handlers/inventory.json").expect("Failed to read inventory.json");
|
||||||
let json_value: Value = serde_json::from_str(&json_data).expect("Failed to parse JSON data");
|
let json_value: Value = serde_json::from_str(&json_data).expect("Failed to parse JSON data");
|
||||||
|
|
||||||
// Extract ranks
|
// Extract ranks
|
||||||
let r1: u32 = json_value[0]["rank"].as_i64().expect("Failed to get rank for Equipment1") as u32;
|
let r1: u32 = json_value[0]["rank"].as_i64().expect("Failed to get rank for Equipment1") as u32;
|
||||||
let r2: u32 = json_value[1]["rank"].as_i64().expect("Failed to get rank for Equipment2") as u32;
|
let r2: u32 = json_value[1]["rank"].as_i64().expect("Failed to get rank for Equipment2") as u32;
|
||||||
|
let r3: u32 = json_value[2]["rank"].as_i64().expect("Failed to get rank for Equipment2") as u32;
|
||||||
let t1: u32 = json_value[0]["tid"].as_i64().expect("Failed") as u32;
|
let t1: u32 = json_value[0]["tid"].as_i64().expect("Failed") as u32;
|
||||||
let t2: u32 = json_value[1]["tid"].as_i64().expect("Failed") as u32;
|
let t2: u32 = json_value[1]["tid"].as_i64().expect("Failed") as u32;
|
||||||
|
let t3: u32 = json_value[2]["tid"].as_i64().expect("Failed") as u32;
|
||||||
let l1: u32 = json_value[0]["level"].as_i64().expect("Failed") as u32;
|
let l1: u32 = json_value[0]["level"].as_i64().expect("Failed") as u32;
|
||||||
let l2: u32 = json_value[0]["level"].as_i64().expect("Failed") as u32;
|
let l2: u32 = json_value[1]["level"].as_i64().expect("Failed") as u32;
|
||||||
|
let l3: u32 = json_value[2]["level"].as_i64().expect("Failed") as u32;
|
||||||
|
let ip1: u32 = json_value[0]["is_protected"].as_i64().expect("Failed") as u32;
|
||||||
|
let ip2: u32 = json_value[1]["is_protected"].as_i64().expect("Failed") as u32;
|
||||||
|
let ip3: u32 = json_value[2]["is_protected"].as_i64().expect("Failed") as u32;
|
||||||
|
let p1: u32 = json_value[0]["promotion"].as_i64().expect("Failed") as u32;
|
||||||
|
let p2: u32 = json_value[1]["promotion"].as_i64().expect("Failed") as u32;
|
||||||
|
let p3: u32 = json_value[2]["promotion"].as_i64().expect("Failed") as u32;
|
||||||
//let e_rank3: u32 = json_value[2]["rank"].as_i64().expect("Failed to get rank for Equipment3") as u32;
|
//let e_rank3: u32 = json_value[2]["rank"].as_i64().expect("Failed to get rank for Equipment3") as u32;
|
||||||
session
|
session
|
||||||
.send(
|
.send(
|
||||||
|
@ -29,9 +38,9 @@ pub async fn on_get_bag_cs_req(session: &PlayerSession, _: &GetBagCsReq) -> Resu
|
||||||
lgjeabihdpn: vec![],
|
lgjeabihdpn: vec![],
|
||||||
retcode: 0,
|
retcode: 0,
|
||||||
equipment_list: vec![
|
equipment_list: vec![
|
||||||
Equipment {tid: t1, rank: r1, exp: 0, unique_id: 57, promotion: 6, level: l1, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: t1, rank: r1, exp: 0, unique_id: 57, promotion: p1, level: l1, base_avatar_id: 0, is_protected: ip1, ..Default::default()},
|
||||||
Equipment {tid: t2, rank: r2, exp: 0, unique_id: 58, promotion: 6, level: l2, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: t2, rank: r2, exp: 0, unique_id: 58, promotion: p2, level: l2, base_avatar_id: 0, is_protected: ip2, ..Default::default()},
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 59, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: t3, rank: r3, exp: 0, unique_id: 59, promotion: p3, level: l3, base_avatar_id: 0, is_protected: ip3, ..Default::default()},
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 60, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 60, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 61, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 61, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 62, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 62, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
||||||
|
@ -57,14 +66,14 @@ pub async fn on_get_bag_cs_req(session: &PlayerSession, _: &GetBagCsReq) -> Resu
|
||||||
gddpphikjae: vec![],
|
gddpphikjae: vec![],
|
||||||
macfjibhfad: vec![],
|
macfjibhfad: vec![],
|
||||||
clkjaanbfpp: vec![ 101 ],
|
clkjaanbfpp: vec![ 101 ],
|
||||||
// .iter()
|
// .iter()
|
||||||
// .map(|id| {
|
// .map(|id| {
|
||||||
// // {
|
// // {
|
||||||
// // tid: *id,
|
// // tid: *id,
|
||||||
// // num: 500
|
// // num: 500
|
||||||
// // }
|
// // }
|
||||||
// })
|
// })
|
||||||
// .collect(),
|
// .collect(),
|
||||||
biahmcppikj: vec![],
|
biahmcppikj: vec![],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
10
globals.json
10
globals.json
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"lineup": [1314],
|
|
||||||
"hero_gender": "GenderWoman",
|
|
||||||
"hero_basic_type": "GirlShaman",
|
|
||||||
"monster_wave_list":
|
|
||||||
[
|
|
||||||
[3013010, 3013010],
|
|
||||||
[3024020]
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"http_port": 21000,
|
|
||||||
"dispatch_endpoint": "http://127.0.0.1:21041"
|
|
||||||
}
|
|
Loading…
Reference in a new issue