mirror of
https://git.neonteam.dev/amizing/robinsr.git
synced 2025-03-12 03:28:30 -04:00
chore: cargo clippy
This commit is contained in:
parent
3389799c26
commit
71ad8e9691
@ -12,24 +12,37 @@ use super::*;
|
|||||||
|
|
||||||
pub async fn on_start_cocoon_stage_cs_req(
|
pub async fn on_start_cocoon_stage_cs_req(
|
||||||
_session: &mut PlayerSession,
|
_session: &mut PlayerSession,
|
||||||
body: &StartCocoonStageCsReq,
|
req: &StartCocoonStageCsReq,
|
||||||
res: &mut StartCocoonStageScRsp,
|
res: &mut StartCocoonStageScRsp,
|
||||||
) {
|
) {
|
||||||
let battle_info = create_battle_info(0, 0).await;
|
let battle_info = create_battle_info(0, 0).await;
|
||||||
|
|
||||||
res.prop_entity_id = body.prop_entity_id;
|
res.prop_entity_id = req.prop_entity_id;
|
||||||
res.cocoon_id = body.cocoon_id;
|
res.cocoon_id = req.cocoon_id;
|
||||||
res.wave = body.wave;
|
res.wave = req.wave;
|
||||||
|
res.battle_info = Some(battle_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn on_quick_start_cocoon_stage_cs_req(
|
||||||
|
_session: &mut PlayerSession,
|
||||||
|
req: &QuickStartCocoonStageCsReq,
|
||||||
|
res: &mut QuickStartCocoonStageScRsp,
|
||||||
|
) {
|
||||||
|
let mut battle_info = create_battle_info(0, 0).await;
|
||||||
|
|
||||||
|
battle_info.world_level = req.world_level;
|
||||||
|
res.cocoon_id = req.cocoon_id;
|
||||||
|
res.wave = req.wave;
|
||||||
res.battle_info = Some(battle_info);
|
res.battle_info = Some(battle_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn on_pve_battle_result_cs_req(
|
pub async fn on_pve_battle_result_cs_req(
|
||||||
_session: &mut PlayerSession,
|
_session: &mut PlayerSession,
|
||||||
body: &PveBattleResultCsReq,
|
req: &PveBattleResultCsReq,
|
||||||
res: &mut PveBattleResultScRsp,
|
res: &mut PveBattleResultScRsp,
|
||||||
) {
|
) {
|
||||||
res.end_status = body.end_status;
|
res.end_status = req.end_status;
|
||||||
res.battle_id = body.battle_id;
|
res.battle_id = req.battle_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn on_scene_cast_skill_cs_req(
|
pub async fn on_scene_cast_skill_cs_req(
|
||||||
@ -62,6 +75,7 @@ async fn create_battle_info(caster_id: u32, skill_index: u32) -> SceneBattleInfo
|
|||||||
logic_random_seed: rand::thread_rng().gen::<u32>(),
|
logic_random_seed: rand::thread_rng().gen::<u32>(),
|
||||||
battle_id: 1,
|
battle_id: 1,
|
||||||
rounds_limit: player.battle_config.cycle_count,
|
rounds_limit: player.battle_config.cycle_count,
|
||||||
|
world_level: 6,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -267,7 +281,7 @@ async fn create_battle_info(caster_id: u32, skill_index: u32) -> SceneBattleInfo
|
|||||||
max_sp: 10_000,
|
max_sp: 10_000,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
skill_info: Vec::with_capacity(0)
|
skill_info: Vec::with_capacity(0),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -207,6 +207,7 @@ trait_handler! {
|
|||||||
StartCocoonStage;
|
StartCocoonStage;
|
||||||
PveBattleResult;
|
PveBattleResult;
|
||||||
SceneCastSkill;
|
SceneCastSkill;
|
||||||
|
QuickStartCocoonStage;
|
||||||
|
|
||||||
// Teleport
|
// Teleport
|
||||||
GetEnteredScene;
|
GetEnteredScene;
|
||||||
|
|||||||
@ -492,7 +492,7 @@ impl<Output> Kcp<Output> {
|
|||||||
let count = if buf.len() <= self.mss {
|
let count = if buf.len() <= self.mss {
|
||||||
1
|
1
|
||||||
} else {
|
} else {
|
||||||
(buf.len() + self.mss - 1) / self.mss
|
buf.len().div_ceil(self.mss)
|
||||||
};
|
};
|
||||||
|
|
||||||
if count >= KCP_WND_RCV as usize {
|
if count >= KCP_WND_RCV as usize {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(warnings)]
|
||||||
include!("../out/_.rs");
|
include!("../out/_.rs");
|
||||||
|
|
||||||
pub use prost::DecodeError as ProtobufDecodeError;
|
pub use prost::DecodeError as ProtobufDecodeError;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user