mirror of
https://github.com/yoncodes/BD2PS.git
synced 2026-08-05 06:12:14 +02:00
21 lines
561 B
Rust
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)
|
|
}
|