feat: Add support for 3.8.5x
This commit is contained in:
+15
-109
@@ -1,4 +1,4 @@
|
||||
use proto::{Avatar, AvatarSkillTree, MultiPathAvatarInfo};
|
||||
use proto::{Avatar, AvatarPathData};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
|
||||
@@ -31,124 +31,30 @@ pub struct FreesrData {
|
||||
pub main_character: MultiPathAvatar,
|
||||
#[serde(skip_serializing, skip_deserializing)]
|
||||
pub march_type: MultiPathAvatar,
|
||||
// #[serde(skip_serializing, skip_deserializing)]
|
||||
// pub game_language: AllowedLanguages,
|
||||
// #[serde(skip_serializing, skip_deserializing)]
|
||||
// pub voice_langauge: AllowedLanguages,
|
||||
}
|
||||
|
||||
impl FreesrData {
|
||||
pub fn get_avatar_proto(&self, avatar_id: u32) -> Option<Avatar> {
|
||||
let avatar = self.avatars.get(&avatar_id)?;
|
||||
let lightcone = self.lightcones.iter().find(|l| l.equip_avatar == avatar_id);
|
||||
let relics = self.relics.iter().filter(|r| r.equip_avatar == avatar_id);
|
||||
|
||||
// TODO: HARDCODED
|
||||
let base_avatar_id = if avatar.avatar_id > 8000 {
|
||||
8001
|
||||
} else if avatar.avatar_id == 1001 || avatar.avatar_id == 1224 {
|
||||
1001
|
||||
} else {
|
||||
avatar.avatar_id
|
||||
};
|
||||
|
||||
Some(Avatar {
|
||||
base_avatar_id,
|
||||
level: avatar.level,
|
||||
promotion: avatar.promotion,
|
||||
rank: avatar.data.rank,
|
||||
skilltree_list: avatar
|
||||
.data
|
||||
.skills
|
||||
.iter()
|
||||
.map(|v| AvatarSkillTree {
|
||||
point_id: *v.0,
|
||||
level: *v.1,
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
equipment_unique_id: lightcone.map(|v| v.get_unique_id()).unwrap_or_default(),
|
||||
first_met_time_stamp: 1712924677,
|
||||
equip_relic_list: relics.map(|v| v.into()).collect::<Vec<_>>(),
|
||||
unk_enhanced_id: avatar.enhanced_id.unwrap_or_default(),
|
||||
..Default::default()
|
||||
})
|
||||
Some(avatar.to_avatar_proto(lightcone))
|
||||
}
|
||||
|
||||
pub fn get_avatar_multipath_proto(&self, avatar_id: u32) -> Option<MultiPathAvatarInfo> {
|
||||
pub fn get_avatar_path_data_proto(&self, avatar_id: u32) -> Option<AvatarPathData> {
|
||||
let avatar = self.avatars.get(&avatar_id)?;
|
||||
let mp_type = MultiPathAvatar::from(avatar_id);
|
||||
|
||||
if mp_type == MultiPathAvatar::Unk {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(MultiPathAvatarInfo {
|
||||
avatar_id: mp_type as i32,
|
||||
rank: avatar.data.rank,
|
||||
equip_relic_list: self
|
||||
.relics
|
||||
.iter()
|
||||
.filter(|relic| relic.equip_avatar == mp_type as u32)
|
||||
.map(|relic| relic.into())
|
||||
.collect(),
|
||||
multi_path_skill_tree: avatar
|
||||
.data
|
||||
.skills
|
||||
.iter()
|
||||
.map(|(point_id, level)| AvatarSkillTree {
|
||||
point_id: *point_id,
|
||||
level: *level,
|
||||
})
|
||||
.collect(),
|
||||
path_equipment_id: self
|
||||
.lightcones
|
||||
.iter()
|
||||
.find(|v| v.equip_avatar == mp_type as u32)
|
||||
.map(|v| v.get_unique_id())
|
||||
.unwrap_or_default(),
|
||||
dressed_skin_id: 0,
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
pub fn get_multi_path_info(&self) -> Vec<MultiPathAvatarInfo> {
|
||||
MultiPathAvatar::to_vec()
|
||||
.into_iter()
|
||||
.filter_map(|mp_type| {
|
||||
if mp_type.is_mc() && mp_type.get_gender() != self.main_character.get_gender() {
|
||||
return Option::None;
|
||||
}
|
||||
|
||||
let avatar_info = self.avatars.get(&((mp_type) as u32))?;
|
||||
Some(MultiPathAvatarInfo {
|
||||
avatar_id: mp_type as i32,
|
||||
rank: avatar_info.data.rank,
|
||||
equip_relic_list: self
|
||||
.relics
|
||||
.iter()
|
||||
.filter(|relic| relic.equip_avatar == mp_type as u32)
|
||||
.map(|relic| relic.into())
|
||||
.collect(),
|
||||
multi_path_skill_tree: avatar_info
|
||||
.data
|
||||
.skills
|
||||
.iter()
|
||||
.map(|(point_id, level)| AvatarSkillTree {
|
||||
point_id: *point_id,
|
||||
level: *level,
|
||||
})
|
||||
.collect(),
|
||||
path_equipment_id: self
|
||||
.lightcones
|
||||
.iter()
|
||||
.find(|v| v.equip_avatar == mp_type as u32)
|
||||
.map(|v| v.get_unique_id())
|
||||
.unwrap_or_default(),
|
||||
dressed_skin_id: 0,
|
||||
..Default::default()
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
Some(
|
||||
avatar.to_avatar_path_data_proto(
|
||||
self.lightcones
|
||||
.iter()
|
||||
.find(|v| v.equip_avatar == avatar_id as u32),
|
||||
self.relics
|
||||
.iter()
|
||||
.filter(|relic| relic.equip_avatar == avatar_id as u32)
|
||||
.map(|relic| relic.into())
|
||||
.collect(),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
|
||||
use proto::{
|
||||
Avatar, AvatarSkillTree, AvatarType, BattleAvatar, BattleBuff, ExtraLineupType, Gender,
|
||||
LineupAvatar, LineupInfo, MultiPathAvatarType, SpBarInfo,
|
||||
Avatar, AvatarPathData, AvatarPathSkillTree, AvatarSkillTree, AvatarType, BattleAvatar,
|
||||
BattleBuff, ExtraLineupType, Gender, LineupAvatar, LineupInfo, MultiPathAvatarType, SpBarInfo,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -135,10 +135,12 @@ pub struct AvatarJson {
|
||||
pub struct AvatarData {
|
||||
pub rank: u32,
|
||||
pub skills: HashMap<u32, u32>,
|
||||
#[serde(default)]
|
||||
pub skills_by_anchor_type: HashMap<u32, u32>,
|
||||
}
|
||||
|
||||
impl AvatarJson {
|
||||
pub fn to_avatar_proto(&self, lightcone: Option<&Lightcone>, relics: Vec<&Relic>) -> Avatar {
|
||||
pub fn to_avatar_proto(&self, lightcone: Option<&Lightcone>) -> Avatar {
|
||||
// TODO: HARDCODED
|
||||
let base_avatar_id = if self.avatar_id > 8000 {
|
||||
8001
|
||||
@@ -152,20 +154,39 @@ impl AvatarJson {
|
||||
base_avatar_id,
|
||||
level: self.level,
|
||||
promotion: self.promotion,
|
||||
rank: self.data.rank,
|
||||
skilltree_list: self
|
||||
.data
|
||||
.skills
|
||||
.iter()
|
||||
.map(|v| AvatarSkillTree {
|
||||
point_id: *v.0,
|
||||
level: *v.1,
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
equipment_unique_id: lightcone.map(|v| v.get_unique_id()).unwrap_or_default(),
|
||||
first_met_time_stamp: 1712924677,
|
||||
equip_relic_list: relics.iter().map(|v| (*v).into()).collect::<Vec<_>>(),
|
||||
cur_multi_path_avatar_type: self.avatar_id,
|
||||
has_taken_promotion_reward_list: Vec::with_capacity(0),
|
||||
is_marked: false,
|
||||
exp: 0,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_avatar_path_data_proto(
|
||||
&self,
|
||||
lightcone: Option<&Lightcone>,
|
||||
relics: Vec<&Relic>,
|
||||
) -> AvatarPathData {
|
||||
AvatarPathData {
|
||||
avatar_id: self.avatar_id,
|
||||
rank: self.data.rank,
|
||||
equip_relic_list: relics
|
||||
.iter()
|
||||
.filter(|relic| relic.equip_avatar == self.avatar_id)
|
||||
.map(|&relic| relic.into())
|
||||
.collect(),
|
||||
avatar_path_skill_tree: self
|
||||
.data
|
||||
.skills_by_anchor_type
|
||||
.iter()
|
||||
.map(|(&anchor_type, &level)| AvatarPathSkillTree { anchor_type, level })
|
||||
.collect(),
|
||||
path_equipment_id: lightcone.map(|v| v.get_unique_id()).unwrap_or_default(),
|
||||
unk_enhanced_id: self.enhanced_id.unwrap_or_default(),
|
||||
unlock_timestamp: 0,
|
||||
dressed_skin_id: 0,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
+15363
-27438
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@ pub async fn on_player_get_token_cs_req(
|
||||
_body: &PlayerGetTokenCsReq,
|
||||
res: &mut PlayerGetTokenScRsp,
|
||||
) {
|
||||
res.msg = String::from("OK");
|
||||
res.uid = 25;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::*;
|
||||
|
||||
pub static UNLOCKED_AVATARS: [u32; 74] = [
|
||||
pub static UNLOCKED_AVATARS: [u32; 76] = [
|
||||
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,
|
||||
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,
|
||||
1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321,
|
||||
1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321, 1501, 1502,
|
||||
];
|
||||
|
||||
pub async fn on_get_avatar_data_cs_req(
|
||||
@@ -37,38 +35,37 @@ pub async fn on_get_avatar_data_cs_req(
|
||||
.map(|id| {
|
||||
json.avatars
|
||||
.get(&id)
|
||||
.map(|v| {
|
||||
v.to_avatar_proto(
|
||||
json.lightcones.iter().find(|v| v.equip_avatar == id),
|
||||
json.relics
|
||||
.iter()
|
||||
.filter(|v| v.equip_avatar == id)
|
||||
.collect(),
|
||||
)
|
||||
})
|
||||
.map(|v| v.to_avatar_proto(json.lightcones.iter().find(|v| v.equip_avatar == id)))
|
||||
.unwrap_or(Avatar {
|
||||
base_avatar_id: id,
|
||||
level: 80,
|
||||
promotion: 6,
|
||||
rank: 6,
|
||||
skilltree_list: (1..=4)
|
||||
.map(|m| AvatarSkillTree {
|
||||
point_id: id * 1000 + m,
|
||||
level: 1,
|
||||
})
|
||||
.collect(),
|
||||
first_met_time_stamp: 1712924677,
|
||||
..Default::default()
|
||||
cur_multi_path_avatar_type: 0,
|
||||
equipment_unique_id: 0,
|
||||
has_taken_promotion_reward_list: Vec::with_capacity(0),
|
||||
is_marked: false,
|
||||
exp: 0,
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
|
||||
res.cur_avatar_path = HashMap::from([
|
||||
(8001, json.main_character.get_type().into()),
|
||||
(1001, json.march_type.get_type().into()),
|
||||
]);
|
||||
|
||||
res.multi_path_avatar_info_list = json.get_multi_path_info();
|
||||
res.avatar_path_data_info_list = UNLOCKED_AVATARS
|
||||
.into_iter()
|
||||
.chain(mc_ids.iter().copied())
|
||||
.chain(march_ids.iter().copied())
|
||||
.filter_map(|id| {
|
||||
json.avatars.get(&id).map(|v| {
|
||||
v.to_avatar_path_data_proto(
|
||||
json.lightcones.iter().find(|v| v.equip_avatar == id),
|
||||
json.relics
|
||||
.iter()
|
||||
.filter(|v| v.equip_avatar == id)
|
||||
.collect(),
|
||||
)
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
|
||||
pub async fn on_set_avatar_enhanced_id_cs_req(
|
||||
|
||||
@@ -22,10 +22,10 @@ pub async fn on_start_cocoon_stage_cs_req(
|
||||
res.battle_info = Some(battle_info);
|
||||
}
|
||||
|
||||
pub async fn on_quick_start_cocoon_stage_cs_req(
|
||||
pub async fn on_start_quick_cocoon_stage_cs_req(
|
||||
session: &mut PlayerSession,
|
||||
req: &QuickStartCocoonStageCsReq,
|
||||
res: &mut QuickStartCocoonStageScRsp,
|
||||
req: &StartQuickCocoonStageCsReq,
|
||||
res: &mut StartQuickCocoonStageScRsp,
|
||||
) {
|
||||
let mut battle_info = create_battle_info(session, 0, 0).await;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use common::structs::MultiPathAvatar;
|
||||
use proto::chat_message_extend_data::ExtendType;
|
||||
|
||||
use crate::{net::PlayerSession, util::cur_timestamp_ms};
|
||||
|
||||
@@ -20,8 +21,8 @@ pub async fn on_get_friend_login_info_cs_req(
|
||||
_req: &GetFriendLoginInfoCsReq,
|
||||
res: &mut GetFriendLoginInfoScRsp,
|
||||
) {
|
||||
res.cmcilifageb = vec![SERVER_UID];
|
||||
res.gddmgcalkhc = vec![SERVER_UID];
|
||||
res.ckjhinjopgk = vec![SERVER_UID];
|
||||
res.dfommfkiami = vec![SERVER_UID];
|
||||
}
|
||||
|
||||
pub async fn on_get_friend_list_info_cs_req(
|
||||
@@ -36,7 +37,7 @@ pub async fn on_get_friend_list_info_cs_req(
|
||||
platform: PlatformType::Pc.into(),
|
||||
online_status: FriendOnlineStatus::Online.into(),
|
||||
head_icon: SERVER_HEAD_ICON,
|
||||
chat_bubble: SERVER_CHAT_BUBBLE_ID,
|
||||
chat_bubble_id: SERVER_CHAT_BUBBLE_ID,
|
||||
level: 70,
|
||||
nickname: String::from("Server"),
|
||||
signature: String::from("omg"),
|
||||
@@ -61,6 +62,18 @@ pub async fn on_get_private_chat_history_cs_req(
|
||||
create_time: cur_time,
|
||||
content: String::from(*text),
|
||||
sender_id: SERVER_UID,
|
||||
chat_message_extend_data: Some(ChatMessageExtendData {
|
||||
extend_type: Some(ExtendType::MessageText(String::from(*text))),
|
||||
}),
|
||||
bofjjhikijl: Some(Dabbfcoafjg {
|
||||
..Default::default()
|
||||
}),
|
||||
dgmnkagbcem: Some(Gpcnkeaofea {
|
||||
chat_message_extend_data: Some(ChatMessageExtendData {
|
||||
extend_type: Some(ExtendType::MessageText(String::from(*text))),
|
||||
}),
|
||||
message_type: MsgType::CustomText.into(),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
.collect();
|
||||
@@ -86,11 +99,12 @@ pub async fn on_send_msg_cs_req(
|
||||
.send(RevcMsgScNotify {
|
||||
message_type: body.message_type,
|
||||
message_text: String::from("Inventory Synced"),
|
||||
extra_id: body.extra_id,
|
||||
source_uid: SERVER_UID,
|
||||
target_uid: 25,
|
||||
chat_type: body.chat_type,
|
||||
dijgjpgfflg: body.dijgjpgfflg.clone(),
|
||||
chat_message_extend_data: body.chat_message_extend_data.clone(),
|
||||
mjaocldhphm: 0,
|
||||
pfjjlomkbfa: None,
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -120,11 +134,12 @@ pub async fn on_send_msg_cs_req(
|
||||
.send(RevcMsgScNotify {
|
||||
message_type: body.message_type,
|
||||
message_text: format!("Success change mc to {mc:#?}"),
|
||||
extra_id: body.extra_id,
|
||||
source_uid: SERVER_UID,
|
||||
target_uid: 25,
|
||||
chat_type: body.chat_type,
|
||||
dijgjpgfflg: body.dijgjpgfflg.clone(),
|
||||
chat_message_extend_data: body.chat_message_extend_data.clone(),
|
||||
mjaocldhphm: 0,
|
||||
pfjjlomkbfa: None,
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -158,11 +173,12 @@ pub async fn on_send_msg_cs_req(
|
||||
.send(RevcMsgScNotify {
|
||||
message_type: body.message_type,
|
||||
message_text: format!("Success change march to {march_type:#?}"),
|
||||
extra_id: body.extra_id,
|
||||
source_uid: SERVER_UID,
|
||||
target_uid: 25,
|
||||
chat_type: body.chat_type,
|
||||
dijgjpgfflg: body.dijgjpgfflg.clone(),
|
||||
chat_message_extend_data: body.chat_message_extend_data.clone(),
|
||||
mjaocldhphm: 0,
|
||||
pfjjlomkbfa: None,
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -135,10 +135,10 @@ pub async fn on_get_big_data_all_recommend_cs_req(
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn on_rank_up_avatar_cs_req(
|
||||
pub async fn on_active_eidolon_cs_req(
|
||||
session: &mut PlayerSession,
|
||||
req: &RankUpAvatarCsReq,
|
||||
_: &mut RankUpAvatarScRsp,
|
||||
req: &ActiveEidolonCsReq,
|
||||
_: &mut ActiveEidolonScRsp,
|
||||
) -> Option<()> {
|
||||
let player = session.json_data.get_mut()?;
|
||||
let avatar = player.avatars.get_mut(&req.avatar_id)?;
|
||||
@@ -326,11 +326,16 @@ fn build_sync(
|
||||
.iter()
|
||||
.filter_map(|id| player.get_avatar_proto(*id))
|
||||
.collect::<Vec<_>>();
|
||||
ret.avatar_sync = Some(AvatarSync { avatar_list });
|
||||
ret.multi_path_avatar_info_list = avatar_ids
|
||||
|
||||
let avatar_path_data_info_list = avatar_ids
|
||||
.into_iter()
|
||||
.filter_map(|id| player.get_avatar_multipath_proto(id))
|
||||
.filter_map(|id| player.get_avatar_path_data_proto(id))
|
||||
.collect();
|
||||
|
||||
ret.avatar_sync = Some(AvatarSync {
|
||||
avatar_list,
|
||||
avatar_path_data_info_list,
|
||||
});
|
||||
ret.relic_list = relic_indexes
|
||||
.into_iter()
|
||||
.map(|id| (&player.relics[id]).into())
|
||||
|
||||
@@ -36,19 +36,19 @@ use proto::{
|
||||
CmdBattleType::*, CmdBoxingClubType::*, CmdChallengeType::*, CmdChatType::*,
|
||||
CmdChessRogueType::*, CmdClockParkType::*, CmdContentPackageType::*, CmdDailyActiveType::*,
|
||||
CmdDrinkMakerType::*, CmdExpeditionType::*, CmdFantasticStoryActivityType::*,
|
||||
CmdFeverTimeActivityType::*, CmdFightActivityType::*, CmdFightMathc3Type::*, CmdFightType::*,
|
||||
CmdFeverTimeActivityType::*, CmdFightActivityType::*, CmdFightMatch3Type::*, CmdFightType::*,
|
||||
CmdFriendType::*, CmdGachaType::*, CmdHeartdialType::*, CmdHeliobusType::*, CmdItemType::*,
|
||||
CmdJukeboxType::*, CmdLineupType::*, CmdLobbyType::*, CmdMailType::*, CmdMapRotationType::*,
|
||||
CmdMatchThreeModuleType::*, CmdMatchType::*, CmdMessageType::*, CmdMiscModuleType::*,
|
||||
CmdMissionType::*, CmdMonopolyType::*, CmdMultiplayerType::*, CmdMultipleDropType::*,
|
||||
CmdMuseumType::*, CmdOfferingType::*, CmdPamMissionType::*, CmdPhoneType::*,
|
||||
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSync::*, CmdPlayerType::*,
|
||||
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSyncType::*, CmdPlayerType::*,
|
||||
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
|
||||
CmdRechargeGiftType::*, CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*,
|
||||
CmdRndOptionType::*, CmdRogueCommonType::*, CmdRogueEndless::*, CmdRogueModifierType::*,
|
||||
CmdRndOptionType::*, CmdRogueCommon::*, CmdRogueEndlessType::*, CmdRogueModifierType::*,
|
||||
CmdRogueTournType::*, CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*,
|
||||
CmdServerPrefsType::*, CmdShopType::*, CmdSpaceZooType::*, CmdStarFightType::*,
|
||||
CmdStoryLineType::*, CmdStrongChallengeActivityType::*, CmdTalkRewardType::*,
|
||||
CmdStoryLineType::*, CmdStrongChallengeActivityType::*, CmdTalkEventType::*,
|
||||
CmdTelevisionActivityType::*, CmdTextJoinType::*, CmdTrainVisitorType::*,
|
||||
CmdTreasureDungeonType::*, CmdTutorialType::*, CmdWaypointType::*, CmdWolfBroType::*,
|
||||
};
|
||||
|
||||
@@ -102,15 +102,14 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
group_id: prop.group_id,
|
||||
state: prop.prop_state,
|
||||
config_id: prop.inst_id,
|
||||
extra_info: None,
|
||||
});
|
||||
map_info
|
||||
.maze_prop_extra_state_list
|
||||
.push(MazePropExtraState {
|
||||
group_id: prop.group_id,
|
||||
state: prop.prop_state,
|
||||
config_id: prop.inst_id,
|
||||
extra_info: Option::None,
|
||||
});
|
||||
// map_info.maze_group_list.push(MazeGroup {
|
||||
// group_id: prop.group_id,
|
||||
// state: prop.prop_state,
|
||||
// config_id: prop.inst_id,
|
||||
// extra_info: Option::None,
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +250,7 @@ async fn load_scene(
|
||||
scene.world_id
|
||||
},
|
||||
lighten_section_list: scene.sections.clone(),
|
||||
lddigmlcgdb: scene
|
||||
opened_chests_list: scene
|
||||
.scenes
|
||||
.values()
|
||||
.flat_map(|v| v.chests.clone())
|
||||
@@ -394,7 +393,7 @@ async fn load_scene(
|
||||
|
||||
scene_info.entity_group_list.push(group_info);
|
||||
|
||||
scene_info.clecmgljocl.push(SceneGroupState {
|
||||
scene_info.group_state_list.push(SceneGroupState {
|
||||
group_id: *group_id,
|
||||
is_default: true,
|
||||
state: 0,
|
||||
@@ -405,7 +404,7 @@ async fn load_scene(
|
||||
scene_info.entity_group_list.push(SceneEntityGroupInfo {
|
||||
state: 0,
|
||||
group_id: 0,
|
||||
jnajakchjdf: HashMap::with_capacity(0),
|
||||
jjeeocobckc: HashMap::with_capacity(0),
|
||||
entity_list: json
|
||||
.lineups
|
||||
.iter()
|
||||
|
||||
@@ -10,19 +10,19 @@ use proto::{
|
||||
CmdBattleType::*, CmdBoxingClubType::*, CmdChallengeType::*, CmdChatType::*,
|
||||
CmdChessRogueType::*, CmdClockParkType::*, CmdContentPackageType::*, CmdDailyActiveType::*,
|
||||
CmdDrinkMakerType::*, CmdExpeditionType::*, CmdFantasticStoryActivityType::*,
|
||||
CmdFeverTimeActivityType::*, CmdFightActivityType::*, CmdFightMathc3Type::*, CmdFightType::*,
|
||||
CmdFeverTimeActivityType::*, CmdFightActivityType::*, CmdFightMatch3Type::*, CmdFightType::*,
|
||||
CmdFriendType::*, CmdGachaType::*, CmdHeartdialType::*, CmdHeliobusType::*, CmdItemType::*,
|
||||
CmdJukeboxType::*, CmdLineupType::*, CmdLobbyType::*, CmdMailType::*, CmdMapRotationType::*,
|
||||
CmdMatchThreeModuleType::*, CmdMatchType::*, CmdMessageType::*, CmdMiscModuleType::*,
|
||||
CmdMissionType::*, CmdMonopolyType::*, CmdMultiplayerType::*, CmdMultipleDropType::*,
|
||||
CmdMuseumType::*, CmdOfferingType::*, CmdPamMissionType::*, CmdPhoneType::*,
|
||||
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSync::*, CmdPlayerType::*,
|
||||
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSyncType::*, CmdPlayerType::*,
|
||||
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
|
||||
CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*, CmdRndOptionType::*,
|
||||
CmdRogueCommonType::*, CmdRogueEndless::*, CmdRogueModifierType::*, CmdRogueTournType::*,
|
||||
CmdRogueCommon::*, CmdRogueEndlessType::*, CmdRogueModifierType::*, CmdRogueTournType::*,
|
||||
CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*, CmdServerPrefsType::*, CmdShopType::*,
|
||||
CmdSpaceZooType::*, CmdStarFightType::*, CmdStoryLineType::*,
|
||||
CmdStrongChallengeActivityType::*, CmdTalkRewardType::*, CmdTelevisionActivityType::*,
|
||||
CmdStrongChallengeActivityType::*, CmdTalkEventType::*, CmdTelevisionActivityType::*,
|
||||
CmdTextJoinType::*, CmdTrainVisitorType::*, CmdTreasureDungeonType::*, CmdTutorialType::*,
|
||||
CmdWaypointType::*, CmdWolfBroType::*,
|
||||
};
|
||||
@@ -190,7 +190,7 @@ trait_handler! {
|
||||
TakeOffEquipment;
|
||||
DressRelicAvatar;
|
||||
TakeOffRelic;
|
||||
RankUpAvatar;
|
||||
ActiveEidolon;
|
||||
|
||||
// Chat (dummy!)
|
||||
SendMsg;
|
||||
@@ -208,7 +208,7 @@ trait_handler! {
|
||||
StartCocoonStage;
|
||||
PveBattleResult;
|
||||
SceneCastSkill;
|
||||
QuickStartCocoonStage;
|
||||
StartQuickCocoonStage;
|
||||
|
||||
// Teleport
|
||||
GetEnteredScene;
|
||||
|
||||
@@ -10,7 +10,7 @@ use anyhow::Result;
|
||||
use common::sr_tools::FreesrData;
|
||||
use mhy_kcp::Kcp;
|
||||
use prost::Message;
|
||||
use proto::{AvatarSync, CmdID, PlayerSyncScNotify};
|
||||
use proto::{AvatarSync, CmdID, CmdPlayerType, PlayerSyncScNotify};
|
||||
use tokio::{
|
||||
io::AsyncWrite,
|
||||
net::UdpSocket,
|
||||
@@ -70,12 +70,11 @@ impl PlayerSession {
|
||||
drop(kcp);
|
||||
|
||||
for packet in packets {
|
||||
// #TODO
|
||||
// if packet.cmd_type == CmdPlayerType::CmdPlayerLogoutCsReq as u16 {
|
||||
// tracing::info!("Player logged out");
|
||||
// let _ = self.shutdown_tx.send(());
|
||||
// return Ok(());
|
||||
// };
|
||||
if packet.cmd_type == CmdPlayerType::CmdPlayerLogoutCsReq as u16 {
|
||||
tracing::info!("Player logged out");
|
||||
let _ = self.shutdown_tx.send(());
|
||||
return Ok(());
|
||||
};
|
||||
Self::on_message(self, packet.cmd_type, packet.body).await?;
|
||||
}
|
||||
|
||||
@@ -132,22 +131,29 @@ impl PlayerSession {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Sync avatars
|
||||
// clear all avatars equip item
|
||||
self.send(PlayerSyncScNotify {
|
||||
avatar_sync: Some(AvatarSync {
|
||||
avatar_list: json
|
||||
.avatars
|
||||
.values()
|
||||
.map(|avatar| avatar.to_avatar_proto(Option::None, vec![]))
|
||||
.map(|avatar| avatar.to_avatar_proto(Option::None))
|
||||
.collect::<Vec<_>>(),
|
||||
avatar_path_data_info_list: json
|
||||
.avatars
|
||||
.values()
|
||||
.map(|avatar| {
|
||||
avatar.to_avatar_path_data_proto(Option::None, Vec::with_capacity(0))
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
}),
|
||||
multi_path_avatar_info_list: json.get_multi_path_info(),
|
||||
|
||||
..Default::default()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Sync new relics
|
||||
// Sync new relics & lightcones
|
||||
self.send(PlayerSyncScNotify {
|
||||
relic_list: json.relics.iter().map(|v| v.into()).collect(),
|
||||
equipment_list: json.lightcones.iter().map(|v| v.into()).collect(),
|
||||
@@ -156,7 +162,7 @@ impl PlayerSession {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Sync new lightcones
|
||||
// Sync new avatars equip item
|
||||
self.send(PlayerSyncScNotify {
|
||||
avatar_sync: Some(AvatarSync {
|
||||
avatar_list: json
|
||||
@@ -167,13 +173,24 @@ impl PlayerSession {
|
||||
json.lightcones
|
||||
.iter()
|
||||
.find(|v| v.equip_avatar == avatar.avatar_id),
|
||||
json.relics
|
||||
.iter()
|
||||
.filter(|v| v.equip_avatar == avatar.avatar_id)
|
||||
.collect(),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
avatar_path_data_info_list: json
|
||||
.avatars
|
||||
.values()
|
||||
.map(|avatar| {
|
||||
avatar.to_avatar_path_data_proto(
|
||||
json.lightcones
|
||||
.iter()
|
||||
.find(|v| v.equip_avatar == avatar.avatar_id),
|
||||
json.relics
|
||||
.iter()
|
||||
.filter(|r| r.equip_avatar == avatar.avatar_id)
|
||||
.collect(),
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
}),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
+12
-12
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"lineups": {
|
||||
"0": 1407,
|
||||
"1": 1415,
|
||||
"2": 1409,
|
||||
"3": 1403
|
||||
"0": 1501,
|
||||
"1": 1502,
|
||||
"2": 1306,
|
||||
"3": 1414
|
||||
},
|
||||
"position": {
|
||||
"x": -154080,
|
||||
"y": -31188,
|
||||
"z": 31160,
|
||||
"rot_y": 28332
|
||||
"x": -26968,
|
||||
"y": 78953,
|
||||
"z": 14457,
|
||||
"rot_y": 11858
|
||||
},
|
||||
"scene": {
|
||||
"plane_id": 20432,
|
||||
"floor_id": 20432001,
|
||||
"entry_id": 2043201
|
||||
"plane_id": 20411,
|
||||
"floor_id": 20411001,
|
||||
"entry_id": 2041101
|
||||
},
|
||||
"main_character": "MaleRememberance",
|
||||
"main_character": "FemaleRememberance",
|
||||
"march_type": "MarchHunt"
|
||||
}
|
||||
+63830
-54647
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ use std::collections::HashMap;
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use prost::Message as _;
|
||||
use proto::Gateserver;
|
||||
use proto::GateServer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::fs;
|
||||
|
||||
@@ -73,7 +73,7 @@ impl VersionConfig {
|
||||
tracing::info!("raw gateway response: {}", res);
|
||||
|
||||
let bytes = rbase64::decode(&res)?;
|
||||
let decoded = Gateserver::decode(bytes.as_slice())?;
|
||||
let decoded = GateServer::decode(bytes.as_slice())?;
|
||||
|
||||
if decoded.asset_bundle_url.is_empty() && decoded.ex_resource_url.is_empty() {
|
||||
return Err(anyhow::format_err!(
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
use crate::AppState;
|
||||
use axum::extract::{Query, State};
|
||||
use prost::Message;
|
||||
use proto::{Dispatch, Gateserver, RegionInfo};
|
||||
use proto::{Dispatch, GateServer, RegionInfo};
|
||||
use serde::Deserialize;
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::instrument;
|
||||
@@ -47,7 +47,7 @@ pub async fn query_gateway(
|
||||
.get_or_insert_hotfix(¶meters.version, ¶meters.dispatch_seed)
|
||||
.await;
|
||||
|
||||
let rsp = Gateserver {
|
||||
let rsp = GateServer {
|
||||
ip: String::from("127.0.0.1"),
|
||||
port: 23301,
|
||||
asset_bundle_url: config.asset_bundle_url.clone(),
|
||||
@@ -62,9 +62,6 @@ pub async fn query_gateway(
|
||||
unk5: true,
|
||||
unk6: true,
|
||||
unk7: true,
|
||||
unk8: true,
|
||||
unk9: true,
|
||||
unk10: true,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
||||
+46
-10
@@ -1,14 +1,50 @@
|
||||
{
|
||||
"CNBETAWin3.3.51": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_10405387_54534abc93d5_58c57f74ae686c",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_10468394_4baf03542d7e_a112f51cd16438",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_10434495_6bff50432edd_1641e3e19f1244",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_10429797_be4a832b1c47_f58faff155c2c4"
|
||||
"CNBETAWin3.6.51": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12066992_f083970b907e_999074cab6dce6",
|
||||
"ex_resource_url": "https://autopatchcn-bhsr.neonteam.dev/design_data/BetaLive/output_12114942_e99cbde25134_e63a6b835f17f9",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12103115_ee78155e9867_3626f0948d93e2",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12118783_55113408814f_c874267d04c04a"
|
||||
},
|
||||
"OSBETAWin3.3.51": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_10405387_54534abc93d5_58c57f74ae686c",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_10468394_4baf03542d7e_a112f51cd16438",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_10434495_6bff50432edd_1641e3e19f1244",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_10429797_be4a832b1c47_f58faff155c2c4"
|
||||
"CNBETAWin3.5.55": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_11797411_74704086c081_d40a71b41ba492",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_11823033_c9e8c870bcc7_b78f37c36487d0",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_11798340_8c6543a1d6c5_2d60cd9b1584b8",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"CNBETAWin3.7.51": {
|
||||
"asset_bundle_url": "",
|
||||
"ex_resource_url": "",
|
||||
"lua_url": "",
|
||||
"ifix_url": ""
|
||||
},
|
||||
"CNBETAWin3.7.51X": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12579793_48327ff319b5_1b794dd1071e3a",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12611332_5f583f2f54ae_c04979f13c950d",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12579929_9566349ee5fb_c6341faaf9b027",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_0_40d2ce0253_c61ba99f70b885"
|
||||
},
|
||||
"CNBETAWin3.6.52X": {
|
||||
"asset_bundle_url": "https://autopatchcn.bhsr.com/asb/BetaLive/output_12150127_00d6d096d968_cd76a04beb7ba6",
|
||||
"ex_resource_url": "https://autopatchcn.bhsr.com/design_data/BetaLive/output_12178965_e246796e0bb6_05bcce36cd648b",
|
||||
"lua_url": "https://autopatchcn.bhsr.com/lua/BetaLive/output_12150614_5279f6d8029a_bdecff99d2d817",
|
||||
"ifix_url": "https://autopatchcn.bhsr.com/ifix/BetaLive/output_12164593_8e3fba5163df_b2b6fc46de4c06"
|
||||
},
|
||||
"OSPRODWin3.6.0": {
|
||||
"asset_bundle_url": "",
|
||||
"ex_resource_url": "",
|
||||
"lua_url": "",
|
||||
"ifix_url": ""
|
||||
},
|
||||
"OSBETAWin3.8.51X": {
|
||||
"asset_bundle_url": "https://autopatchos.starrails.com/asb/BetaLive/output_13490885_bf25e1553b38_e9adc23a6b6710",
|
||||
"ex_resource_url": "https://autopatchos.starrails.com/design_data/BetaLive/output_13532881_eb1de9bedabd_c74ab2513059ad",
|
||||
"lua_url": "https://autopatchos.starrails.com/lua/BetaLive/output_13493894_ec7d6d879305_8b2cfd39d6e545",
|
||||
"ifix_url": "https://autopatchos.starrails.com/ifix/BetaLive/output_13491130_ecfa51828143_4bd221b76c0d9a"
|
||||
},
|
||||
"OSBETAWin3.8.51": {
|
||||
"asset_bundle_url": "",
|
||||
"ex_resource_url": "",
|
||||
"lua_url": "",
|
||||
"ifix_url": ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user