idac: battle gift event, tips, QoL improvements added
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime, timedelta
|
||||
import os
|
||||
from random import choice
|
||||
from random import choice, randint
|
||||
from typing import Any, Dict, List
|
||||
import json
|
||||
import logging
|
||||
@@ -17,20 +17,27 @@ class IDACSeason2(IDACBase):
|
||||
super().__init__(core_cfg, game_cfg)
|
||||
self.version = IDACConstants.VER_IDAC_SEASON_2
|
||||
|
||||
# load the play stamps and timetrial events into memory
|
||||
# load timerelease numbers from config
|
||||
self.timerelease_no = self.game_config.timerelease.timerelease_no
|
||||
self.timerelease_avatar_gacha_no = (
|
||||
self.game_config.timerelease.timerelease_avatar_gacha_no
|
||||
)
|
||||
|
||||
# load the user configured play stamps (up to 3)
|
||||
self.stamp_info = []
|
||||
if self.game_config.stamp.enable:
|
||||
for stamp in self.game_config.stamp.enabled_stamps:
|
||||
if not os.path.exists(f"./titles/idac/data/stamps/{stamp}.json"):
|
||||
if not os.path.exists(f"./titles/idac/data/stamp/{stamp}.json"):
|
||||
self.logger.warning(f"Stamp {stamp} is enabled but does not exist!")
|
||||
continue
|
||||
|
||||
with open(
|
||||
f"./titles/idac/data/stamps/{stamp}.json", encoding="UTF-8"
|
||||
f"./titles/idac/data/stamp/{stamp}.json", encoding="UTF-8"
|
||||
) as f:
|
||||
self.logger.debug(f"Loading stamp {stamp}")
|
||||
self.stamp_info.append(self._fix_dates(json.load(f)))
|
||||
|
||||
# load the user configured time trials (only one)
|
||||
self.timetrial_event = {}
|
||||
self.timetrial_event_id = None
|
||||
if self.game_config.timetrial.enable:
|
||||
@@ -53,6 +60,25 @@ class IDACSeason2(IDACBase):
|
||||
"timetrial_event_id"
|
||||
)
|
||||
|
||||
# load the user configured battle gifts (only one)
|
||||
self.battle_gift_event = None
|
||||
if self.game_config.battle_gift.enable:
|
||||
battle_gift = self.game_config.battle_gift.enabled_battle_gift
|
||||
if battle_gift is not None:
|
||||
if not os.path.exists(
|
||||
f"./titles/idac/data/battle_gift/{battle_gift}.json"
|
||||
):
|
||||
self.logger.warning(
|
||||
f"Battle gift {battle_gift} is enabled but does not exist!"
|
||||
)
|
||||
else:
|
||||
self.logger.debug(f"Loading battle gift {battle_gift}")
|
||||
with open(
|
||||
f"./titles/idac/data/battle_gift/{battle_gift}.json",
|
||||
encoding="UTF-8",
|
||||
) as f:
|
||||
self.battle_gift_event = self._fix_dates(json.load(f))
|
||||
|
||||
async def handle_alive_get_request(self, data: Dict, headers: Dict):
|
||||
return {
|
||||
"status_code": "0",
|
||||
@@ -122,7 +148,6 @@ class IDACSeason2(IDACBase):
|
||||
"difference_time_to_jp": 0,
|
||||
# has to match the game asset version to show theory of street
|
||||
"asset_version": "1",
|
||||
# option version? MV01?
|
||||
"optional_version": "1",
|
||||
"disconnect_offset": 0,
|
||||
"boost_balance_version": "0",
|
||||
@@ -130,8 +155,8 @@ class IDACSeason2(IDACBase):
|
||||
"play_stamp_enable": 1,
|
||||
"play_stamp_bonus_coin": 1,
|
||||
"gacha_chara_needs": 1,
|
||||
"both_win_system_control": 1,
|
||||
"subcard_system_congrol": 1,
|
||||
"both_win_system_control": 0,
|
||||
"subcard_system_congrol": 0,
|
||||
"server_maintenance_start_hour": 0,
|
||||
"server_maintenance_start_minutes": 0,
|
||||
"server_maintenance_end_hour": 0,
|
||||
@@ -141,7 +166,10 @@ class IDACSeason2(IDACBase):
|
||||
"domain_echo1": f"{self.core_cfg.server.hostname}:{self.game_config.server.echo1}",
|
||||
"domain_echo2": f"{self.core_cfg.server.hostname}:{self.game_config.server.echo1}",
|
||||
"domain_ping": f"{self.core_cfg.server.hostname}",
|
||||
"battle_gift_event_master": [],
|
||||
"battle_gift_event_master": (
|
||||
[self.battle_gift_event] if self.battle_gift_event else []
|
||||
),
|
||||
# online battle round event
|
||||
"round_event": [
|
||||
{
|
||||
"round_event_id": 30,
|
||||
@@ -180,7 +208,7 @@ class IDACSeason2(IDACBase):
|
||||
"reward_upper_limit": 180,
|
||||
"reward_lower_limit": 180,
|
||||
"reward": [{"reward_category": 21, "reward_type": 462}],
|
||||
}
|
||||
},
|
||||
],
|
||||
"rank": [],
|
||||
"point": [],
|
||||
@@ -245,26 +273,148 @@ class IDACSeason2(IDACBase):
|
||||
"round_event_exp": [],
|
||||
"stamp_info": self.stamp_info,
|
||||
# 0 = use default data, 1+ = server version of timereleasedata response
|
||||
"timerelease_no": 3,
|
||||
"timerelease_no": self.timerelease_no,
|
||||
# 0 = use default data, 1+ = server version of gachadata response
|
||||
"timerelease_avatar_gacha_no": 3,
|
||||
"takeover_reward": [],
|
||||
"timerelease_avatar_gacha_no": self.timerelease_avatar_gacha_no,
|
||||
# takover reward from other games such as 1=IDZ and 3=SWDC
|
||||
"takeover_reward": [
|
||||
{
|
||||
"takeover_reward_type": 0,
|
||||
"takeover_reward_data": [
|
||||
{"reward_no": 1, "reward_category": 1, "reward_type": 5000},
|
||||
{"reward_no": 2, "reward_category": 25, "reward_type": 1},
|
||||
],
|
||||
},
|
||||
{
|
||||
"takeover_reward_type": 1,
|
||||
"takeover_reward_data": [
|
||||
{"reward_no": 1, "reward_category": 15, "reward_type": 82},
|
||||
{"reward_no": 1, "reward_category": 15, "reward_type": 190},
|
||||
{"reward_no": 2, "reward_category": 3, "reward_type": 2},
|
||||
{"reward_no": 2, "reward_category": 5, "reward_type": 2},
|
||||
{"reward_no": 3, "reward_category": 3, "reward_type": 3},
|
||||
{"reward_no": 3, "reward_category": 5, "reward_type": 3},
|
||||
{"reward_no": 4, "reward_category": 3, "reward_type": 5},
|
||||
{"reward_no": 4, "reward_category": 5, "reward_type": 5},
|
||||
{"reward_no": 5, "reward_category": 15, "reward_type": 104},
|
||||
{"reward_no": 5, "reward_category": 15, "reward_type": 212},
|
||||
],
|
||||
},
|
||||
{
|
||||
"takeover_reward_type": 2,
|
||||
"takeover_reward_data": [
|
||||
{"reward_no": 1, "reward_category": 24, "reward_type": 4052},
|
||||
{"reward_no": 2, "reward_category": 24, "reward_type": 4053},
|
||||
{"reward_no": 3, "reward_category": 24, "reward_type": 4054},
|
||||
{"reward_no": 4, "reward_category": 24, "reward_type": 4055},
|
||||
{"reward_no": 5, "reward_category": 24, "reward_type": 4056},
|
||||
{"reward_no": 6, "reward_category": 24, "reward_type": 4057},
|
||||
{"reward_no": 7, "reward_category": 24, "reward_type": 4058},
|
||||
],
|
||||
},
|
||||
{
|
||||
"takeover_reward_type": 3,
|
||||
"takeover_reward_data": [
|
||||
{"reward_no": 1, "reward_category": 15, "reward_type": 81},
|
||||
{"reward_no": 1, "reward_category": 15, "reward_type": 189},
|
||||
{"reward_no": 2, "reward_category": 25, "reward_type": 1},
|
||||
{"reward_no": 2, "reward_category": 15, "reward_type": 103},
|
||||
{"reward_no": 2, "reward_category": 15, "reward_type": 211},
|
||||
],
|
||||
},
|
||||
],
|
||||
"subcard_judge": [
|
||||
{
|
||||
"condition_id": 1,
|
||||
"lower_rank": 0,
|
||||
"higher_rank": 10,
|
||||
"condition_start": 2,
|
||||
"condition_end": 3,
|
||||
}
|
||||
],
|
||||
"special_promote": [{"counter": 1, "online_rank_id": 1}],
|
||||
"matching_id": 1,
|
||||
"matching_group": [
|
||||
"lower_rank": 1,
|
||||
"higher_rank": 7,
|
||||
"condition_start": 17,
|
||||
"condition_end": 20,
|
||||
"calc": 3,
|
||||
},
|
||||
{
|
||||
"group_id": 1,
|
||||
"group_percent": 1,
|
||||
}
|
||||
"condition_id": 2,
|
||||
"lower_rank": 1,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 10,
|
||||
"condition_end": 10,
|
||||
"calc": 20,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 11,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 80,
|
||||
"condition_end": 89,
|
||||
"calc": 7,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 11,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 90,
|
||||
"condition_end": 100,
|
||||
"calc": 10,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 1,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 0,
|
||||
"condition_end": 40,
|
||||
"calc": -100,
|
||||
},
|
||||
{
|
||||
"condition_id": 1,
|
||||
"lower_rank": 1,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 21,
|
||||
"condition_end": 24,
|
||||
"calc": 7,
|
||||
},
|
||||
{
|
||||
"condition_id": 1,
|
||||
"lower_rank": 1,
|
||||
"higher_rank": 15,
|
||||
"condition_start": 25,
|
||||
"condition_end": 25,
|
||||
"calc": 10,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 16,
|
||||
"higher_rank": 20,
|
||||
"condition_start": 70,
|
||||
"condition_end": 89,
|
||||
"calc": 6,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 16,
|
||||
"higher_rank": 20,
|
||||
"condition_start": 90,
|
||||
"condition_end": 100,
|
||||
"calc": 12,
|
||||
},
|
||||
{
|
||||
"condition_id": 3,
|
||||
"lower_rank": 16,
|
||||
"higher_rank": 20,
|
||||
"condition_start": 0,
|
||||
"condition_end": 50,
|
||||
"calc": -100,
|
||||
},
|
||||
],
|
||||
"special_promote": [
|
||||
{"counter": 50, "online_rank_id": 8},
|
||||
{"counter": 200, "online_rank_id": 16},
|
||||
{"counter": 255, "online_rank_id": 21},
|
||||
],
|
||||
"matching_id": 0,
|
||||
"matching_group": [
|
||||
{"group_id": 1, "group_percent": 30},
|
||||
{"group_id": 2, "group_percent": 50},
|
||||
{"group_id": 3, "group_percent": 100},
|
||||
],
|
||||
"timetrial_disp_date": int(
|
||||
datetime.strptime("2023-10-01", "%Y-%m-%d").timestamp()
|
||||
@@ -272,21 +422,22 @@ class IDACSeason2(IDACBase):
|
||||
# price for every car
|
||||
"buy_car_need_cash": 5000,
|
||||
# number of buyable shop/customization time limits
|
||||
"time_extension_limit": 1,
|
||||
"time_extension_limit": 5,
|
||||
"collabo_id": 0,
|
||||
"driver_debut_end_date": int(
|
||||
datetime.strptime("2029-01-01", "%Y-%m-%d").timestamp()
|
||||
),
|
||||
"online_battle_param1": 1,
|
||||
"online_battle_param2": 1,
|
||||
"online_battle_param3": 1,
|
||||
"online_battle_param4": 1,
|
||||
"online_battle_param5": 1,
|
||||
"online_battle_param6": 1,
|
||||
"online_battle_param7": 1,
|
||||
"online_battle_param8": 1,
|
||||
"theory_open_version": "1.30",
|
||||
"theory_close_version": "1.50",
|
||||
"online_battle_param1": 0,
|
||||
"online_battle_param2": 0,
|
||||
"online_battle_param3": 0,
|
||||
"online_battle_param4": 0,
|
||||
"online_battle_param5": 0,
|
||||
"online_battle_param6": 2,
|
||||
"online_battle_param7": 0,
|
||||
"online_battle_param8": 3900,
|
||||
"theory_open_version": "1.30.00",
|
||||
"theory_close_version": "9.99.99",
|
||||
# unlocks teh version specific special mode
|
||||
"special_mode_data": {
|
||||
"start_dt": int(
|
||||
datetime.strptime("2023-01-01", "%Y-%m-%d").timestamp()
|
||||
@@ -692,6 +843,20 @@ class IDACSeason2(IDACBase):
|
||||
vs_info["course_select_priority"] = data.get("course_select_priority")
|
||||
return vs_info
|
||||
|
||||
def _choose_gift_id(self) -> Dict:
|
||||
gift_data = self.battle_gift_event["gift_data"]
|
||||
# calculate the total_rate based on the first_distribution_rate
|
||||
total_rate = sum(gift["first_distribution_rate"] for gift in gift_data)
|
||||
|
||||
# randomly choose a number between 1 and the total rate
|
||||
rand_num = randint(1, total_rate)
|
||||
cumulative_rate = 0
|
||||
for gift in gift_data:
|
||||
# if the random number is less than the cumulative rate, return the gift
|
||||
cumulative_rate += gift["first_distribution_rate"]
|
||||
if rand_num <= cumulative_rate:
|
||||
return gift
|
||||
|
||||
async def handle_user_getdata_request(self, data: Dict, headers: Dict):
|
||||
user_id = int(headers["session"])
|
||||
|
||||
@@ -926,6 +1091,74 @@ class IDACSeason2(IDACBase):
|
||||
"point": timetrial["point"],
|
||||
}
|
||||
|
||||
# check if the battle gift event is active
|
||||
if self.battle_gift_event:
|
||||
# get the users battle gifts, for the current active battle gift event
|
||||
battle_gifts = await self.data.item.get_battle_gifts(
|
||||
user_id, self.battle_gift_event.get("battle_gift_event_id")
|
||||
)
|
||||
|
||||
if battle_gifts:
|
||||
# just return all aquired gifts
|
||||
battle_gift_data = [
|
||||
{
|
||||
"first_distribution_flag": 0,
|
||||
"gift_data": [
|
||||
{
|
||||
"gift_id": gift["gift_id"],
|
||||
# 1 = acquired
|
||||
"gift_get_status": gift["gift_status"],
|
||||
}
|
||||
for gift in battle_gifts
|
||||
],
|
||||
}
|
||||
]
|
||||
else:
|
||||
# get a random gift from the active battle gift event
|
||||
gift_id = self._choose_gift_id()["gift_id"]
|
||||
|
||||
# save the battle_gift inside the database
|
||||
await self.data.item.put_battle_gift(
|
||||
user_id,
|
||||
{
|
||||
"battle_gift_event_id": self.battle_gift_event.get(
|
||||
"battle_gift_event_id"
|
||||
),
|
||||
"gift_id": gift_id,
|
||||
"gift_status": 1, # aquired
|
||||
},
|
||||
)
|
||||
|
||||
battle_gift_data = [
|
||||
{
|
||||
# trigger the first gift animation
|
||||
"first_distribution_flag": 1,
|
||||
"gift_data": [
|
||||
{
|
||||
# return a random selected gift_id
|
||||
"gift_id": gift_id,
|
||||
# set the status to 2 = new gift
|
||||
"gift_get_status": 2,
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
# get the tips from the database
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
|
||||
# if there are no tips, create a new one
|
||||
if tips is None:
|
||||
await self.data.profile.put_profile_tips(user_id, self.version, {})
|
||||
|
||||
# get the tips from the database
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
|
||||
tips_info = tips._asdict()
|
||||
del tips_info["id"]
|
||||
del tips_info["user"]
|
||||
del tips_info["version"]
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"user_base_data": user_data,
|
||||
@@ -969,7 +1202,9 @@ class IDACSeason2(IDACBase):
|
||||
"frozen_data": {"frozen_status": 2},
|
||||
"penalty_data": {"penalty_flag": 0, "penalty_2_level": 0},
|
||||
"config_data": config_data,
|
||||
"battle_gift_data": [],
|
||||
# gift_get_status 2 = new gift, 1 = acquired
|
||||
# first_distribution related are useless since this is all handled by server
|
||||
"battle_gift_data": battle_gift_data,
|
||||
"ticket_data": ticket_data,
|
||||
"round_event": [],
|
||||
"last_round_event": [],
|
||||
@@ -984,17 +1219,16 @@ class IDACSeason2(IDACBase):
|
||||
"car_use_count": [],
|
||||
"maker_use_count": [],
|
||||
"story_course": [{"course_id": 0, "count": 1}],
|
||||
# TODO!
|
||||
# "driver_debut": {
|
||||
# "play_count": 137,
|
||||
# "daily_play": 5,
|
||||
# "last_play_dt": 0,
|
||||
# "use_start_date": 0,
|
||||
# "use_end_date": 0,
|
||||
# "use_dt": 0,
|
||||
# "ticket_cnt": 0,
|
||||
# "ticket_get_bit": 0,
|
||||
# },
|
||||
"driver_debut": {
|
||||
# "play_count": 5,
|
||||
# "daily_play": 5,
|
||||
# "last_play_dt": datetime.now().timestamp() - 86400,
|
||||
# "use_start_date": datetime.now().timestamp() - 86400,
|
||||
# "use_end_date": datetime.now().timestamp() + 86400,
|
||||
# "use_dt": datetime.now().timestamp(),
|
||||
# "ticket_cnt": 1,
|
||||
# "ticket_get_bit": (2 ** 5) - 1,
|
||||
},
|
||||
"theory_data": theory_data,
|
||||
"theory_course_data": theory_course_data,
|
||||
"theory_partner_data": theory_partner_data,
|
||||
@@ -1004,6 +1238,7 @@ class IDACSeason2(IDACBase):
|
||||
"season_rewards_data": [],
|
||||
"timetrial_event_data": timetrial_event_data,
|
||||
"special_mode_hint_data": {"story_type": 0, "hint_display_flag": 0},
|
||||
"tips_info": tips_info,
|
||||
}
|
||||
|
||||
async def handle_timetrial_getbestrecordpreta_request(
|
||||
@@ -1596,6 +1831,12 @@ class IDACSeason2(IDACBase):
|
||||
user_id, self.timetrial_event_id, event_point
|
||||
)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"timetrial_play_count": tips["timetrial_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"course_rank": course_rank,
|
||||
@@ -1733,6 +1974,12 @@ class IDACSeason2(IDACBase):
|
||||
},
|
||||
)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"story_play_count": tips["story_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"story_data": await self._generate_story_data(user_id),
|
||||
@@ -1806,6 +2053,12 @@ class IDACSeason2(IDACBase):
|
||||
# finally save the special mode with story_type=4 in database
|
||||
await self.data.item.put_challenge(user_id, data)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"special_play_count": tips["special_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"special_mode_data": await self._generate_special_data(user_id),
|
||||
@@ -1886,6 +2139,12 @@ class IDACSeason2(IDACBase):
|
||||
# finally save the challenge mode with story_type=3 in database
|
||||
await self.data.item.put_challenge(user_id, data)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"challenge_play_count": tips["challenge_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"challenge_mode_data": await self._generate_challenge_data(user_id),
|
||||
@@ -2118,7 +2377,12 @@ class IDACSeason2(IDACBase):
|
||||
# not required?
|
||||
mode_id = data.pop("mode_id")
|
||||
standby_play_flag = data.pop("standby_play_flag")
|
||||
|
||||
# save the tips list in database
|
||||
tips_list = data.pop("tips_list")
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"tips_list": tips_list}
|
||||
)
|
||||
|
||||
# save stock data in database
|
||||
await self._save_stock_data(user_id, stock_data)
|
||||
@@ -2522,6 +2786,12 @@ class IDACSeason2(IDACBase):
|
||||
},
|
||||
)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"theory_play_count": tips["theory_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"played_powerhouse_lv": data.get("powerhouse_lv"),
|
||||
@@ -2584,7 +2854,9 @@ class IDACSeason2(IDACBase):
|
||||
"bothwin_penalty": 1,
|
||||
}
|
||||
|
||||
async def handle_user_updateonlinebattleresult_request(self, data: Dict, headers: Dict):
|
||||
async def handle_user_updateonlinebattleresult_request(
|
||||
self, data: Dict, headers: Dict
|
||||
):
|
||||
user_id = headers["session"]
|
||||
|
||||
stock_data: Dict = data.pop("stock_obj")
|
||||
@@ -2640,7 +2912,15 @@ class IDACSeason2(IDACBase):
|
||||
},
|
||||
)
|
||||
|
||||
vs_info = self._update_vs_info(user_id, IDACConstants.BATTLE_MODE_ONLINE, data)
|
||||
vs_info = await self._update_vs_info(
|
||||
user_id, IDACConstants.BATTLE_MODE_ONLINE, data
|
||||
)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"online_battle_play_count": tips["online_battle_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
@@ -2671,9 +2951,20 @@ class IDACSeason2(IDACBase):
|
||||
|
||||
# no idea?
|
||||
result = data.pop("result")
|
||||
|
||||
# save the received battle gift in database, hopefully that works
|
||||
battle_gift_event_id = data.pop("battle_gift_event_id")
|
||||
gift_id = data.pop("gift_id")
|
||||
|
||||
await self.data.item.put_battle_gift(
|
||||
user_id,
|
||||
{
|
||||
"battle_gift_event_id": battle_gift_event_id,
|
||||
"gift_id": gift_id,
|
||||
"gift_status": 1, # aquired
|
||||
},
|
||||
)
|
||||
|
||||
# save stock data in database
|
||||
await self._save_stock_data(user_id, stock_data)
|
||||
|
||||
@@ -2726,6 +3017,12 @@ class IDACSeason2(IDACBase):
|
||||
user_id, IDACConstants.BATTLE_MODE_OFFLINE, data
|
||||
)
|
||||
|
||||
# update the tips play count
|
||||
tips = await self.data.profile.get_profile_tips(user_id, self.version)
|
||||
await self.data.profile.put_profile_tips(
|
||||
user_id, self.version, {"store_battle_play_count": tips["store_battle_play_count"] + 1}
|
||||
)
|
||||
|
||||
return {
|
||||
"status_code": "0",
|
||||
"vsinfo_data": vs_info,
|
||||
|
||||
Reference in New Issue
Block a user