mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-13 11:47:32 +08:00
Fix some bugs
- Second try to fix a bug about API - Fix a bug that the `prog boost` shows the incorrect value - Fix a bug that the rewards can be get repeatedly in World Mode - Fix a bug that second tube of blood of the world boss won't change
This commit is contained in:
@@ -63,6 +63,9 @@ def request_json_handle(request, required_keys=[], optional_keys=[]):
|
|||||||
def wrapped_view(*args, **kwargs):
|
def wrapped_view(*args, **kwargs):
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
|
if not request.data:
|
||||||
|
return view(data, *args, **kwargs)
|
||||||
|
|
||||||
for key in required_keys:
|
for key in required_keys:
|
||||||
if key not in request.json:
|
if key not in request.json:
|
||||||
return error_return(PostError('Missing parameter: ' + key, api_error_code=-100))
|
return error_return(PostError('Missing parameter: ' + key, api_error_code=-100))
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ class ProgBoost(UserItem):
|
|||||||
世界模式prog_boost\
|
世界模式prog_boost\
|
||||||
parameters: `user` - `UserOnline`类或子类的实例
|
parameters: `user` - `UserOnline`类或子类的实例
|
||||||
'''
|
'''
|
||||||
user.update_user_one_column('prog_boost', 1)
|
user.update_user_one_column('prog_boost', 300)
|
||||||
|
|
||||||
|
|
||||||
class Stamina6(UserItem):
|
class Stamina6(UserItem):
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ class UserPlay(UserScore):
|
|||||||
r['user_rating'] = self.user.rating_ptt
|
r['user_rating'] = self.user.rating_ptt
|
||||||
r['finale_challenge_higher'] = self.rating > self.ptt.value
|
r['finale_challenge_higher'] = self.rating > self.ptt.value
|
||||||
r['global_rank'] = self.user.global_rank
|
r['global_rank'] = self.user.global_rank
|
||||||
r['finale_play_value'] = 0 # emmmm
|
r['finale_play_value'] = self.rating * 5 # emmmm
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -286,7 +286,7 @@ class UserPlay(UserScore):
|
|||||||
self.c.execute('''select prog_boost from user where user_id=:a''', {
|
self.c.execute('''select prog_boost from user where user_id=:a''', {
|
||||||
'a': self.user.user_id})
|
'a': self.user.user_id})
|
||||||
x = self.c.fetchone()
|
x = self.c.fetchone()
|
||||||
if x and x[0] == 1:
|
if x and x[0] == 300:
|
||||||
self.prog_boost_multiply = 300
|
self.prog_boost_multiply = 300
|
||||||
|
|
||||||
self.clear_play_state()
|
self.clear_play_state()
|
||||||
@@ -566,7 +566,6 @@ class UserScoreList:
|
|||||||
|
|
||||||
self.query.query_append({'user_id': self.user.user_id})
|
self.query.query_append({'user_id': self.user.user_id})
|
||||||
self.query.sort += [{'column': 'rating', 'order': 'DESC'}]
|
self.query.sort += [{'column': 'rating', 'order': 'DESC'}]
|
||||||
print(self.query.sort)
|
|
||||||
x = Sql(self.c).select('best_score', query=self.query)
|
x = Sql(self.c).select('best_score', query=self.query)
|
||||||
|
|
||||||
self.scores = [UserScore(self.c, self.user).from_list(i) for i in x]
|
self.scores = [UserScore(self.c, self.user).from_list(i) for i in x]
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class UserMap(Map):
|
|||||||
@property
|
@property
|
||||||
def rewards_for_climbing(self) -> list:
|
def rewards_for_climbing(self) -> list:
|
||||||
rewards = []
|
rewards = []
|
||||||
for i in range(self.prev_position, self.curr_position+1):
|
for i in range(self.prev_position+1, self.curr_position+1):
|
||||||
step = self.steps[i]
|
step = self.steps[i]
|
||||||
if step.items:
|
if step.items:
|
||||||
rewards.append(
|
rewards.append(
|
||||||
@@ -209,7 +209,7 @@ class UserMap(Map):
|
|||||||
|
|
||||||
def rewards_for_climbing_to_dict(self) -> list:
|
def rewards_for_climbing_to_dict(self) -> list:
|
||||||
rewards = []
|
rewards = []
|
||||||
for i in range(self.prev_position, self.curr_position+1):
|
for i in range(self.prev_position+1, self.curr_position+1):
|
||||||
step = self.steps[i]
|
step = self.steps[i]
|
||||||
if step.items:
|
if step.items:
|
||||||
rewards.append(
|
rewards.append(
|
||||||
|
|||||||
Reference in New Issue
Block a user