mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-15 21:17:27 +08:00
Binary file not shown.
@@ -580,6 +580,10 @@ def main():
|
||||
else:
|
||||
app.logger.info('Complete!')
|
||||
|
||||
if Config.SSL_CERT and Config.SSL_KEY:
|
||||
app.run(Config.HOST, Config.PORT, ssl_context=(
|
||||
Config.SSL_CERT, Config.SSL_KEY))
|
||||
else:
|
||||
app.run(Config.HOST, Config.PORT)
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import time
|
||||
import json
|
||||
import server.arcworld
|
||||
import hashlib
|
||||
from setting import Config
|
||||
|
||||
|
||||
def b2int(x):
|
||||
@@ -129,9 +130,13 @@ def arc_score_me(user_id, song_id, difficulty, limit=20):
|
||||
'user_id': user_id, 'song_id': song_id, 'difficulty': difficulty})
|
||||
x = c.fetchone()
|
||||
myrank = int(x[0]) + 1
|
||||
c.execute('''select count(*) from best_score where song_id=:a and difficulty=:b''',
|
||||
{'a': song_id, 'b': difficulty})
|
||||
amount = int(c.fetchone()[0])
|
||||
|
||||
if myrank <= 4: # 排名在前4
|
||||
return arc_score_top(song_id, difficulty, limit)
|
||||
elif myrank >= 5 and myrank <= 9999 - limit + 4: # 万名内,前面有4个人
|
||||
elif myrank >= 5 and myrank <= 9999 - limit + 4 and amount >= 10000: # 万名内,前面有4个人
|
||||
c.execute('''select user_id from best_score where song_id = :song_id and difficulty = :difficulty order by score DESC, time_played DESC limit :limit offset :offset''', {
|
||||
'song_id': song_id, 'difficulty': difficulty, 'limit': limit, 'offset': myrank - 5})
|
||||
x = c.fetchall()
|
||||
@@ -157,6 +162,17 @@ def arc_score_me(user_id, song_id, difficulty, limit=20):
|
||||
y = get_score(c, user_id, song_id, difficulty)
|
||||
y['rank'] = -1
|
||||
r.append(y)
|
||||
elif amount - myrank < limit - 5: # 后方人数不足
|
||||
c.execute('''select user_id from best_score where song_id = :song_id and difficulty = :difficulty order by score DESC, time_played DESC limit :limit offset :offset''', {
|
||||
'song_id': song_id, 'difficulty': difficulty, 'limit': limit, 'offset': amount - limit})
|
||||
x = c.fetchall()
|
||||
if x != []:
|
||||
rank = amount - limit
|
||||
for i in x:
|
||||
rank += 1
|
||||
y = get_score(c, i[0], song_id, difficulty)
|
||||
y['rank'] = rank
|
||||
r.append(y)
|
||||
else:
|
||||
c.execute('''select user_id from best_score where song_id = :song_id and difficulty = :difficulty order by score DESC, time_played DESC limit :limit offset :offset''', {
|
||||
'song_id': song_id, 'difficulty': difficulty, 'limit': limit, 'offset': 9998-limit})
|
||||
@@ -579,10 +595,10 @@ def arc_all_get(user_id):
|
||||
scores_data = []
|
||||
clearlamps_data = []
|
||||
clearedsongs_data = []
|
||||
# unlocklist_data = []
|
||||
unlocklist_data = []
|
||||
installid_data = ''
|
||||
devicemodelname_data = ''
|
||||
# story_data = []
|
||||
story_data = []
|
||||
createdAt = 0
|
||||
|
||||
with Connect() as c:
|
||||
@@ -594,17 +610,16 @@ def arc_all_get(user_id):
|
||||
scores_data = json.loads(x[1])[""]
|
||||
clearlamps_data = json.loads(x[2])[""]
|
||||
clearedsongs_data = json.loads(x[3])[""]
|
||||
# unlocklist_data = json.loads(x[4])[""]
|
||||
unlocklist_data = json.loads(x[4])[""]
|
||||
installid_data = json.loads(x[5])["val"]
|
||||
devicemodelname_data = json.loads(x[6])["val"]
|
||||
# story_data = json.loads(x[7])[""]
|
||||
story_data = json.loads(x[7])[""]
|
||||
if x[8]:
|
||||
createdAt = int(x[8])
|
||||
|
||||
return {
|
||||
"user_id": user_id,
|
||||
"story": {
|
||||
"": [{
|
||||
if Config.SAVE_FULL_UNLOCK:
|
||||
installid_data = "0fcec8ed-7b62-48e2-9d61-55041a22b123"
|
||||
story_data = [{
|
||||
"ma": 1,
|
||||
"mi": 1,
|
||||
"c": True,
|
||||
@@ -920,16 +935,7 @@ def arc_all_get(user_id):
|
||||
"c": True,
|
||||
"r": True
|
||||
}]
|
||||
},
|
||||
"devicemodelname": {
|
||||
"val": devicemodelname_data
|
||||
},
|
||||
"installid": {
|
||||
# installid_data 这里如果不固定,可能会导致arcaea以为数据一样而不更新
|
||||
"val": "0fcec8ed-7b62-48e2-9d61-55041a22b123"
|
||||
},
|
||||
"unlocklist": {
|
||||
"": [{
|
||||
unlocklist_data = [{
|
||||
"unlock_key": "worldvanquisher|2|0",
|
||||
"complete": 1
|
||||
}, {
|
||||
@@ -1509,7 +1515,22 @@ def arc_all_get(user_id):
|
||||
"unlock_key": "anokumene|1|0",
|
||||
"complete": 1
|
||||
}]
|
||||
}, "clearedsongs": {
|
||||
|
||||
return {
|
||||
"user_id": user_id,
|
||||
"story": {
|
||||
"": story_data
|
||||
},
|
||||
"devicemodelname": {
|
||||
"val": devicemodelname_data
|
||||
},
|
||||
"installid": {
|
||||
"val": installid_data
|
||||
},
|
||||
"unlocklist": {
|
||||
"": unlocklist_data
|
||||
},
|
||||
"clearedsongs": {
|
||||
"": clearedsongs_data
|
||||
},
|
||||
"clearlamps": {
|
||||
|
||||
@@ -14,6 +14,19 @@ class Config():
|
||||
--------------------
|
||||
'''
|
||||
|
||||
'''
|
||||
--------------------
|
||||
SSL证书路径
|
||||
留空则使用HTTP
|
||||
SSL certificate path
|
||||
If left blank, use HTTP.
|
||||
'''
|
||||
SSL_CERT = '' # *.pem
|
||||
SSL_KEY = '' # *.key
|
||||
'''
|
||||
--------------------
|
||||
'''
|
||||
|
||||
'''
|
||||
--------------------
|
||||
愚人节模式开关
|
||||
@@ -95,3 +108,13 @@ class Config():
|
||||
'''
|
||||
--------------------
|
||||
'''
|
||||
|
||||
'''
|
||||
--------------------
|
||||
是否强制使用全解锁云端存档
|
||||
If forcing full unlocked cloud save is enabled
|
||||
'''
|
||||
SAVE_FULL_UNLOCK = True
|
||||
'''
|
||||
--------------------
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user