mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-07-12 16:52:18 +08:00
Fix time overflow
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -678,7 +678,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ew"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
dependencies = [
|
||||
"actix-web",
|
||||
"aes",
|
||||
|
||||
@@ -161,7 +161,9 @@ pub fn set_time(current_time: u64, uid: i64, max: bool) -> u64 {
|
||||
return current_time;
|
||||
}
|
||||
|
||||
let time_since_set = current_time - time_set;
|
||||
let time_since_set = if current_time > time_set {
|
||||
current_time - time_set
|
||||
} else { 0 };
|
||||
return server_time + time_since_set;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user