From 0b8de2b4bc8ac4d9167750ca0a2d87df471127f7 Mon Sep 17 00:00:00 2001 From: mokurin000 <1348292515a@gmail.com> Date: Thu, 31 Jul 2025 22:30:59 +0800 Subject: [PATCH] fix: logout without custom timestamp is useless --- sdgb-cli/src/commands.rs | 10 ++++++++++ sdgb-cli/src/main.rs | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sdgb-cli/src/commands.rs b/sdgb-cli/src/commands.rs index 68aefca..4122fb2 100644 --- a/sdgb-cli/src/commands.rs +++ b/sdgb-cli/src/commands.rs @@ -31,11 +31,14 @@ pub enum Commands { variant: AuthLiteVariant, }, + // below are login-free Ping, Preview { #[arg(short, long)] user_id: u32, }, + + // below requires login Userdata { #[arg(short, long)] user_id: u32, @@ -52,5 +55,12 @@ pub enum Commands { Logout { #[arg(short, long)] user_id: u32, + /// Second-precision login unix timestamp, must be the same as on `login` + /// + /// For official arcades, it's commonly the time `amdaemon.exe` starts + /// + /// For unofficial clients, it depends. + #[arg(short, long)] + timestamp: u64, }, } diff --git a/sdgb-cli/src/main.rs b/sdgb-cli/src/main.rs index 99f5005..f0f93dc 100644 --- a/sdgb-cli/src/main.rs +++ b/sdgb-cli/src/main.rs @@ -54,13 +54,14 @@ async fn main() -> Result<(), Box> { // TODO: refactor via enum_dispatch match command { - commands::Commands::Logout { user_id } => { + commands::Commands::Logout { user_id, timestamp } => { let logout: UserLogoutApiResp = Sdgb1_50::request( &client, APIMethod::UserLogoutApi, user_id, UserLogoutApi { user_id, + date_time: timestamp, ..Default::default() }, )