feat: Add support for 4.4.5x
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use super::*;
|
||||
|
||||
pub static BASE_AVATAR_IDS: [u32; 85] = [
|
||||
pub static BASE_AVATAR_IDS: [u32; 87] = [
|
||||
8001, 1001, //
|
||||
//
|
||||
1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,
|
||||
@@ -8,7 +8,7 @@ pub static BASE_AVATAR_IDS: [u32; 85] = [
|
||||
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, 1501, 1502, 1504, 1505, 1506, 1507,
|
||||
1508, 1509, 1510
|
||||
1508, 1509, 1510, 1512, 1513,
|
||||
];
|
||||
|
||||
pub async fn on_get_avatar_data_cs_req(
|
||||
|
||||
@@ -105,7 +105,7 @@ pub async fn on_send_msg_cs_req(
|
||||
.and_then(|x| x.extend_type.as_ref())
|
||||
.and_then(|x| match x {
|
||||
ExtendType::MessageText(s) => Some(s.as_str()),
|
||||
_ => None,
|
||||
_ => Option::<&str>::None,
|
||||
})
|
||||
.unwrap_or("");
|
||||
|
||||
@@ -325,7 +325,7 @@ fn create_send_message(
|
||||
) -> RevcMsgScNotify {
|
||||
RevcMsgScNotify {
|
||||
chat_type,
|
||||
dkdlooaaake: to,
|
||||
pffpfkoglpo: to,
|
||||
recv_message_data: Some(ChatMessageData {
|
||||
create_time: cur_timestamp_ms(),
|
||||
ckhpffenobe: Some(Eknabklpeel {
|
||||
|
||||
@@ -135,10 +135,10 @@ pub async fn on_get_big_data_all_recommend_cs_req(
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn on_active_eidolon_cs_req(
|
||||
pub async fn on_rank_up_avatar_cs_req(
|
||||
session: &mut PlayerSession,
|
||||
req: &ActiveEidolonCsReq,
|
||||
_: &mut ActiveEidolonScRsp,
|
||||
req: &RankUpAvatarCsReq,
|
||||
_: &mut RankUpAvatarScRsp,
|
||||
) -> Option<()> {
|
||||
let player = session.json_data.get_mut()?;
|
||||
let avatar = player.avatars.get_mut(&req.avatar_id)?;
|
||||
|
||||
@@ -5,9 +5,9 @@ pub async fn on_get_mission_status_cs_req(
|
||||
body: &GetMissionStatusCsReq,
|
||||
res: &mut GetMissionStatusScRsp,
|
||||
) {
|
||||
res.finished_main_mission_id_list = body.main_mission_id_list.clone();
|
||||
res.finished_main_mission_id_list = body.sub_mission_id_list.clone();
|
||||
res.sub_mission_status_list = body
|
||||
.sub_mission_id_list
|
||||
.main_mission_id_list
|
||||
.iter()
|
||||
.map(|id| Mission {
|
||||
id: *id,
|
||||
|
||||
@@ -29,30 +29,6 @@ pub use mission::*;
|
||||
pub use player::*;
|
||||
pub use scene::*;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use proto::{
|
||||
CmdActivityType::*, CmdAdventureType::*, CmdAetherDivideType::*, CmdAlleyType::*,
|
||||
CmdArchiveType::*, CmdAvatarType::*, CmdBattleCollegeType::*, CmdBattlePassType::*,
|
||||
CmdBattleType::*, CmdBoxingClubType::*, CmdChallengeType::*, CmdChatType::*,
|
||||
CmdChessRogueType::*, CmdClockParkType::*, CmdContentPackageType::*, CmdDailyActiveType::*,
|
||||
CmdDrinkMakerType::*, CmdExpeditionType::*, CmdFantasticStoryActivityType::*,
|
||||
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::*, CmdPlayerSyncType::*, CmdPlayerType::*,
|
||||
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
|
||||
CmdRechargeGiftType::*, CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*,
|
||||
CmdRndOptionType::*, CmdRogueCommonType::*, CmdRogueEndlessType::*, CmdRogueModifierType::*,
|
||||
CmdRogueTournType::*, CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*,
|
||||
CmdServerPrefsType::*, CmdShopType::*, CmdSpaceZooType::*, CmdStarFightType::*,
|
||||
CmdStoryLineType::*, CmdStrongChallengeActivityType::*, CmdTalkEventType::*,
|
||||
CmdTelevisionActivityType::*, CmdTextJoinType::*, CmdTrainVisitorType::*,
|
||||
CmdTreasureDungeonType::*, CmdTutorialType::*, CmdWaypointType::*, CmdWolfBroType::*,
|
||||
};
|
||||
|
||||
macro_rules! dummy {
|
||||
($($cmd:ident),* $(,)*) => {
|
||||
paste! {
|
||||
@@ -60,7 +36,7 @@ macro_rules! dummy {
|
||||
pub const fn should_send_dummy_rsp(cmd_id: u16) -> bool {
|
||||
match cmd_id {
|
||||
$(
|
||||
x if x == [<Cmd $cmd CsReq>] as u16 => true,
|
||||
x if x == <proto::[<$cmd CsReq>] as proto::CmdID>::CMD_ID => true,
|
||||
)*
|
||||
_ => false,
|
||||
}
|
||||
@@ -69,7 +45,9 @@ macro_rules! dummy {
|
||||
pub async fn send_dummy_response(&mut self, req_id: u16) -> Result<()> {
|
||||
let cmd_type = match req_id {
|
||||
$(
|
||||
x if x == [<Cmd $cmd CsReq>] as u16 => [<Cmd $cmd ScRsp>] as u16,
|
||||
x if x == <proto::[<$cmd CsReq>] as proto::CmdID>::CMD_ID => {
|
||||
<proto::[<$cmd ScRsp>] as proto::CmdID>::CMD_ID
|
||||
},
|
||||
)*
|
||||
_ => return Err(anyhow::anyhow!("Invalid request id {req_id:?}")),
|
||||
};
|
||||
@@ -140,5 +118,6 @@ dummy! {
|
||||
GetPreAvatarActivityList,
|
||||
// GetUnreleasedBlockInfo,
|
||||
GetFriendAssistList,
|
||||
GetAssistList
|
||||
GetAssistList,
|
||||
B51RacingGetData
|
||||
}
|
||||
|
||||
@@ -34,9 +34,11 @@ pub async fn on_player_login_finish_cs_req(
|
||||
.send(ContentPackageSyncDataScNotify {
|
||||
data: Some(ContentPackageData {
|
||||
content_package_list: [
|
||||
200001, 200002, 200003, 200004, 200005, 200006, 200007, 200008, 150017, 150015,
|
||||
150021, 150018, 130011, 130012, 130013, 150025, 140006, 150026, 130014, 150034,
|
||||
150029, 150035, 150041, 150039, 150045,
|
||||
200001, 200002, 200003, 200004, 200005, 200006, 200007, 200008, 200009, 200010,
|
||||
200011, 200012, 150017, 150015, 150021, 150018, 130011, 130012, 130013, 150025,
|
||||
140006, 150026, 130014, 150034, 150029, 150035, 150041, 150039, 150045, 150057,
|
||||
150042, 150067, 150064, 150063, 150024, 171002, 150068, 150070, 150071, 150073,
|
||||
150074, 150075, 150076, 150077, 150078, 150079,
|
||||
]
|
||||
.into_iter()
|
||||
.map(|v| ContentPackageInfo {
|
||||
|
||||
@@ -72,6 +72,10 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
},
|
||||
],
|
||||
floor_id: floor_id,
|
||||
scene_identifier: Some(SceneIdentifier {
|
||||
floor_id,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -87,7 +91,7 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
|
||||
if let Some((_, floor_config)) = floor_configs {
|
||||
for (group_id, group) in floor_config.scenes.iter() {
|
||||
map_info.maze_group_list.push(MazeGroup {
|
||||
map_info.group_list.push(MapInfoGroup {
|
||||
group_id: *group_id,
|
||||
..Default::default()
|
||||
});
|
||||
@@ -97,11 +101,11 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
}
|
||||
|
||||
for prop in &group.props {
|
||||
map_info.maze_prop_list.push(MazePropState {
|
||||
map_info.map_info_prop_list.push(MazePropState {
|
||||
group_id: prop.group_id,
|
||||
state: prop.prop_state,
|
||||
config_id: prop.inst_id,
|
||||
extra_info: None,
|
||||
extra_info: Option::<PropExtraInfo>::None,
|
||||
});
|
||||
// map_info.maze_group_list.push(MazeGroup {
|
||||
// group_id: prop.group_id,
|
||||
@@ -113,7 +117,7 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
}
|
||||
|
||||
map_info.lighten_section_list = floor_config.sections.clone();
|
||||
map_info.floor_saved_data = floor_config.saved_values.clone();
|
||||
map_info.floor_saved_value_map = floor_config.saved_values.clone();
|
||||
// #TODO!
|
||||
// map_info
|
||||
// .chest_unlock_progress_list
|
||||
@@ -124,7 +128,7 @@ pub async fn on_get_scene_map_info_cs_req(
|
||||
// });
|
||||
}
|
||||
|
||||
res.scene_map_info.push(map_info)
|
||||
res.scene_map_info_list.push(map_info)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,29 +3,6 @@ use paste::paste;
|
||||
use tracing::Instrument;
|
||||
|
||||
use proto::*;
|
||||
#[allow(unused_imports)]
|
||||
use proto::{
|
||||
CmdActivityType::*, CmdAdventureType::*, CmdAetherDivideType::*, CmdAlleyType::*,
|
||||
CmdArchiveType::*, CmdAvatarType::*, CmdBattleCollegeType::*, CmdBattlePassType::*,
|
||||
CmdBattleType::*, CmdBoxingClubType::*, CmdChallengeType::*, CmdChatType::*,
|
||||
CmdChessRogueType::*, CmdClockParkType::*, CmdContentPackageType::*, CmdDailyActiveType::*,
|
||||
CmdDrinkMakerType::*, CmdExpeditionType::*, CmdFantasticStoryActivityType::*,
|
||||
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::*, CmdPlayerSyncType::*, CmdPlayerType::*,
|
||||
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
|
||||
CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*, CmdRndOptionType::*,
|
||||
CmdRogueCommonType::*, CmdRogueEndlessType::*, CmdRogueModifierType::*, CmdRogueTournType::*,
|
||||
CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*, CmdServerPrefsType::*, CmdShopType::*,
|
||||
CmdSpaceZooType::*, CmdStarFightType::*, CmdStoryLineType::*,
|
||||
CmdStrongChallengeActivityType::*, CmdTalkEventType::*, CmdTelevisionActivityType::*,
|
||||
CmdTextJoinType::*, CmdTrainVisitorType::*, CmdTreasureDungeonType::*, CmdTutorialType::*,
|
||||
CmdWaypointType::*, CmdWolfBroType::*,
|
||||
};
|
||||
|
||||
use super::PlayerSession;
|
||||
use super::handlers::*;
|
||||
@@ -138,27 +115,27 @@ macro_rules! trait_handler {
|
||||
}
|
||||
)*
|
||||
|
||||
async fn on_message(session: &mut PlayerSession, cmd_type: u16, payload: Vec<u8>) -> Result<()> {
|
||||
async fn on_message(session: &mut PlayerSession, cmd_id: u16, payload: Vec<u8>) -> Result<()> {
|
||||
use ::prost::Message;
|
||||
if PlayerSession::should_send_dummy_rsp(cmd_type) {
|
||||
session.send_dummy_response(cmd_type).await?;
|
||||
if PlayerSession::should_send_dummy_rsp(cmd_id) {
|
||||
session.send_dummy_response(cmd_id).await?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
match cmd_type {
|
||||
match cmd_id {
|
||||
$(
|
||||
cmd_type if cmd_type == paste! { [<Cmd$name CsReq>] as u16 } => {
|
||||
cmd_id if cmd_id == paste! { <proto::[<$name CsReq>] as proto::CmdID>::CMD_ID } => {
|
||||
let body = paste! { proto::[<$name CsReq>]::decode(&mut &payload[..])? };
|
||||
paste! {
|
||||
Self::[<on_$name:snake _cs_req>](session, &body)
|
||||
.instrument(tracing::info_span!(stringify!([<on_$name:snake>]), cmd_type = cmd_type))
|
||||
.instrument(tracing::info_span!(stringify!([<on_$name:snake>]), cmd_id = cmd_id))
|
||||
.await
|
||||
}
|
||||
}
|
||||
)*
|
||||
_ => {
|
||||
tracing::warn!("Unknown command type: {cmd_type}");
|
||||
tracing::warn!("Unknown command ID: {cmd_id}");
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
@@ -190,7 +167,7 @@ trait_handler! {
|
||||
TakeOffEquipment;
|
||||
DressRelicAvatar;
|
||||
TakeOffRelic;
|
||||
ActiveEidolon;
|
||||
RankUpAvatar;
|
||||
|
||||
// Chat (dummy!)
|
||||
SendMsg;
|
||||
|
||||
Reference in New Issue
Block a user