Implement data transfer from global to jp

This commit is contained in:
Ethan O'Brien
2024-05-04 14:25:23 -05:00
parent 461ef4b352
commit 72f05a5d52
4 changed files with 21 additions and 36 deletions

View File

@@ -10,6 +10,7 @@ use base64::{Engine as _, engine::general_purpose};
use crate::router::userdata;
use lazy_static::lazy_static;
use rand::Rng;
use uuid::Uuid;
pub const ASSET_VERSION: &str = "cb87bc1468c8631a262ff65b2960470b";
pub const ASSET_HASH_ANDROID: &str = "4715e873031ae4abc3c625e2bd8c935b";
@@ -34,6 +35,10 @@ pub fn get_item_info(id: i64) -> JsonValue {
ITEM_INFO[id.to_string()].clone()
}
pub fn create_token() -> String {
format!("{}", Uuid::now_v7())
}
pub fn remove_gems(user: &mut JsonValue, amount: i64) {
let mut amount = amount;
let mut free = user["gem"]["free"].as_i64().unwrap();