Update to v2.6.5 without release

- Change something to make that purchase things can have some cores.
- Fix the download link of Arcaea client in README

> This is a small update.
This commit is contained in:
Lost-MSth
2021-09-30 19:02:10 +08:00
parent 39d3f073ba
commit 13048e57f4
12 changed files with 935 additions and 491 deletions

View File

@@ -25,15 +25,35 @@ def get_purchase(c, type='pack'):
for i in x:
items = []
c.execute(
'''select a.* from item a, purchase_item b where a.item_id=b.item_id and a.type=b.type and b.purchase_name=:name''', {'name': i[0]})
'''select a.*, b.amount from item a, purchase_item b where a.item_id=b.item_id and a.type=b.type and b.purchase_name=:name''', {'name': i[0]})
y = c.fetchall()
t = None
if y:
for j in y:
items.append({
"type": j[1],
"id": j[0],
"is_available": int2b(j[2])
})
if j[3]:
amount = j[3]
else:
amount = 1
if i[0] == j[0]:
# 物品排序,否则客户端报错
t = {
"type": j[1],
"id": j[0],
"is_available": int2b(j[2]),
'amount': amount
}
else:
items.append({
"type": j[1],
"id": j[0],
"is_available": int2b(j[2]),
"amount": amount
})
if t is not None:
# 放到列表头
items = [t, items]
r = {"name": i[0],
"items": items,
@@ -104,7 +124,7 @@ def buy_thing(user_id, purchase_id):
}
c.execute(
'''select item_id, type from purchase_item where purchase_name=:a''', {'a': purchase_id})
'''select item_id, type, amount from purchase_item where purchase_name=:a''', {'a': purchase_id})
x = c.fetchall()
if x:
now = int(time.time() * 1000)
@@ -115,7 +135,11 @@ def buy_thing(user_id, purchase_id):
if flag:
for i in x:
server.item.claim_user_item(c, user_id, i[0], i[1])
if i[2]:
amount = i[2]
else:
amount = 1
server.item.claim_user_item(c, user_id, i[0], i[1], amount)
success_flag = True
else:

View File

@@ -127,9 +127,12 @@ def get_available_maps():
for i in Config.AVAILABLE_MAP:
info = get_world_info(i)
del info['steps']
del info['is_locked']
del info['curr_position']
del info['curr_capture']
try:
del info['is_locked']
del info['curr_position']
del info['curr_capture']
except:
pass
re.append(info)
return re