mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-07-12 00:32:20 +08:00
Remove now from completed_daily_mission
This commit is contained in:
@@ -95,7 +95,7 @@ async fn home(req: HttpRequest) -> impl Responder {
|
|||||||
check_gifts(&mut user);
|
check_gifts(&mut user);
|
||||||
|
|
||||||
let mut user_missions = userdata::get_acc_missions(&key);
|
let mut user_missions = userdata::get_acc_missions(&key);
|
||||||
let clear = items::completed_daily_mission(1253003, global::timestamp(), &mut user_missions);
|
let clear = items::completed_daily_mission(1253003, &mut user_missions);
|
||||||
userdata::save_acc_home(&key, user.clone());
|
userdata::save_acc_home(&key, user.clone());
|
||||||
user["clear_mission_ids"] = clear;
|
user["clear_mission_ids"] = clear;
|
||||||
if !user["clear_mission_ids"].is_empty() {
|
if !user["clear_mission_ids"].is_empty() {
|
||||||
|
|||||||
@@ -517,7 +517,8 @@ pub fn refresh_dailies(missions: &mut JsonValue, now: u64) -> bool {
|
|||||||
changed
|
changed
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn completed_daily_mission(id: i64, now: u64, missions: &mut JsonValue) -> JsonValue {
|
pub fn completed_daily_mission(id: i64, missions: &mut JsonValue) -> JsonValue {
|
||||||
|
let now = global::timestamp();
|
||||||
refresh_dailies(missions, now);
|
refresh_dailies(missions, now);
|
||||||
|
|
||||||
let mission = get_mission_status(id, missions);
|
let mission = get_mission_status(id, missions);
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ pub fn live_end(req: &HttpRequest, body: &str, skipped: bool) -> JsonValue {
|
|||||||
if body["master_live_id"].to_string().len() > 1 {
|
if body["master_live_id"].to_string().len() > 1 {
|
||||||
let id = body["master_live_id"].to_string().split("").collect::<Vec<_>>()[2].parse::<i64>().unwrap_or(0);
|
let id = body["master_live_id"].to_string().split("").collect::<Vec<_>>()[2].parse::<i64>().unwrap_or(0);
|
||||||
if (1..=4).contains(&id) {
|
if (1..=4).contains(&id) {
|
||||||
let to_push = items::completed_daily_mission(1273009 + id - 1, global::timestamp(), &mut user_missions);
|
let to_push = items::completed_daily_mission(1273009 + id - 1, &mut user_missions);
|
||||||
for data in to_push.members() {
|
for data in to_push.members() {
|
||||||
cleared_missions.push(data.as_i32().unwrap()).unwrap();
|
cleared_missions.push(data.as_i32().unwrap()).unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ async fn bonus(req: HttpRequest, body: String) -> impl Responder {
|
|||||||
|
|
||||||
let mut cleared_missions = array![];
|
let mut cleared_missions = array![];
|
||||||
if !to_send.is_empty() {
|
if !to_send.is_empty() {
|
||||||
cleared_missions = items::completed_daily_mission(1253003, global::timestamp(), &mut user_missions);
|
cleared_missions = items::completed_daily_mission(1253003, &mut user_missions);
|
||||||
userdata::save_acc_missions(&key, user_missions);
|
userdata::save_acc_missions(&key, user_missions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user