Bump supported game version

This commit is contained in:
Nobody 2022-12-16 01:58:37 +05:00
parent 6b2634a74e
commit 6d566ca425
3 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@ RustySamovar
=============================== ===============================
Custom server for YuanShen / Genshin Impact video game. Custom server for YuanShen / Genshin Impact video game.
Supported game versions: 1.4.5x - 3.1.5x (depends on protocol definitions provided and keys used) Supported game versions: 1.4.5x - 3.3.5x (depends on protocol definitions provided and keys used)
**Note**: Github repo is a mirror of the main repo located at [Invisible Internet Bublik](http://bublik.i2p). **Note**: Github repo is a mirror of the main repo located at [Invisible Internet Bublik](http://bublik.i2p).
In case Github mirror dies, use I2P to access the main site. In case Github mirror dies, use I2P to access the main site.

View File

@ -50,7 +50,7 @@ impl AuthManager {
rsp.secret_key_seed = seed; // TODO: temporary workaround! rsp.secret_key_seed = seed; // TODO: temporary workaround!
rsp.uid = uid; rsp.uid = uid;
if req.unk4 > 0 { // TODO: detect client version properly! if req.key_id > 0 { // TODO: detect client version properly!
// Versions 2.7.5x+ use different algorithm for key initialization // Versions 2.7.5x+ use different algorithm for key initialization
// TODO: as of now (2022-05-16) this algorithm here is more of a PoC, because we can't really sign the data // TODO: as of now (2022-05-16) this algorithm here is more of a PoC, because we can't really sign the data
@ -68,7 +68,7 @@ impl AuthManager {
// tool. While still possible, it's tiresome, and won't allow patched client to connect to official server without // tool. While still possible, it's tiresome, and won't allow patched client to connect to official server without
// switching back and forth between two versions of global-metadata.dat file. // switching back and forth between two versions of global-metadata.dat file.
let key_id = req.unk4 as u8; let key_id = req.key_id as u8;
let rsa_key_collection = mhycrypt::load_rsa_keys("RSAConfig", "keys"); let rsa_key_collection = mhycrypt::load_rsa_keys("RSAConfig", "keys");
let keys = match rsa_key_collection.get(&key_id) { let keys = match rsa_key_collection.get(&key_id) {
@ -78,7 +78,7 @@ impl AuthManager {
// Decrypt received client seed // Decrypt received client seed
let client_seed_encrypted = base64::decode(&req.unk3).unwrap(); let client_seed_encrypted = base64::decode(&req.client_rand_key).unwrap();
let mut dec_buf: Vec<u8> = vec![0; 256]; let mut dec_buf: Vec<u8> = vec![0; 256];
@ -107,8 +107,9 @@ impl AuthManager {
let mut signer = Signer::new(MessageDigest::sha256(), &keypair).unwrap(); let mut signer = Signer::new(MessageDigest::sha256(), &keypair).unwrap();
let signature = signer.sign_oneshot_to_vec(&seed_bytes).unwrap(); let signature = signer.sign_oneshot_to_vec(&seed_bytes).unwrap();
rsp.unk5 = base64::encode(&enc_buf); rsp.key_id = key_id as u32;
rsp.unk6 = base64::encode(&signature); rsp.server_rand_key = base64::encode(&enc_buf);
rsp.sign = base64::encode(&signature);
} }
self.conv_to_user.insert(conv, uid); self.conv_to_user.insert(conv, uid);

View File

@ -43,7 +43,7 @@ impl SceneSubsystem {
fn process_get_scene_area(&self, user_id: u32, metadata: &proto::PacketHead, req: &proto::GetSceneAreaReq, rsp: &mut proto::GetSceneAreaRsp) { fn process_get_scene_area(&self, user_id: u32, metadata: &proto::PacketHead, req: &proto::GetSceneAreaReq, rsp: &mut proto::GetSceneAreaRsp) {
rsp.scene_id = req.scene_id; rsp.scene_id = req.scene_id;
// TODO: hardcoded data! // TODO: hardcoded data!
rsp.area_id_list = (1..20).collect(); rsp.area_id_list = (1..35).collect();
rsp.city_info_list = vec![ rsp.city_info_list = vec![
build!(CityInfo { city_id: 1, level: 10,}), build!(CityInfo { city_id: 1, level: 10,}),
build!(CityInfo { city_id: 2, level: 10,}), build!(CityInfo { city_id: 2, level: 10,}),