forked from endernon/JadeSR-origin-DONOTUSE
Compare commits
No commits in common. "fa261307006bbbf6340057094d628c48a8a3e1c3" and "90ff2ffe71683aa95559d6fae04d3d060312ecf7" have entirely different histories.
fa26130700
...
90ff2ffe71
7 changed files with 86 additions and 92 deletions
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="EMPTY_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/common/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/dispatch/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/gameserver/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/proto/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/sdkserver/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/xtask/src" isTestSource="false" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -2,7 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/JadeSR-WithInventory.iml" filepath="$PROJECT_DIR$/.idea/JadeSR-WithInventory.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/JadeSR-fork.iml" filepath="$PROJECT_DIR$/.idea/JadeSR-fork.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -6,9 +6,6 @@ version.workspace = true
|
||||||
[dependencies]
|
[dependencies]
|
||||||
common.workspace = true
|
common.workspace = true
|
||||||
|
|
||||||
serde = "1.0"
|
|
||||||
serde_json = "1.0"
|
|
||||||
|
|
||||||
ansi_term.workspace = true
|
ansi_term.workspace = true
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
atomic_refcell.workspace = true
|
atomic_refcell.workspace = true
|
||||||
|
|
|
@ -1,76 +1,94 @@
|
||||||
use anyhow::Result;
|
|
||||||
use proto::*;
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::game::globals;
|
use crate::game::globals;
|
||||||
use serde_json::json;
|
|
||||||
use serde_json::Value;
|
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
use crate::{net::PlayerSession, util};
|
pub async fn on_start_cocoon_stage_cs_req(
|
||||||
|
session: &PlayerSession,
|
||||||
|
body: &StartCocoonStageCsReq,
|
||||||
|
) -> Result<()> {
|
||||||
|
let player_info = session.player_info();
|
||||||
|
|
||||||
pub async fn on_get_bag_cs_req(session: &PlayerSession, _: &GetBagCsReq) -> Result<()> {
|
let rsp = StartCocoonStageScRsp {
|
||||||
let json_data = fs::read_to_string("PATH HERE").expect("Failed to read inventory.json");
|
retcode: 0,
|
||||||
let json_value: Value = serde_json::from_str(&json_data).expect("Failed to parse JSON data");
|
prop_entity_id: body.prop_entity_id,
|
||||||
|
cocoon_id: body.cocoon_id,
|
||||||
|
wave: body.wave,
|
||||||
|
battle_info: Some(SceneBattleInfo {
|
||||||
|
stage_id: 201012311,
|
||||||
|
logic_random_seed: 4444,
|
||||||
|
battle_id: 1,
|
||||||
|
battle_avatar_list: player_info
|
||||||
|
.lineup
|
||||||
|
.avatar_list
|
||||||
|
.iter()
|
||||||
|
.map(|avatar| BattleAvatar {
|
||||||
|
index: avatar.slot,
|
||||||
|
id: if avatar.id == 8001 {
|
||||||
|
player_info.hero_basic_type as u32
|
||||||
|
} else {
|
||||||
|
avatar.id
|
||||||
|
},
|
||||||
|
level: 80,
|
||||||
|
promotion: 6,
|
||||||
|
rank: 6,
|
||||||
|
hp: 10000,
|
||||||
|
avatar_type: 3,
|
||||||
|
sp: Some(AmountInfo {
|
||||||
|
cur_amount: 10000,
|
||||||
|
max_amount: 10000,
|
||||||
|
}),
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
monster_wave_list: globals
|
||||||
|
.monster_wave_list
|
||||||
|
.iter()
|
||||||
|
.map(|monster_list| SceneMonsterWave {
|
||||||
|
monster_list: monster_list
|
||||||
|
.iter()
|
||||||
|
.map(|id| SceneMonsterData {
|
||||||
|
monster_id: *id,
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
..Default::default()
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
// Extract ranks
|
session.send(CMD_START_COCOON_STAGE_SC_RSP, rsp).await
|
||||||
let r1: u32 = json_value[0]["rank"].as_i64().expect("Failed to get rank for Equipment1") as u32;
|
}
|
||||||
let r2: u32 = json_value[1]["rank"].as_i64().expect("Failed to get rank for Equipment2") as u32;
|
|
||||||
let t1: u32 = json_value[0]["tid"].as_i64().expect("Failed") as u32;
|
pub async fn on_get_cur_battle_info_cs_req(
|
||||||
let t2: u32 = json_value[1]["tid"].as_i64().expect("Failed") as u32;
|
session: &PlayerSession,
|
||||||
let l1: u32 = json_value[0]["level"].as_i64().expect("Failed") as u32;
|
_body: &GetCurBattleInfoCsReq,
|
||||||
let l2: u32 = json_value[0]["level"].as_i64().expect("Failed") as u32;
|
) -> Result<()> {
|
||||||
//let e_rank3: u32 = json_value[2]["rank"].as_i64().expect("Failed to get rank for Equipment3") as u32;
|
|
||||||
session
|
session
|
||||||
.send(
|
.send(
|
||||||
CMD_GET_BAG_SC_RSP,
|
CMD_GET_CUR_BATTLE_INFO_SC_RSP,
|
||||||
GetBagScRsp {
|
GetCurBattleInfoScRsp {
|
||||||
kkdobdmaipc: vec![],
|
battle_info: Some(SceneBattleInfo::default()),
|
||||||
fllcfpejibd: vec![],
|
ffbpkghgmjm: Some(Fjojkdhlonn::default()),
|
||||||
lgjeabihdpn: vec![],
|
..Default::default()
|
||||||
retcode: 0,
|
},
|
||||||
equipment_list: vec![
|
)
|
||||||
Equipment {tid: t1, rank: r1, exp: 0, unique_id: 57, promotion: 6, level: l1, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
.await
|
||||||
Equipment {tid: t2, rank: r2, exp: 0, unique_id: 58, promotion: 6, level: l2, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
}
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 59, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 60, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
pub async fn on_pve_battle_result_cs_req(
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 61, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
session: &PlayerSession,
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 62, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
body: &PveBattleResultCsReq,
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 63, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
) -> Result<()> {
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 64, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
session
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 65, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
.send(
|
||||||
Equipment {tid: 23024, rank: 5, exp: 0, unique_id: 66, promotion: 6, level: 80, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
CMD_P_V_E_BATTLE_RESULT_SC_RSP,
|
||||||
Equipment {tid: 23024, rank: 1, exp: 0, unique_id: 67, promotion: 0, level: 1, base_avatar_id: 0, is_protected: true, ..Default::default()},
|
PveBattleResultScRsp {
|
||||||
//Equipment {tid: 1, rank: 1, exp: 0, unique_id: 59, promotion: 6, level: 1, base_avatar_id: 0, is_protected: true, ..Default::default()}
|
retcode: 0,
|
||||||
],
|
end_status: body.end_status,
|
||||||
mbedbdbmekj: 0,
|
battle_id: body.battle_id,
|
||||||
relic_list: vec![
|
..Default::default()
|
||||||
Relic {
|
},
|
||||||
unique_id: 1488,
|
|
||||||
base_avatar_id: 1315, // avatar id
|
|
||||||
tid: 61202,
|
|
||||||
level: 15, is_protected: true,
|
|
||||||
main_affix_id: 1,
|
|
||||||
sub_affix_list: vec![ RelicAffix { affix_id: 7, cnt: 830, step: 20 }], ..Default::default() }
|
|
||||||
],
|
|
||||||
odeefdlejgg: vec![],
|
|
||||||
niemagjlpdl: vec![],
|
|
||||||
gddpphikjae: vec![],
|
|
||||||
macfjibhfad: vec![],
|
|
||||||
clkjaanbfpp: vec![ 101 ],
|
|
||||||
// .iter()
|
|
||||||
// .map(|id| {
|
|
||||||
// // {
|
|
||||||
// // tid: *id,
|
|
||||||
// // num: 500
|
|
||||||
// // }
|
|
||||||
// })
|
|
||||||
// .collect(),
|
|
||||||
biahmcppikj: vec![],
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|
||||||
// let rsp = GetBagScRsp {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
|
@ -1,4 +0,0 @@
|
||||||
[
|
|
||||||
{"tid": 23002, "rank": 3, "exp": 0, "unique_id": 57, "promotion": 6, "level": 75, "base_avatar_id": 0, "is_protected": true},
|
|
||||||
{"tid": 23015, "rank": 4, "exp": 0, "unique_id": 58, "promotion": 6, "level": 80, "base_avatar_id": 0, "is_protected": true}
|
|
||||||
]
|
|
|
@ -105,7 +105,7 @@ dummy! {
|
||||||
GetShareData,
|
GetShareData,
|
||||||
GetTreasureDungeonActivityData,
|
GetTreasureDungeonActivityData,
|
||||||
PlayerReturnInfoQuery,
|
PlayerReturnInfoQuery,
|
||||||
//GetBag,
|
GetBag,
|
||||||
GetPlayerBoardData,
|
GetPlayerBoardData,
|
||||||
GetActivityScheduleConfig,
|
GetActivityScheduleConfig,
|
||||||
GetMissionData,
|
GetMissionData,
|
||||||
|
|
|
@ -118,5 +118,4 @@ trait_handler! {
|
||||||
GetTutorialGuideCsReq 1691;
|
GetTutorialGuideCsReq 1691;
|
||||||
UnlockTutorialGuideCsReq 1630;
|
UnlockTutorialGuideCsReq 1630;
|
||||||
GetTutorialCsReq 1661;
|
GetTutorialCsReq 1661;
|
||||||
GetBagCsReq 561;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue