mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Fix unknown consume type 0
This commit is contained in:
parent
a31d3b06d7
commit
33737819a5
3 changed files with 6 additions and 4 deletions
|
@ -106,7 +106,9 @@ pub fn give_item(master_item_id: i64, amount: i64, user: &mut JsonValue) -> bool
|
|||
}
|
||||
|
||||
pub fn use_item(item: &JsonValue, multiplier: i64, user: &mut JsonValue) {
|
||||
if item["consumeType"] == 1 {
|
||||
if item["consumeType"] == 0 {
|
||||
// Is anything really ever free...?
|
||||
} else if item["consumeType"] == 1 {
|
||||
remove_gems(user, item["amount"].as_i64().unwrap());
|
||||
} else if item["consumeType"] == 4 {
|
||||
use_itemm(item["value"].as_i64().unwrap(), item["amount"].as_i64().unwrap() * multiplier, user);
|
||||
|
|
|
@ -102,7 +102,7 @@ pub fn lottery(_req: HttpRequest) -> Option<JsonValue> {
|
|||
pub fn lottery_post(req: HttpRequest, body: String) -> Option<JsonValue> {
|
||||
let key = global::get_login(req.headers(), &body);
|
||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||
println!("lottery: {}", body);
|
||||
//println!("lottery: {}", body);
|
||||
let mut user = userdata::get_acc(&key);
|
||||
let user2 = userdata::get_acc(&key);
|
||||
let mut missions = userdata::get_acc_missions(&key);
|
||||
|
|
|
@ -109,7 +109,7 @@ pub fn gift(req: HttpRequest, body: String) -> Option<JsonValue> {
|
|||
pub fn user_post(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);
|
||||
|
||||
if !body["name"].is_null() {
|
||||
|
@ -148,7 +148,7 @@ pub fn user_post(req: HttpRequest, body: String) -> Option<JsonValue> {
|
|||
}
|
||||
|
||||
userdata::save_acc(&key, user.clone());
|
||||
|
||||
|
||||
Some(object!{
|
||||
"user": user["user"].clone(),
|
||||
"clear_mission_ids": []
|
||||
|
|
Loading…
Add table
Reference in a new issue