Idk what to put hrere
This commit is contained in:
parent
34a16be36e
commit
f256c9a1f7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
asset_server/node_modules/
|
asset_server/node_modules/
|
||||||
asset_server/resources/
|
asset_server/resources/
|
||||||
target/
|
target/
|
||||||
|
python/
|
||||||
*.db
|
*.db
|
||||||
|
@ -39,6 +39,9 @@ async fn story_read(req: HttpRequest, body: String) -> HttpResponse { router::st
|
|||||||
#[post("/api/user/initialize")]
|
#[post("/api/user/initialize")]
|
||||||
async fn user_initialize(req: HttpRequest, body: String) -> HttpResponse { router::user::initialize(req, body) }
|
async fn user_initialize(req: HttpRequest, body: String) -> HttpResponse { router::user::initialize(req, body) }
|
||||||
|
|
||||||
|
#[post("/api/deck")]
|
||||||
|
async fn user_deck(req: HttpRequest, body: String) -> HttpResponse { router::user::deck(req, body) }
|
||||||
|
|
||||||
#[get("/api/purchase")]
|
#[get("/api/purchase")]
|
||||||
async fn purchase(req: HttpRequest) -> HttpResponse { router::purchase::purchase(req) }
|
async fn purchase(req: HttpRequest) -> HttpResponse { router::purchase::purchase(req) }
|
||||||
|
|
||||||
@ -60,6 +63,9 @@ async fn live_start(req: HttpRequest, body: String) -> HttpResponse { router::li
|
|||||||
#[post("/api/live/end")]
|
#[post("/api/live/end")]
|
||||||
async fn live_end(req: HttpRequest, body: String) -> HttpResponse { router::live::end(req, body) }
|
async fn live_end(req: HttpRequest, body: String) -> HttpResponse { router::live::end(req, body) }
|
||||||
|
|
||||||
|
#[post("/api/live/retire")]
|
||||||
|
async fn live_retire(req: HttpRequest, body: String) -> HttpResponse { router::live::retire(req, body) }
|
||||||
|
|
||||||
#[get("/api/live/clearRate")]
|
#[get("/api/live/clearRate")]
|
||||||
async fn live_clearrate(req: HttpRequest) -> HttpResponse { router::live::clearrate(req) }
|
async fn live_clearrate(req: HttpRequest) -> HttpResponse { router::live::clearrate(req) }
|
||||||
|
|
||||||
@ -104,6 +110,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.service(live_clearrate)
|
.service(live_clearrate)
|
||||||
.service(live_start)
|
.service(live_start)
|
||||||
.service(live_end)
|
.service(live_end)
|
||||||
|
.service(live_retire)
|
||||||
.service(chat_home)
|
.service(chat_home)
|
||||||
.service(chat_end)
|
.service(chat_end)
|
||||||
.service(chat_start)
|
.service(chat_start)
|
||||||
@ -121,6 +128,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.service(start_assethash)
|
.service(start_assethash)
|
||||||
.service(user)
|
.service(user)
|
||||||
.service(user_post)
|
.service(user_post)
|
||||||
|
.service(user_deck)
|
||||||
.service(dummy_login)
|
.service(dummy_login)
|
||||||
.default_service(web::route().to(log_unknown_request)))
|
.default_service(web::route().to(log_unknown_request)))
|
||||||
.bind(("0.0.0.0", 8080))?
|
.bind(("0.0.0.0", 8080))?
|
||||||
|
File diff suppressed because one or more lines are too long
@ -5,9 +5,9 @@ use actix_web::{
|
|||||||
};
|
};
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
//likely different between ios and android?
|
//different between ios and android?
|
||||||
pub const ASSET_VERSION: &str = "4a802a747076a91e5e62707f6358bc2d";
|
pub const ASSET_VERSION: &str = "13177023d4b7ad41ff52af4cefba5c55";
|
||||||
pub const ASSET_HASH: &str = "0de9f85900e910b0b4873dcdd0933aa5";
|
pub const ASSET_HASH: &str = "9fbfeda43a5cbf744ef23c06c22170aa";
|
||||||
|
|
||||||
pub fn timestamp() -> u64 {
|
pub fn timestamp() -> u64 {
|
||||||
let now = SystemTime::now();
|
let now = SystemTime::now();
|
||||||
@ -39,8 +39,8 @@ pub fn give_character(id: String, user: &mut JsonValue) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let to_push = object!{
|
let to_push = object!{
|
||||||
"id": id.clone(),
|
"id": id.parse::<i32>().unwrap(),
|
||||||
"master_card_id": id,
|
"master_card_id": id.parse::<i32>().unwrap(),
|
||||||
"exp": 0,
|
"exp": 0,
|
||||||
"skill_exp": 0,
|
"skill_exp": 0,
|
||||||
"evolve": [],
|
"evolve": [],
|
||||||
|
@ -5,6 +5,19 @@ use crate::encryption;
|
|||||||
use actix_web::{HttpResponse, HttpRequest, http::header::HeaderValue};
|
use actix_web::{HttpResponse, HttpRequest, http::header::HeaderValue};
|
||||||
use crate::router::userdata;
|
use crate::router::userdata;
|
||||||
|
|
||||||
|
pub fn retire(_req: HttpRequest, _body: String) -> HttpResponse {
|
||||||
|
let resp = object!{
|
||||||
|
"code": 0,
|
||||||
|
"server_time": global::timestamp(),
|
||||||
|
"data": {
|
||||||
|
"stamina": {},
|
||||||
|
"item_list": [],
|
||||||
|
"event_point_list": []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global::send(resp)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn guest(_req: HttpRequest, _body: String) -> HttpResponse {
|
pub fn guest(_req: HttpRequest, _body: String) -> HttpResponse {
|
||||||
|
|
||||||
let resp = object!{
|
let resp = object!{
|
||||||
|
@ -5,6 +5,36 @@ use crate::encryption;
|
|||||||
use actix_web::{HttpResponse, HttpRequest, http::header::HeaderValue};
|
use actix_web::{HttpResponse, HttpRequest, http::header::HeaderValue};
|
||||||
use crate::router::userdata;
|
use crate::router::userdata;
|
||||||
|
|
||||||
|
pub fn deck(req: HttpRequest, body: String) -> HttpResponse {
|
||||||
|
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||||
|
let blank_header = HeaderValue::from_static("");
|
||||||
|
|
||||||
|
let key = req.headers().get("a6573cbe").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||||
|
let mut user = userdata::get_acc(key);
|
||||||
|
|
||||||
|
for (i, data) in user["deck_list"].members().enumerate() {
|
||||||
|
if data["slot"].to_string() == body["slot"].to_string() {
|
||||||
|
user["deck_list"][i] = body["main_card_ids"].clone();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userdata::save_acc(key, user.clone());
|
||||||
|
|
||||||
|
let resp = object!{
|
||||||
|
"code": 0,
|
||||||
|
"server_time": global::timestamp(),
|
||||||
|
"data": {
|
||||||
|
"deck": {
|
||||||
|
"slot": body["slot"].clone(),
|
||||||
|
"leader_role": 0,
|
||||||
|
"main_card_ids": body["main_card_ids"].clone()
|
||||||
|
},
|
||||||
|
"clear_mission_ids": []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global::send(resp)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn user(req: HttpRequest) -> HttpResponse {
|
pub fn user(req: HttpRequest) -> HttpResponse {
|
||||||
let blank_header = HeaderValue::from_static("");
|
let blank_header = HeaderValue::from_static("");
|
||||||
|
|
||||||
|
@ -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,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,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],
|
||||||
"event_point_list": [],
|
"event_point_list": [],
|
||||||
"start_time": null,
|
"start_time": null,
|
||||||
"master_title_ids": [],
|
"master_title_ids": [],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user