mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Implement dummy /api/live/reward
This commit is contained in:
parent
a48e142d8d
commit
248979f2cb
2 changed files with 17 additions and 4 deletions
|
@ -74,6 +74,7 @@ async fn request(req: HttpRequest, body: String) -> HttpResponse {
|
|||
"/api/live/skip" => router::live::skip(req, body),
|
||||
"/api/live/retire" => router::live::retire(req, body),
|
||||
"/api/live/continue" => router::live::continuee(req, body),
|
||||
"/api/live/reward" => router::live::reward(req, body),
|
||||
"/api/mission/clear" => router::mission::clear(req, body),
|
||||
"/api/mission/receive" => router::mission::receive(req, body),
|
||||
"/api/home/preset" => router::home::preset(req, body),
|
||||
|
|
|
@ -9,7 +9,9 @@ use crate::router::clear_rate::live_completed;
|
|||
|
||||
pub fn retire(req: HttpRequest, body: String) -> HttpResponse {
|
||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||
live_completed(body["master_live_id"].as_i64().unwrap(), body["level"].as_i32().unwrap(), true, 0, 0);
|
||||
if body["live_score"]["play_time"].as_i64().unwrap_or(0) > 5 {
|
||||
live_completed(body["master_live_id"].as_i64().unwrap(), body["level"].as_i32().unwrap(), true, 0, 0);
|
||||
}
|
||||
let resp = object!{
|
||||
"code": 0,
|
||||
"server_time": global::timestamp(),
|
||||
|
@ -22,6 +24,18 @@ pub fn retire(req: HttpRequest, body: String) -> HttpResponse {
|
|||
global::send(resp, req)
|
||||
}
|
||||
|
||||
pub fn reward(req: HttpRequest, _body: String) -> HttpResponse {
|
||||
let resp = object!{
|
||||
"code": 0,
|
||||
"server_time": global::timestamp(),
|
||||
"data": {
|
||||
"ensured_list": [],
|
||||
"random_list": []
|
||||
}
|
||||
};
|
||||
global::send(resp, req)
|
||||
}
|
||||
|
||||
fn random_number(lowest: usize, highest: usize) -> usize {
|
||||
if lowest == highest {
|
||||
return lowest;
|
||||
|
@ -492,9 +506,7 @@ fn live_end(req: &HttpRequest, body: &String, skipped: bool) -> JsonValue {
|
|||
}
|
||||
}
|
||||
|
||||
if body["live_score"]["score"].as_i64().unwrap_or(0) > 0 {
|
||||
live_completed(body["master_live_id"].as_i64().unwrap(), body["level"].as_i32().unwrap(), false, body["live_score"]["score"].as_i64().unwrap(), user["user"]["id"].as_i64().unwrap());
|
||||
}
|
||||
live_completed(body["master_live_id"].as_i64().unwrap(), body["level"].as_i32().unwrap(), false, body["live_score"]["score"].as_i64().unwrap(), user["user"]["id"].as_i64().unwrap());
|
||||
|
||||
let missions;
|
||||
if skipped {
|
||||
|
|
Loading…
Add table
Reference in a new issue