feat: Add support for 4.0.5x

This commit is contained in:
amizing25
2026-02-25 13:25:25 +07:00
parent 9d856e76c8
commit b34e7af824
13 changed files with 95848 additions and 52907 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
target/ target/
Cargo.lock Cargo.lock
proto/StarRail.proto
/prebuild /prebuild
/assets /assets
.vscode .vscode
.prebuilt
+4658 -3992
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,13 +1,13 @@
use super::*; use super::*;
pub static BASE_AVATAR_IDS: [u32; 78] = [ pub static BASE_AVATAR_IDS: [u32; 79] = [
8001, 1001, // 8001, 1001, //
// //
1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,
1109, 1110, 1111, 1112, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1109, 1110, 1111, 1112, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
1213, 1214, 1215, 1217, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1312, 1315, 1310, 1213, 1214, 1215, 1217, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1312, 1315, 1310,
1314, 1218, 1221, 1220, 1222, 1223, 1317, 1313, 1225, 1402, 1401, 1404, 1403, 1405, 1407, 1406, 1314, 1218, 1221, 1220, 1222, 1223, 1317, 1313, 1225, 1402, 1401, 1404, 1403, 1405, 1407, 1406,
1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321, 1501, 1502, 1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321, 1501, 1502, 1504,
]; ];
pub async fn on_get_avatar_data_cs_req( pub async fn on_get_avatar_data_cs_req(
+3 -3
View File
@@ -22,10 +22,10 @@ pub async fn on_start_cocoon_stage_cs_req(
res.battle_info = Some(battle_info); res.battle_info = Some(battle_info);
} }
pub async fn on_start_quick_cocoon_stage_cs_req( pub async fn on_quick_start_cocoon_stage_cs_req(
session: &mut PlayerSession, session: &mut PlayerSession,
req: &StartQuickCocoonStageCsReq, req: &QuickStartCocoonStageCsReq,
res: &mut StartQuickCocoonStageScRsp, res: &mut QuickStartCocoonStageScRsp,
) { ) {
let mut battle_info = create_battle_info(session, 0, 0).await; let mut battle_info = create_battle_info(session, 0, 0).await;
+48 -55
View File
@@ -1,7 +1,6 @@
use std::path::Path;
use common::structs::MultiPathAvatar; use common::structs::MultiPathAvatar;
use proto::{chat_message_extend_data::ExtendType, dabbfcoafjg::Eedaadmacap}; use proto::chat_data::ExtendType;
use std::path::Path;
use tokio::fs; use tokio::fs;
use crate::{ use crate::{
@@ -28,8 +27,8 @@ pub async fn on_get_friend_login_info_cs_req(
_req: &GetFriendLoginInfoCsReq, _req: &GetFriendLoginInfoCsReq,
res: &mut GetFriendLoginInfoScRsp, res: &mut GetFriendLoginInfoScRsp,
) { ) {
res.ckjhinjopgk = vec![SERVER_UID]; res.cobofagagkm = vec![SERVER_UID];
res.dfommfkiami = vec![SERVER_UID]; res.pkdoflgoaof = vec![SERVER_UID];
} }
pub async fn on_get_friend_list_info_cs_req( pub async fn on_get_friend_list_info_cs_req(
@@ -65,23 +64,17 @@ pub async fn on_get_private_chat_history_cs_req(
res.chat_message_list = SERVER_CHAT_HISTORY res.chat_message_list = SERVER_CHAT_HISTORY
.iter() .iter()
.map(|text| ChatMessageData { .map(|text| ChatMessageData {
message_type: MsgType::CustomText.into(),
create_time: cur_time, create_time: cur_time,
content: String::from(*text), aeelknkiici: Some(Jdpgjoadlle {
sender_id: SERVER_UID, nihajmhkobc: 1,
chat_message_extend_data: Some(ChatMessageExtendData { mhhbnffopoj: Some(jdpgjoadlle::Mhhbnffopoj::Uid(SERVER_UID)),
extend_type: Some(ExtendType::MessageText(String::from(*text))),
}), }),
bofjjhikijl: Some(Dabbfcoafjg { message_datas: vec![MessageChatData {
eedaadmacap: Some(Eedaadmacap::Uid(SERVER_UID)), message_type: 1,
kcpbmeabmph: 0, chat_data: Some(ChatData {
}), extend_type: Some(ExtendType::MessageText(text.to_string())),
dgmnkagbcem: Some(Gpcnkeaofea {
chat_message_extend_data: Some(ChatMessageExtendData {
extend_type: Some(ExtendType::MessageText(String::from(*text))),
}), }),
message_type: MsgType::CustomText.into(), }],
}),
..Default::default() ..Default::default()
}) })
.collect(); .collect();
@@ -100,9 +93,9 @@ pub async fn on_send_msg_cs_req(
}; };
let msg = body let msg = body
.dgmnkagbcem .message_datas
.as_ref() .as_ref()
.and_then(|x| x.chat_message_extend_data.as_ref()) .and_then(|x| x.chat_data.as_ref())
.and_then(|x| x.extend_type.as_ref()) .and_then(|x| x.extend_type.as_ref())
.and_then(|x| match x { .and_then(|x| match x {
ExtendType::MessageText(s) => Some(s.as_str()), ExtendType::MessageText(s) => Some(s.as_str()),
@@ -118,9 +111,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
String::from("Inventory Synced"), String::from("Inventory Synced"),
)) ))
.await .await
@@ -151,9 +146,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
format!("Success change mc to {mc:#?}"), format!("Success change mc to {mc:#?}"),
)) ))
.await .await
@@ -188,9 +185,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
format!("Success change march to {march_type:#?}"), format!("Success change march to {march_type:#?}"),
)) ))
.await .await
@@ -204,9 +203,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
format!("File {path:?} does not exist!"), format!("File {path:?} does not exist!"),
)) ))
.await .await
@@ -220,9 +221,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
format!("Failed to read file: {err:?}"), format!("Failed to read file: {err:?}"),
)) ))
.await .await
@@ -248,9 +251,11 @@ pub async fn on_send_msg_cs_req(
.send(create_send_message( .send(create_send_message(
25, 25,
SERVER_UID, SERVER_UID,
body.message_type, body.message_datas
.as_ref()
.map(|v| v.message_type)
.unwrap_or_default(),
body.chat_type, body.chat_type,
body.chat_message_extend_data.clone(),
format!("Executed {path:?}"), format!("Executed {path:?}"),
)) ))
.await .await
@@ -276,35 +281,23 @@ fn create_send_message(
from: u32, from: u32,
message_type: i32, message_type: i32,
chat_type: i32, chat_type: i32,
extend_data: Option<ChatMessageExtendData>,
msg: String, msg: String,
) -> RevcMsgScNotify { ) -> RevcMsgScNotify {
RevcMsgScNotify { RevcMsgScNotify {
message_type,
message_text: msg.clone(),
source_uid: from,
target_uid: to,
chat_type, chat_type,
chat_message_extend_data: extend_data, dkdlooaaake: to,
mjaocldhphm: 0, recv_message_data: Some(ChatMessageData {
revc_message_data: Some(ChatMessageData {
message_type: MsgType::CustomText.into(),
create_time: cur_timestamp_ms(), create_time: cur_timestamp_ms(),
content: msg.clone(), aeelknkiici: Some(Jdpgjoadlle {
sender_id: SERVER_UID, nihajmhkobc: 0,
chat_message_extend_data: Some(ChatMessageExtendData { mhhbnffopoj: Some(jdpgjoadlle::Mhhbnffopoj::Uid(from)),
extend_type: Some(ExtendType::MessageText(msg.clone())),
}), }),
bofjjhikijl: Some(Dabbfcoafjg { message_datas: vec![MessageChatData {
eedaadmacap: Some(Eedaadmacap::Uid(SERVER_UID)), message_type,
kcpbmeabmph: 0, chat_data: Some(ChatData {
}), extend_type: Some(chat_data::ExtendType::MessageText(msg)),
dgmnkagbcem: Some(Gpcnkeaofea {
chat_message_extend_data: Some(ChatMessageExtendData {
extend_type: Some(ExtendType::MessageText(msg.clone())),
}), }),
message_type: MsgType::CustomText.into(), }],
}),
..Default::default() ..Default::default()
}), }),
} }
+1 -1
View File
@@ -124,7 +124,7 @@ pub async fn on_get_big_data_all_recommend_cs_req(
res.recommend_type = Some(RecommendType::AvatarRelic(BigDataRecommendAvatarRelic { res.recommend_type = Some(RecommendType::AvatarRelic(BigDataRecommendAvatarRelic {
recomended_relic_info_list: BASE_AVATAR_IDS recomended_relic_info_list: BASE_AVATAR_IDS
.into_iter() .into_iter()
.map(|avatar_id| RecommendedRelicInfo { .map(|avatar_id| BigDataAvatarRelicRecommend {
avatar_id, avatar_id,
..Default::default() ..Default::default()
}) })
+1 -1
View File
@@ -404,7 +404,7 @@ async fn load_scene(
scene_info.entity_group_list.push(SceneEntityGroupInfo { scene_info.entity_group_list.push(SceneEntityGroupInfo {
state: 0, state: 0,
group_id: 0, group_id: 0,
jjeeocobckc: HashMap::with_capacity(0), ggnjmghhhmj: HashMap::with_capacity(0),
entity_list: json entity_list: json
.lineups .lineups
.iter() .iter()
+1 -1
View File
@@ -208,7 +208,7 @@ trait_handler! {
StartCocoonStage; StartCocoonStage;
PveBattleResult; PveBattleResult;
SceneCastSkill; SceneCastSkill;
StartQuickCocoonStage; QuickStartCocoonStage;
// Teleport // Teleport
GetEnteredScene; GetEnteredScene;
+12 -12
View File
@@ -1,21 +1,21 @@
{ {
"lineups": { "lineups": {
"0": 1015, "0": 1414,
"1": 1306, "1": 1410,
"2": 1403, "2": 0,
"3": 1414 "3": 0
}, },
"position": { "position": {
"x": -26968, "x": 422379,
"y": 78953, "y": 25904,
"z": 14457, "z": -308312,
"rot_y": 11858 "rot_y": 0
}, },
"scene": { "scene": {
"plane_id": 20411, "plane_id": 20511,
"floor_id": 20411001, "floor_id": 20511001,
"entry_id": 2041101 "entry_id": 2051101
}, },
"main_character": "FemaleRememberance", "main_character": "FemaleRemembrance",
"march_type": "MarchHunt" "march_type": "MarchHunt"
} }
+39051
View File
File diff suppressed because it is too large Load Diff
+52056 -48837
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+12
View File
@@ -46,5 +46,17 @@
"ex_resource_url": "", "ex_resource_url": "",
"lua_url": "", "lua_url": "",
"ifix_url": "" "ifix_url": ""
},
"OSBETAWin4.0.51X": {
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_14026982_55a517a26691_89300298bf2b2e",
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_14036546_28a134460a9a_5805431f75f0ff",
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_14028456_7088b08fd431_59194837d90977",
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_0_40d2ce0253_6d871f8bca6eb4"
},
"OSBETAWin4.0.51": {
"asset_bundle_url": "",
"ex_resource_url": "",
"lua_url": "",
"ifix_url": ""
} }
} }