nvm its supposed to be like this

This commit is contained in:
Ethan O'Brien 2024-05-04 21:29:25 -05:00
parent c55b24be16
commit eb96e33a90

View file

@ -19,20 +19,6 @@ pub fn serial_code(req: HttpRequest, body: String) -> HttpResponse {
let key = global::get_login(req.headers(), &body); let key = global::get_login(req.headers(), &body);
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap(); let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
let mut user = userdata::get_acc_home(&key); let mut user = userdata::get_acc_home(&key);
let mut data = userdata::get_server_data(&key);
if data["last_serial_code"].as_u64().unwrap_or(0) + 5 > global::timestamp() {
let resp = object!{
"code": 0,
"server_time": global::timestamp(),
"data": {
"result_code": 3
}
};
return global::send(resp, req);
}
data["last_serial_code"] = global::timestamp().into();
userdata::save_server_data(&key, data);
let itemz; let itemz;
if body["input_code"].to_string() == "SIF2REVIVALREAL!" { if body["input_code"].to_string() == "SIF2REVIVALREAL!" {
@ -180,7 +166,9 @@ pub fn serial_code(req: HttpRequest, body: String) -> HttpResponse {
return global::send(resp, req); return global::send(resp, req);
} }
userdata::save_acc_home(&key, user.clone()); if body["receive_flg"].as_i32().unwrap_or(0) != 1 {
userdata::save_acc_home(&key, user.clone());
}
let resp = object!{ let resp = object!{
"code": 0, "code": 0,