use common::util;

use super::*;

pub async fn on_get_server_timestamp(
    _session: &NetSession,
    _player: &mut Player,
    _req: GetServerTimestampCsReq,
) -> NetResult<GetServerTimestampScRsp> {
    Ok(GetServerTimestampScRsp {
        retcode: Retcode::RetSucc.into(),
        timestamp: util::cur_timestamp_ms(),
        utc_offset: 3,
    })
}

pub async fn on_get_authkey(
    _session: &NetSession,
    _player: &mut Player,
    _req: GetAuthkeyCsReq,
) -> NetResult<GetAuthkeyScRsp> {
    Ok(GetAuthkeyScRsp::default())
}

pub async fn on_get_cut_scene_key_info(
    _session: &NetSession,
    _player: &mut Player,
    _req: GetCutSceneKeyInfoCsReq,
) -> NetResult<GetCutSceneKeyInfoScRsp> {
    Ok(GetCutSceneKeyInfoScRsp {
        key_map: data::usm_key_map().clone(),
        retcode: Retcode::RetSucc.into(),
    })
}
