fix: logout without custom timestamp is useless
This commit is contained in:
@@ -31,11 +31,14 @@ pub enum Commands {
|
|||||||
variant: AuthLiteVariant,
|
variant: AuthLiteVariant,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// below are login-free
|
||||||
Ping,
|
Ping,
|
||||||
Preview {
|
Preview {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
user_id: u32,
|
user_id: u32,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// below requires login
|
||||||
Userdata {
|
Userdata {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
user_id: u32,
|
user_id: u32,
|
||||||
@@ -52,5 +55,12 @@ pub enum Commands {
|
|||||||
Logout {
|
Logout {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
user_id: u32,
|
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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,13 +54,14 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
|||||||
|
|
||||||
// TODO: refactor via enum_dispatch
|
// TODO: refactor via enum_dispatch
|
||||||
match command {
|
match command {
|
||||||
commands::Commands::Logout { user_id } => {
|
commands::Commands::Logout { user_id, timestamp } => {
|
||||||
let logout: UserLogoutApiResp = Sdgb1_50::request(
|
let logout: UserLogoutApiResp = Sdgb1_50::request(
|
||||||
&client,
|
&client,
|
||||||
APIMethod::UserLogoutApi,
|
APIMethod::UserLogoutApi,
|
||||||
user_id,
|
user_id,
|
||||||
UserLogoutApi {
|
UserLogoutApi {
|
||||||
user_id,
|
user_id,
|
||||||
|
date_time: timestamp,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user