feat: Add support for 3.7.5x

This commit is contained in:
amizing25
2025-11-04 23:16:14 +07:00
parent f1ef8d8da2
commit 56bdb1abc1
20 changed files with 59097 additions and 61538 deletions
+8 -8
View File
@@ -1,4 +1,4 @@
use proto::{Avatar, AvatarSkillTree, MultiPathAvatarTypeInfo};
use proto::{Avatar, AvatarSkillTree, MultiPathAvatarInfo};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};
@@ -67,14 +67,14 @@ impl FreesrData {
})
.collect::<Vec<_>>(),
equipment_unique_id: lightcone.map(|v| v.get_unique_id()).unwrap_or_default(),
first_met_timestamp: 1712924677,
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()
})
}
pub fn get_avatar_multipath_proto(&self, avatar_id: u32) -> Option<MultiPathAvatarTypeInfo> {
pub fn get_avatar_multipath_proto(&self, avatar_id: u32) -> Option<MultiPathAvatarInfo> {
let avatar = self.avatars.get(&avatar_id)?;
let mp_type = MultiPathAvatar::from(avatar_id);
@@ -82,7 +82,7 @@ impl FreesrData {
return None;
}
Some(MultiPathAvatarTypeInfo {
Some(MultiPathAvatarInfo {
avatar_id: mp_type as i32,
rank: avatar.data.rank,
equip_relic_list: self
@@ -91,7 +91,7 @@ impl FreesrData {
.filter(|relic| relic.equip_avatar == mp_type as u32)
.map(|relic| relic.into())
.collect(),
skilltree_list: avatar
multi_path_skill_tree: avatar
.data
.skills
.iter()
@@ -111,7 +111,7 @@ impl FreesrData {
})
}
pub fn get_multi_path_info(&self) -> Vec<MultiPathAvatarTypeInfo> {
pub fn get_multi_path_info(&self) -> Vec<MultiPathAvatarInfo> {
MultiPathAvatar::to_vec()
.into_iter()
.filter_map(|mp_type| {
@@ -120,7 +120,7 @@ impl FreesrData {
}
let avatar_info = self.avatars.get(&((mp_type) as u32))?;
Some(MultiPathAvatarTypeInfo {
Some(MultiPathAvatarInfo {
avatar_id: mp_type as i32,
rank: avatar_info.data.rank,
equip_relic_list: self
@@ -129,7 +129,7 @@ impl FreesrData {
.filter(|relic| relic.equip_avatar == mp_type as u32)
.map(|relic| relic.into())
.collect(),
skilltree_list: avatar_info
multi_path_skill_tree: avatar_info
.data
.skills
.iter()
+2 -2
View File
@@ -163,7 +163,7 @@ impl AvatarJson {
})
.collect::<Vec<_>>(),
equipment_unique_id: lightcone.map(|v| v.get_unique_id()).unwrap_or_default(),
first_met_timestamp: 1712924677,
first_met_time_stamp: 1712924677,
equip_relic_list: relics.iter().map(|v| (*v).into()).collect::<Vec<_>>(),
unk_enhanced_id: self.enhanced_id.unwrap_or_default(),
..Default::default()
@@ -212,7 +212,7 @@ impl AvatarJson {
for buff_id in &self.techniques {
battle_buff.push(BattleBuff {
wave_flag: 0xffffffff,
owner_id: index,
owner_index: index,
level: 1,
id: *buff_id,
dynamic_values: HashMap::from([(String::from("SkillIndex"), 2.0)]),
+3 -8
View File
@@ -37,9 +37,10 @@ impl Default for BattleConfig {
}
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[derive(Default, Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum BattleType {
#[serde(alias = "DEFAULT")]
#[default]
Default = 0,
#[serde(alias = "MOC")]
Moc = 1,
@@ -49,12 +50,6 @@ pub enum BattleType {
AA = 5,
}
impl Default for BattleType {
fn default() -> Self {
Self::Default
}
}
// BATTLE BUFFS
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct BattleBuffJson {
@@ -78,7 +73,7 @@ impl BattleBuffJson {
id: self.id,
level: self.level,
wave_flag: 0xffffffff,
owner_id: 0xffffffff,
owner_index: 0xffffffff,
dynamic_values: if let Some(dyn_key) = &self.dynamic_key {
HashMap::from([(dyn_key.key.clone(), dyn_key.value as f32)])
} else {
+1 -1
View File
@@ -18,7 +18,7 @@ pub struct Lightcone {
impl_from!(Lightcone, Equipment, |value| {
Equipment {
equip_avatar_id: value.equip_avatar,
dress_avatar_id: value.equip_avatar,
exp: 0,
is_protected: false,
level: value.level,
+2 -2
View File
@@ -28,8 +28,8 @@ impl Monster {
}
SceneMonsterWave {
wave_id,
wave_param: Some(SceneMonsterWaveParam {
battle_wave_id: wave_id,
monster_param: Some(SceneMonsterWaveParam {
level: monsters.iter().map(|v| v.level).max().unwrap_or(95),
..Default::default()
}),
+1 -1
View File
@@ -74,7 +74,7 @@ impl_from!(Relic, EquipRelic, |value| {
impl_from!(Relic, proto::Relic, |value| {
proto::Relic {
equip_avatar_id: value.equip_avatar,
dress_avatar_id: value.equip_avatar,
exp: 0,
is_protected: false,
level: value.level,
-1
View File
@@ -1,4 +1,3 @@
#![feature(let_chains)]
use anyhow::Result;
mod net;
+5 -5
View File
@@ -2,12 +2,12 @@ use std::collections::HashMap;
use super::*;
pub static UNLOCKED_AVATARS: [u32; 73] = [
pub static UNLOCKED_AVATARS: [u32; 74] = [
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
1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321,
];
pub async fn on_get_avatar_data_cs_req(
@@ -57,18 +57,18 @@ pub async fn on_get_avatar_data_cs_req(
level: 1,
})
.collect(),
first_met_timestamp: 1712924677,
first_met_time_stamp: 1712924677,
..Default::default()
})
})
.collect();
res.current_multi_path_avatar_id = HashMap::from([
res.cur_avatar_path = HashMap::from([
(8001, json.main_character.get_type().into()),
(1001, json.march_type.get_type().into()),
]);
res.multi_path_avatar_type_info_list = json.get_multi_path_info();
res.multi_path_avatar_info_list = json.get_multi_path_info();
}
pub async fn on_set_avatar_enhanced_id_cs_req(
+68 -68
View File
@@ -1,11 +1,10 @@
use std::collections::HashMap;
use rand::Rng;
use rogue_magic_battle_unit_info::Item;
use common::{
resources::GAME_RES,
structs::{BattleType, Monster, RogueMagicComponentType},
structs::{BattleType, Monster},
};
use super::*;
@@ -50,7 +49,7 @@ pub async fn on_scene_cast_skill_cs_req(
req: &SceneCastSkillCsReq,
res: &mut SceneCastSkillScRsp,
) {
res.attacked_group_id = req.attacked_group_id;
res.cast_entity_id = req.cast_entity_id;
let targets = req
.hit_target_entity_id_list
@@ -64,9 +63,9 @@ pub async fn on_scene_cast_skill_cs_req(
return;
}
let battle_info = create_battle_info(session, req.caster_id, req.skill_index).await;
let battle_info = create_battle_info(session, req.attacked_by_entity_id, req.skill_index).await;
res.attacked_group_id = req.attacked_group_id;
res.cast_entity_id = req.cast_entity_id;
res.battle_info = Some(battle_info);
}
@@ -133,7 +132,7 @@ async fn create_battle_info(
battle_info.buff_list.push(BattleBuff {
id: avatar_config.weakness_buff_id,
level: 1,
owner_id: *avatar_index,
owner_index: *avatar_index,
wave_flag: 0xffffffff,
dynamic_values: HashMap::from([(
String::from("SkillIndex"),
@@ -151,7 +150,7 @@ async fn create_battle_info(
id: 122401,
level: 3,
wave_flag: 0xffffffff,
owner_id: *avatar_index,
owner_index: *avatar_index,
dynamic_values: HashMap::from([
(String::from("#ADF_1"), 3f32),
(String::from("#ADF_2"), 3f32),
@@ -168,7 +167,7 @@ async fn create_battle_info(
if first_avatar_id != 0 {
for buff in battle_info.buff_list.iter_mut() {
if buff.id == 141202 || buff.id == 141403 {
buff.owner_id = first_avatar_id
buff.owner_index = first_avatar_id
}
}
}
@@ -207,7 +206,7 @@ async fn create_battle_info(
id: blessing.id,
level: blessing.level,
wave_flag: 0xffffffff,
owner_id: 0xffffffff,
owner_index: 0xffffffff,
..Default::default()
};
@@ -296,72 +295,73 @@ async fn create_battle_info(
// SU
if player.battle_config.battle_type == BattleType::SU {
battle_info
.event_battle_info_list
.push(BattleEventBattleInfo {
battle_event_id: player.battle_config.path_resonance_id,
status: Some(BattleEventInitedData {
sp_bar: Some(SpBarInfo {
cur_sp: 10_000,
max_sp: 10_000,
}),
battle_info.battle_event.push(BattleEventBattleInfo {
battle_event_id: player.battle_config.path_resonance_id,
status: Some(BattleEventProperty {
sp_bar: Some(SpBarInfo {
cur_sp: 10_000,
max_sp: 10_000,
}),
skill_info: Vec::with_capacity(0),
})
}),
skill_info: Vec::with_capacity(0),
})
}
// Monsters
battle_info.monster_wave_list = Monster::to_scene_monster_waves(&player.battle_config.monsters);
// Rogue Magic
// TODO: i dont need these shit
if !player.battle_config.scepters.is_empty() {
battle_info.rogue_magic_battle_info = Some(RogueMagicBattleInfo {
player_detail_info: Some(RogueMagicBattleUnitInfo {
item: Some(Item::BattleRogueMagicData(BattleRogueMagicData {
round_cnt: Some(BattleRogueMagicRoundCount {
gpojenhaiba: 3,
kljklbmlefo: 0,
}),
battle_scepter_list: player
.battle_config
.scepters
.iter()
.map(|scepter| {
let mut battle_scepter = BattleRogueMagicScepter {
level: scepter.level,
scepter_id: scepter.id,
magic_list: Vec::new(),
trench_count: HashMap::from([(3, 0), (4, 0), (5, 0)]),
};
let mut index = [0u32; 3];
for component in &scepter.components {
let (slot_type, locked) = match component.component_type {
RogueMagicComponentType::Passive => (3u32, false),
RogueMagicComponentType::Active => (4, true),
RogueMagicComponentType::Attach => (5, false),
};
let slot_index = &mut index[slot_type as usize - 3];
battle_scepter.magic_list.push(BattleRogueMagicUnit {
level: component.level,
unit_id: component.id,
slot_id: *slot_index,
locked,
counter_map: Default::default(),
});
*slot_index += 1;
*battle_scepter.trench_count.get_mut(&slot_type).unwrap() += 1;
}
battle_scepter
})
.collect(),
})),
}),
scepter: Some(Plgjihifpag { egmebanhhnf: 5 }),
});
// battle_info.battle_rogue_magic_info = Some(BattleRogueMagicInfo {
// detail_info: Some(BattleRogueMagicDetailInfo {
// paiigoggofj: Some(Item::BattleRogueMagicData(BattleRogueMagicData {
// round_cnt: Some(BattleRogueMagicRoundCount {
// gpojenhaiba: 3,
// kljklbmlefo: 0,
// }),
// battle_scepter_list: player
// .battle_config
// .scepters
// .iter()
// .map(|scepter| {
// let mut battle_scepter = BattleRogueMagicScepter {
// level: scepter.level,
// scepter_id: scepter.id,
// magic_list: Vec::new(),
// trench_count: HashMap::from([(3, 0), (4, 0), (5, 0)]),
// };
//
// let mut index = [0u32; 3];
//
// for component in &scepter.components {
// let (slot_type, locked) = match component.component_type {
// RogueMagicComponentType::Passive => (3u32, false),
// RogueMagicComponentType::Active => (4, true),
// RogueMagicComponentType::Attach => (5, false),
// };
//
// let slot_index = &mut index[slot_type as usize - 3];
// battle_scepter.magic_list.push(BattleRogueMagicUnit {
// level: component.level,
// unit_id: component.id,
// slot_id: *slot_index,
// locked,
// counter_map: Default::default(),
// });
// *slot_index += 1;
// *battle_scepter.trench_count.get_mut(&slot_type).unwrap() += 1;
// }
//
// battle_scepter
// })
// .collect(),
// })),
// }),
// modifier_content: Some(BattleRogueMagicModifierInfo {
// rogue_magic_battle_const: 5,
// }),
// });
}
// Global Buff
@@ -369,7 +369,7 @@ async fn create_battle_info(
battle_info.buff_list.push(BattleBuff {
id: 140703,
level: 1,
owner_id: u32::MAX,
owner_index: u32::MAX,
wave_flag: u32::MAX,
target_index_list: Vec::with_capacity(0),
dynamic_values: HashMap::with_capacity(0),
+33 -32
View File
@@ -20,7 +20,8 @@ pub async fn on_get_friend_login_info_cs_req(
_req: &GetFriendLoginInfoCsReq,
res: &mut GetFriendLoginInfoScRsp,
) {
res.friend_uid_list = vec![SERVER_UID];
res.cmcilifageb = vec![SERVER_UID];
res.gddmgcalkhc = vec![SERVER_UID];
}
pub async fn on_get_friend_list_info_cs_req(
@@ -28,9 +29,9 @@ pub async fn on_get_friend_list_info_cs_req(
_req: &GetFriendListInfoCsReq,
res: &mut GetFriendListInfoScRsp,
) {
res.friend_list = vec![FriendListInfo {
friend_name: String::from("RobinSR"),
simple_info: Some(PlayerSimpleInfo {
res.friend_list = vec![FriendSimpleInfo {
remark_name: String::from("RobinSR"),
player_info: Some(PlayerSimpleInfo {
uid: SERVER_UID,
platform: PlatformType::Pc.into(),
online_status: FriendOnlineStatus::Online.into(),
@@ -42,7 +43,7 @@ pub async fn on_get_friend_list_info_cs_req(
..Default::default()
}),
is_marked: true,
sent_time: 0,
create_time: 0,
..Default::default()
}];
}
@@ -53,18 +54,18 @@ pub async fn on_get_private_chat_history_cs_req(
res: &mut GetPrivateChatHistoryScRsp,
) {
let cur_time = cur_timestamp_ms();
res.chat_list = SERVER_CHAT_HISTORY
res.chat_message_list = SERVER_CHAT_HISTORY
.iter()
.map(|text| Chat {
msg_type: MsgType::CustomText.into(),
sent_time: cur_time,
text: String::from(*text),
sender_uid: SERVER_UID,
.map(|text| ChatMessageData {
message_type: MsgType::CustomText.into(),
create_time: cur_time,
content: String::from(*text),
sender_id: SERVER_UID,
..Default::default()
})
.collect();
res.to_uid = req.to_uid;
res.from_uid = SERVER_UID;
res.target_side = req.target_side;
res.contact_side = SERVER_UID;
}
pub async fn on_send_msg_cs_req(
@@ -77,19 +78,19 @@ pub async fn on_send_msg_cs_req(
return;
};
if let Some((cmd, args)) = parse_command(&body.text) {
if let Some((cmd, args)) = parse_command(&body.message_text) {
match cmd {
"sync" => {
session.sync_player().await;
session
.send(RevcMsgScNotify {
msg_type: body.msg_type,
text: String::from("Inventory Synced"),
emote: body.emote,
from_uid: SERVER_UID,
to_uid: 25,
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,
hnbepabnbng: body.hnbepabnbng,
dijgjpgfflg: body.dijgjpgfflg.clone(),
})
.await
.unwrap();
@@ -117,13 +118,13 @@ pub async fn on_send_msg_cs_req(
session
.send(RevcMsgScNotify {
msg_type: body.msg_type,
text: format!("Success change mc to {mc:#?}"),
emote: body.emote,
from_uid: SERVER_UID,
to_uid: 25,
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,
hnbepabnbng: body.hnbepabnbng,
dijgjpgfflg: body.dijgjpgfflg.clone(),
})
.await
.unwrap();
@@ -155,13 +156,13 @@ pub async fn on_send_msg_cs_req(
session
.send(RevcMsgScNotify {
msg_type: body.msg_type,
text: format!("Success change march to {march_type:#?}"),
emote: body.emote,
from_uid: SERVER_UID,
to_uid: 25,
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,
hnbepabnbng: body.hnbepabnbng,
dijgjpgfflg: body.dijgjpgfflg.clone(),
})
.await
.unwrap();
+6 -7
View File
@@ -236,7 +236,7 @@ fn equip_relic(player: &mut FreesrData, req: &DressRelicAvatarCsReq) -> Option<P
let mut avatar_ids_to_sy = vec![];
let mut relic_index_to_sync = vec![];
for param in &req.param_list {
for param in &req.switch_list {
let Some(target_relic_idx) = player
.relics
.iter()
@@ -245,10 +245,9 @@ fn equip_relic(player: &mut FreesrData, req: &DressRelicAvatarCsReq) -> Option<P
continue;
};
let cur_avatar_relic_idx = player
.relics
.iter()
.position(|r| r.equip_avatar == target_avatar.avatar_id && r.get_slot() == param.slot);
let cur_avatar_relic_idx = player.relics.iter().position(|r| {
r.equip_avatar == target_avatar.avatar_id && r.get_slot() == param.relic_type
});
// jika avatar sekarang sedang pakai LC, kita tukar pemiliknya dengan pemilik dari LC target
if let Some(cur_avatar_relic_idx) = cur_avatar_relic_idx {
@@ -289,7 +288,7 @@ fn unequip_relic(player: &mut FreesrData, req: &TakeOffRelicCsReq) -> Option<Pla
let mut relic_index_to_sync = vec![];
for slot in &req.slot_list {
for slot in &req.relic_type_list {
let relics = player
.relics
.iter()
@@ -328,7 +327,7 @@ fn build_sync(
.filter_map(|id| player.get_avatar_proto(*id))
.collect::<Vec<_>>();
ret.avatar_sync = Some(AvatarSync { avatar_list });
ret.multi_path_avatar_type_info_list = avatar_ids
ret.multi_path_avatar_info_list = avatar_ids
.into_iter()
.filter_map(|id| player.get_avatar_multipath_proto(id))
.collect();
+5 -5
View File
@@ -76,7 +76,7 @@ pub async fn on_replace_lineup_cs_req(
let lineups = &mut player.lineups;
for (slot, avatar_id) in &mut *lineups {
if let Some(lineup) = req.slots.get(*slot as usize) {
if let Some(lineup) = req.lineup_slot_list.get(*slot as usize) {
*avatar_id = lineup.id;
} else {
*avatar_id = 0;
@@ -131,15 +131,15 @@ async fn refresh_lineup(session: &mut PlayerSession) {
session
.send(SceneGroupRefreshScNotify {
group_refresh_info: vec![SceneGroupRefreshInfo {
group_refresh_list: vec![GroupRefreshInfo {
group_id: 0,
state: 0,
group_refresh_type: SceneGroupRefreshType::Loaded.into(),
refresh_type: SceneGroupRefreshType::Loaded.into(),
refresh_entity: new_entities,
bccgjihncdn: Vec::with_capacity(0),
..Default::default()
}],
floor_id,
gfhglffhfbd: 0,
dimension_id: 0,
})
.await
.unwrap();
+1 -1
View File
@@ -23,7 +23,7 @@ pub async fn on_get_mail_cs_req(
..Default::default()
}],
}),
mail_type: MailType::Normal.into(),
mail_type: 0,
template_id: 0,
}];
}
+13 -13
View File
@@ -43,7 +43,7 @@ use proto::{
CmdMissionType::*, CmdMonopolyType::*, CmdMultiplayerType::*, CmdMultipleDropType::*,
CmdMuseumType::*, CmdOfferingType::*, CmdPamMissionType::*, CmdPhoneType::*,
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSync::*, CmdPlayerType::*,
CmdPlotType::*, CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
CmdRechargeGiftType::*, CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*,
CmdRndOptionType::*, CmdRogueCommonType::*, CmdRogueEndless::*, CmdRogueModifierType::*,
CmdRogueTournType::*, CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*,
@@ -90,7 +90,7 @@ macro_rules! dummy {
dummy! {
// SceneEntityMove,
GetLevelRewardTakenList,
GetRogueScoreRewardInfo,
// GetRogueScoreRewardInfo, // ?3.7.51
// GetGachaInfo,
QueryProductInfo,
GetQuestData,
@@ -98,33 +98,33 @@ dummy! {
// GetFriendListInfo,
// GetFriendApplyListInfo,
GetCurAssist,
GetRogueHandbookData,
// GetRogueHandbookData, // ?3.7.51
GetDailyActiveInfo,
GetFightActivityData,
GetMultipleDropInfo,
GetPlayerReturnMultiDropInfo,
GetShareData,
GetTreasureDungeonActivityData,
PlayerReturnInfoQuery,
// GetMultipleDropInfo, // ?3.7.51
// GetPlayerReturnMultiDropInfo, // ?3.7.51
// GetShareData, // ?3.7.51
// GetTreasureDungeonActivityData, // ?3.7.51
// PlayerReturnInfoQuery, // ?3.7.51
// GetBag,
GetPlayerBoardData,
GetActivityScheduleConfig,
GetMissionData,
GetChallenge,
GetCurChallenge,
GetRogueInfo,
// GetRogueInfo, // ?3.7.51
GetExpeditionData,
// GetRogueDialogueEventData,
GetJukeboxData,
SyncClientResVersion,
DailyFirstMeetPam,
GetMuseumInfo,
// DailyFirstMeetPam, // ?3.7.51
// GetMuseumInfo, // ?3.7.51
GetLoginActivity,
GetRaidInfo,
GetTrialActivityData,
GetBoxingClubInfo,
// GetBoxingClubInfo, // ?3.7.51
GetNpcStatus,
TextJoinQuery,
// TextJoinQuery, // ?3.7.51
// GetSpringRecoverData, // Removed 2.7.51
// GetChatFriendHistory,
GetSecretKeyInfo,
+3 -3
View File
@@ -32,14 +32,14 @@ pub async fn on_player_login_finish_cs_req(
) -> Result<()> {
session
.send(ContentPackageSyncDataScNotify {
data: Some(PackageData {
info_list: [
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,
]
.into_iter()
.map(|v| ContentInfo {
.map(|v| ContentPackageInfo {
status: ContentPackageStatus::Finished.into(),
content_id: v,
})
+33 -31
View File
@@ -46,7 +46,7 @@ pub async fn on_enter_scene_cs_req(
.await
.is_err()
{
res.retcode = Retcode::RetSceneEntryIdNotMatch as u32;
res.retcode = 2605;
};
}
@@ -56,19 +56,19 @@ pub async fn on_get_scene_map_info_cs_req(
res: &mut GetSceneMapInfoScRsp,
) {
for floor_id in &req.floor_id_list {
let mut map_info = MazeMapData {
let mut map_info = SceneMapInfo {
retcode: 0,
unlocked_chest_list: vec![
MazeChest {
map_info_chest_type: MapInfoChestType::Normal.into(),
chest_list: vec![
ChestInfo {
chest_type: 101,
..Default::default()
},
MazeChest {
map_info_chest_type: MapInfoChestType::Puzzle.into(),
ChestInfo {
chest_type: 102,
..Default::default()
},
MazeChest {
map_info_chest_type: MapInfoChestType::Challenge.into(),
ChestInfo {
chest_type: 104,
..Default::default()
},
],
@@ -94,37 +94,39 @@ pub async fn on_get_scene_map_info_cs_req(
});
for teleport in group.teleports.keys() {
map_info.unlocked_teleport_list.push(*teleport)
map_info.unlock_teleport_list.push(*teleport)
}
for prop in &group.props {
map_info.maze_prop_list.push(MazeProp {
map_info.maze_prop_list.push(MazePropState {
group_id: prop.group_id,
state: prop.prop_state,
config_id: prop.inst_id,
});
map_info.maze_prop_extra_list.push(MazePropExtra {
group_id: prop.group_id,
state: prop.prop_state,
config_id: prop.inst_id,
extra_info: Option::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.lighten_section_list = floor_config.sections.clone();
map_info.floor_saved_data = floor_config.saved_values.clone();
// TODO!
map_info
.chest_unlock_progress_list
.push(ChestUnlockProgress {
r#type: 0,
total_chest_count: 25,
unlocked_chest_count: 25,
});
// #TODO!
// map_info
// .chest_unlock_progress_list
// .push(ChestUnlockProgress {
// r#type: 0,
// total_chest_count: 25,
// unlocked_chest_count: 25,
// });
}
res.map_list.push(map_info)
res.scene_map_info.push(map_info)
}
}
@@ -170,7 +172,7 @@ pub async fn on_get_entered_scene_cs_req(
_req: &GetEnteredSceneCsReq,
res: &mut GetEnteredSceneScRsp,
) {
res.entered_scene_info = GAME_RES
res.entered_scene_info_list = GAME_RES
.level_output_configs
.iter()
.flat_map(|(_, v)| {
@@ -249,13 +251,13 @@ async fn load_scene(
scene.world_id
},
lighten_section_list: scene.sections.clone(),
chest_id_list: scene
lddigmlcgdb: scene
.scenes
.values()
.flat_map(|v| v.chests.clone())
.collect::<Vec<_>>(),
scene_mission_info: Some(MissionStatusBySceneInfo {
finished_mission_id_list: scene
finished_main_mission_id_list: scene
.scenes
.values()
.flat_map(|s| s.finished_main_missions.clone())
@@ -392,7 +394,7 @@ async fn load_scene(
scene_info.entity_group_list.push(group_info);
scene_info.group_state_list.push(SceneGroupState {
scene_info.clecmgljocl.push(SceneGroupState {
group_id: *group_id,
is_default: true,
state: 0,
@@ -403,7 +405,7 @@ async fn load_scene(
scene_info.entity_group_list.push(SceneEntityGroupInfo {
state: 0,
group_id: 0,
hejamoojbcj: HashMap::with_capacity(0),
jnajakchjdf: HashMap::with_capacity(0),
entity_list: json
.lineups
.iter()
+1 -1
View File
@@ -17,7 +17,7 @@ use proto::{
CmdMissionType::*, CmdMonopolyType::*, CmdMultiplayerType::*, CmdMultipleDropType::*,
CmdMuseumType::*, CmdOfferingType::*, CmdPamMissionType::*, CmdPhoneType::*,
CmdPlayerBoardType::*, CmdPlayerReturnType::*, CmdPlayerSync::*, CmdPlayerType::*,
CmdPlotType::*, CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
CmdPunkLordType::*, CmdQuestType::*, CmdRaidCollectionType::*, CmdRaidType::*,
CmdRecommendType::*, CmdRedDotType::*, CmdReplayType::*, CmdRndOptionType::*,
CmdRogueCommonType::*, CmdRogueEndless::*, CmdRogueModifierType::*, CmdRogueTournType::*,
CmdRogueType::*, CmdRollShopType::*, CmdSceneType::*, CmdServerPrefsType::*, CmdShopType::*,
+8 -7
View File
@@ -10,7 +10,7 @@ use anyhow::Result;
use common::sr_tools::FreesrData;
use mhy_kcp::Kcp;
use prost::Message;
use proto::{AvatarSync, CmdID, CmdPlayerType, PlayerSyncScNotify};
use proto::{AvatarSync, CmdID, PlayerSyncScNotify};
use tokio::{
io::AsyncWrite,
net::UdpSocket,
@@ -70,11 +70,12 @@ impl PlayerSession {
drop(kcp);
for packet in packets {
if packet.cmd_type == CmdPlayerType::CmdPlayerLogoutCsReq as u16 {
tracing::info!("Player logged out");
let _ = self.shutdown_tx.send(());
return Ok(());
};
// #TODO
// 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?;
}
@@ -140,7 +141,7 @@ impl PlayerSession {
.map(|avatar| avatar.to_avatar_proto(Option::None, vec![]))
.collect::<Vec<_>>(),
}),
multi_path_avatar_type_info_list: json.get_multi_path_info(),
multi_path_avatar_info_list: json.get_multi_path_info(),
..Default::default()
})
.await
+58889 -61327
View File
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -3,7 +3,7 @@ use std::sync::Arc;
use crate::AppState;
use axum::extract::{Query, State};
use prost::Message;
use proto::{DispatchRegionData, Gateserver, RegionEntry};
use proto::{Dispatch, Gateserver, RegionInfo};
use serde::Deserialize;
use tokio::sync::RwLock;
use tracing::instrument;
@@ -13,12 +13,12 @@ pub const QUERY_GATEWAY_ENDPOINT: &str = "/query_gateway";
#[tracing::instrument]
pub async fn query_dispatch() -> String {
let rsp = DispatchRegionData {
let rsp = Dispatch {
retcode: 0,
region_list: vec![RegionEntry {
region_list: vec![RegionInfo {
name: String::from("RobinSR"),
title: String::from("RobinSR"),
env_type: String::from("21"),
env_type: String::from("9"),
dispatch_url: String::from("http://127.0.0.1:21000/query_gateway"),
..Default::default()
}],
@@ -48,23 +48,23 @@ pub async fn query_gateway(
.await;
let rsp = Gateserver {
retcode: 0,
ip: String::from("127.0.0.1"),
port: 23301,
asset_bundle_url: config.asset_bundle_url.clone(),
asset_bundle_url_android: config.asset_bundle_url.clone(),
ex_resource_url: config.ex_resource_url.clone(),
lua_url: config.lua_url.clone(),
ifix_version: String::from("0"),
enable_design_data_version_update: true,
enable_version_update: true,
enable_upload_battle_log: true,
network_diagnostic: true,
close_redeem_code: true,
enable_android_middle_package: true,
enable_watermark: true,
event_tracking_open: true,
enable_cdn_ipv6: 1,
enable_save_replay_file: true,
unk1: true,
unk2: true,
unk3: true,
unk4: true,
unk5: true,
unk6: true,
unk7: true,
unk8: true,
unk9: true,
unk10: true,
..Default::default()
};