mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-06-30 21:27:33 -05:00
Ignore /api/tutorial requests when tutorial is already completed
This commit is contained in:
parent
6a98949f77
commit
21849b2322
1 changed files with 7 additions and 6 deletions
|
@ -8,12 +8,13 @@ pub fn tutorial(req: HttpRequest, body: String) -> Option<JsonValue> {
|
|||
let key = global::get_login(req.headers(), &body);
|
||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||
let mut user = userdata::get_acc(&key);
|
||||
|
||||
user["tutorial_step"] = body["step"].clone();
|
||||
user["stamina"]["stamina"] = (100).into();
|
||||
user["stamina"]["last_updated_time"] = global::timestamp().into();
|
||||
|
||||
userdata::save_acc(&key, user);
|
||||
|
||||
if user["tutorial_step"].as_i32().unwrap() < 130 {
|
||||
user["tutorial_step"] = body["step"].clone();
|
||||
user["stamina"]["stamina"] = (100).into();
|
||||
user["stamina"]["last_updated_time"] = global::timestamp().into();
|
||||
userdata::save_acc(&key, user);
|
||||
}
|
||||
|
||||
Some(array![])
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue