Files
BD2PS/gameserver/src/logic/game/server_now_time.rs
yoncodes e58fd190b4 pushing
2025-10-28 21:21:28 -04:00

21 lines
561 B
Rust

use bd2::prost::Message;
use bd2::proto::proto_net::{ServerNowTimeRequest, ServerNowTimeResponse};
use crypto::network::BaseResponse;
use sqlx::SqlitePool;
use tracing::info;
pub async fn handle(_pool: &SqlitePool, _uid: i64, req: ServerNowTimeRequest) -> BaseResponse {
info!("Handling ServerNowTimeRequest: {:?}", req);
let now_ms = chrono::Utc::now().timestamp_millis();
let response = ServerNowTimeResponse {
server_time: Some(now_ms),
};
let resp_bytes = response.encode_to_vec();
BaseResponse::success(&resp_bytes)
}