mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-04-26 08:16:54 -05:00
smoll fixe and removed unused func
This commit is contained in:
parent
29fac2ff83
commit
e03fb07a45
|
|
@ -1148,65 +1148,6 @@ class ChallengeHandler:
|
||||||
mongo.write_data_with_list(login=user_id, login_steam=False, items_dict=data)
|
mongo.write_data_with_list(login=user_id, login_steam=False, items_dict=data)
|
||||||
return returning
|
return returning
|
||||||
|
|
||||||
def build_challenges(self):
|
|
||||||
# getChallenges.php.json
|
|
||||||
# Get all challenges
|
|
||||||
# Get all user challenges
|
|
||||||
# Compare
|
|
||||||
# Return
|
|
||||||
# {
|
|
||||||
# "challenges":[
|
|
||||||
# {
|
|
||||||
# "lifetime":{
|
|
||||||
# "creationTime":"2019-11-25T02:17:22.484Z",
|
|
||||||
# "expirationTime":"2019-11-25T17:59:59.000Z"
|
|
||||||
# },
|
|
||||||
# "challengeType":"Daily",
|
|
||||||
# "challengeId":"Challenge_Deliver_Runner:2019-11-25T02:17:22.484Z",
|
|
||||||
# "challengeCompletionValue":50,
|
|
||||||
# "faction":"Runner",
|
|
||||||
# "challengeBlueprint":"\/Game\/Challenges\/Challenge_Deliver_Runner.Challenge_Deliver_Runner",
|
|
||||||
# "rewards":[
|
|
||||||
# {
|
|
||||||
# "weight":100,
|
|
||||||
# "amount":30,
|
|
||||||
# "id":"CurrencyA",
|
|
||||||
# "type":"currency",
|
|
||||||
# "claimed":False
|
|
||||||
# }
|
|
||||||
# ]
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# "lifetime":{
|
|
||||||
# "creationTime":"2019-11-25T02:17:22.484Z",
|
|
||||||
# "expirationTime":"2019-11-25T17:59:59.000Z"
|
|
||||||
# },
|
|
||||||
# "challengeType":"Daily",
|
|
||||||
# "challengeId":"Challenge_Domination_Hunter:2019-11-25T02:17:22.484Z",
|
|
||||||
# "challengeCompletionValue":1,
|
|
||||||
# "faction":"Hunter",
|
|
||||||
# "challengeBlueprint":"\/Game\/Challenges\/Daily\/Challenge_Domination_Hunter.Challenge_Domination_Hunter",
|
|
||||||
# "rewards":[
|
|
||||||
# {
|
|
||||||
# "weight":100,
|
|
||||||
# "amount":30,
|
|
||||||
# "id":"CurrencyA",
|
|
||||||
# "type":"currency",
|
|
||||||
# "claimed":False
|
|
||||||
# }
|
|
||||||
# ]
|
|
||||||
# }
|
|
||||||
# ]
|
|
||||||
# }
|
|
||||||
pass
|
|
||||||
|
|
||||||
#def generate_challenge(self, challenge_id):
|
|
||||||
# challengeCompletionValue = random.randint(1, 100)
|
|
||||||
# progression.append({"challengeId": challenge_id, "value": 0, "completed": False,
|
|
||||||
# "challengeCompletionValue": challengeCompletionValue,
|
|
||||||
# "lifetime": {"creationTime": "2019-11-25T02:17:22.484Z",
|
|
||||||
# "expirationTime": "2020-11-25T02:17:22.484Z"}})
|
|
||||||
|
|
||||||
def add_challenge_to_user(self, user_id, challenge_id, challenge_type="progression", blueprint=None):
|
def add_challenge_to_user(self, user_id, challenge_id, challenge_type="progression", blueprint=None):
|
||||||
user_challenge_data = \
|
user_challenge_data = \
|
||||||
mongo.get_data_with_list(login=user_id, login_steam=False, items={"challengeProgression"})[
|
mongo.get_data_with_list(login=user_id, login_steam=False, items={"challengeProgression"})[
|
||||||
|
|
@ -1283,7 +1224,7 @@ class ChallengeHandler:
|
||||||
continue
|
continue
|
||||||
if create_time > challenge["lifetime"]["expirationTime"]:
|
if create_time > challenge["lifetime"]["expirationTime"]:
|
||||||
challenge["completed"] = False
|
challenge["completed"] = False
|
||||||
challenge["completion_count"] = challenge["completion_count"] + 1
|
# challenge["completion_count"] = challenge["completion_count"] + 1
|
||||||
challenge["lifetime"]["creationTime"] = create_time
|
challenge["lifetime"]["creationTime"] = create_time
|
||||||
challenge["lifetime"]["expirationTime"] = expiration_time
|
challenge["lifetime"]["expirationTime"] = expiration_time
|
||||||
mongo.write_data_with_list(login=userid, login_steam=False,
|
mongo.write_data_with_list(login=userid, login_steam=False,
|
||||||
|
|
@ -1335,15 +1276,11 @@ class ChallengeHandler:
|
||||||
# TEST should be rewardsClaimed
|
# TEST should be rewardsClaimed
|
||||||
else:
|
else:
|
||||||
reward_key = "rewards"
|
reward_key = "rewards"
|
||||||
if challenge["challengeId"] in self.hard_code_challenges:
|
try:
|
||||||
try:
|
rewards = get_reward(challenge["blueprint"])
|
||||||
rewards = get_reward(challenge["blueprint"])
|
except KeyError:
|
||||||
except KeyError:
|
|
||||||
rewards = {}
|
|
||||||
logger.graylog_logger(level="error", handler="get_progression_batch", message=f"Challenge {challenge_id} Blueprint Error.")
|
|
||||||
|
|
||||||
else:
|
|
||||||
rewards = {}
|
rewards = {}
|
||||||
|
logger.graylog_logger(level="error", handler="get_progression_batch", message=f"Challenge {challenge_id} Blueprint Error.")
|
||||||
data = {
|
data = {
|
||||||
"challengeId": challenge["challengeId"],
|
"challengeId": challenge["challengeId"],
|
||||||
"className": "ChallengeProgressionCounter",
|
"className": "ChallengeProgressionCounter",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user