Send updated master_music_ids

This commit is contained in:
Ethan O'Brien 2024-04-28 21:35:25 -05:00
parent c9376f754d
commit 27649daf38
3 changed files with 11 additions and 4 deletions

View file

@ -21,7 +21,7 @@ use openssl::hash::MessageDigest;
use openssl::sign::Verifier; use openssl::sign::Verifier;
lazy_static! { lazy_static! {
pub static ref ENGINE: Mutex<Option<Connection>> = Mutex::new(None); static ref ENGINE: Mutex<Option<Connection>> = Mutex::new(None);
} }
fn init(engine: &mut MutexGuard<'_, Option<Connection>>) { fn init(engine: &mut MutexGuard<'_, Option<Connection>>) {
let conn = Connection::open("gree.db").unwrap(); let conn = Connection::open("gree.db").unwrap();

View file

@ -7,7 +7,10 @@ use uuid::Uuid;
use rand::Rng; use rand::Rng;
lazy_static! { lazy_static! {
pub static ref ENGINE: Mutex<Option<Connection>> = Mutex::new(None); static ref ENGINE: Mutex<Option<Connection>> = Mutex::new(None);
static ref NEW_USER: JsonValue = {
json::parse(include_str!("new_user.json")).unwrap()
};
} }
fn init(engine: &mut MutexGuard<'_, Option<Connection>>) { fn init(engine: &mut MutexGuard<'_, Option<Connection>>) {
@ -159,7 +162,7 @@ fn generate_uid() -> i64 {
fn create_acc(uid: i64, login: &str) { fn create_acc(uid: i64, login: &str) {
create_users_store(); create_users_store();
let mut new_user = json::parse(include_str!("new_user.json")).unwrap(); let mut new_user = NEW_USER.clone();
new_user["user"]["id"] = uid.into(); new_user["user"]["id"] = uid.into();
new_user["stamina"]["last_updated_time"] = global::timestamp().into(); new_user["stamina"]["last_updated_time"] = global::timestamp().into();
@ -208,6 +211,10 @@ fn get_data(auth_key: &str, row: &str) -> JsonValue {
pub fn get_acc(auth_key: &str) -> JsonValue { pub fn get_acc(auth_key: &str) -> JsonValue {
let mut user = get_data(auth_key, "userdata"); let mut user = get_data(auth_key, "userdata");
user["gem"]["total"] = (user["gem"]["charge"].as_i64().unwrap() + user["gem"]["free"].as_i64().unwrap()).into(); user["gem"]["total"] = (user["gem"]["charge"].as_i64().unwrap() + user["gem"]["free"].as_i64().unwrap()).into();
if user["master_music_ids"].len() != 637 {
user["master_music_ids"] = NEW_USER["master_music_ids"].clone();
}
global::lp_modification(&mut user, 0, false); global::lp_modification(&mut user, 0, false);
return user; return user;
} }

View file

@ -48,7 +48,7 @@
"story_list": [], "story_list": [],
"live_list": [], "live_list": [],
"live_mission_list": [], "live_mission_list": [],
"master_music_ids": [1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1014,1015,1016,1017,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1035,1037,1038,1039,1040,1041,1042,1044,1045,1046,1047,1048,1049,1050,1054,1055,1057,1058,1059,1060,1061,1062,1063,1064,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1123,1124,1126,1127,1128,1129,1130,1131,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3121,3122,3123,3124,3125,3126,3127,3128,3129,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4059,4060,4061,4064,4065,4066,4067,4068,4069,4071,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4110,4111,4112,4113,4114,4115,4116,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5025,5026,5029,5031,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032], "master_music_ids": [1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1014,1015,1016,1017,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1035,1037,1038,1039,1040,1041,1042,1044,1045,1046,1047,1048,1049,1050,1054,1055,1057,1058,1059,1060,1061,1062,1063,1064,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1123,1124,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3121,3122,3123,3124,3125,3126,3127,3128,3129,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4059,4060,4061,4064,4065,4066,4067,4068,4069,4071,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032],
"event_point_list": [], "event_point_list": [],
"start_time": null, "start_time": null,
"master_title_ids": [], "master_title_ids": [],