JaneDoe-ZS/nap_gameserver/src/handlers/perform.rs
xeon 970dde020a Working OpenUI interacts and Archive battles
Implement OpenUI interacts (currently configs only for Yorozuya and Archive)
Fully working Archive (battles and cutscenes)
2024-07-30 03:04:55 +03:00

51 lines
1.3 KiB
Rust

use crate::logic::{
game::{GameInstance, LogicError},
procedure::ProcedureAction,
};
use super::*;
pub async fn on_perform_trigger(
_session: &NetSession,
player: &mut Player,
req: PerformTriggerCsReq,
) -> NetResult<PerformTriggerScRsp> {
if let GameInstance::Fresh(fresh_game) = &mut player.game_instance {
fresh_game
.procedure_mgr
.on_action(ProcedureAction::PerformTrigger)
.map_err(LogicError::from)?;
}
Ok(PerformTriggerScRsp {
retcode: Retcode::RetSucc.into(),
perform_uid: ((req.perform_type as i64) << 32) | req.perform_id as i64,
})
}
pub async fn on_perform_end(
_session: &NetSession,
player: &mut Player,
_req: PerformEndCsReq,
) -> NetResult<PerformEndScRsp> {
if let GameInstance::Fresh(fresh_game) = &mut player.game_instance {
fresh_game
.procedure_mgr
.on_action(ProcedureAction::PerformEnd)
.map_err(LogicError::from)?;
}
Ok(PerformEndScRsp {
retcode: Retcode::RetSucc.into(),
})
}
pub async fn on_perform_jump(
_session: &NetSession,
_player: &mut Player,
_req: PerformJumpCsReq,
) -> NetResult<PerformJumpScRsp> {
Ok(PerformJumpScRsp {
retcode: Retcode::RetSucc.into(),
})
}