Update to v1.8.1

close #6
close #8
This commit is contained in:
Lost-MSth
2020-12-09 21:06:27 +08:00
parent 5c02ecdf37
commit 80122d749e
10 changed files with 174 additions and 79 deletions

View File

@@ -32,6 +32,7 @@ This is a small local Arcaea server based on Python and Flask, which can simulat
- 角色数值 Character characteristic value
- 数据同步的时间记录 The record of time for data synchronization
- 服务器安全性保证 Server security assurance
- 登录奖励 Login present
可能有问题 There may be problems
- Recent 30
@@ -54,15 +55,19 @@ It is just so interesting. What it can do is under exploration.
>
> Tips: When updating, please keep the original database in case of data loss.
### Version 1.8
- 适用于Arcaea 3.3.0版本 For Arcaea 3.3.0
### Version 1.8.1
- 适用于Arcaea 3.3.1版本 For Arcaea 3.3.1
- 更新了歌曲数据库 Update the song database.
- 新角色**Alice & Tenniel**已解锁 Unlock new character **Alice & Tenniel**.
- 数据同步机制修改 Modify data synchronization mechanism.
- Recent30增添简易的PTT保护机制 Add simple PTT protection mechanism to Recent30.
- 尝试解锁了一些东西 Try to unlock something.
- 修复了一些Bug Fix some bugs.
> 提醒只是一次小更新本次更新前后登录信息无法同步需重新登录我忘记给login表加主键了同步不了哈哈哈
> 已发现的问题设置Favorite角色可能并不有效
> 预告:登录奖励系统
>
> Tips: It is only a small update. The login information before and after this update can't be synchronized, so you need to log in again. (I forgot to add a primary key to the login table, so it can't be synchronized. lol)
> Problem found: Setting the favorite character may be useless.
> Preview: Login present system
## 运行环境与依赖 Running environment and requirements
- Windows操作系统 Windows operating system
- Python 3

Binary file not shown.

View File

@@ -208,6 +208,16 @@ installid_data text,
devicemodelname_data text,
story_data text
);''')
c.execute('''create table if not exists present(present_id text primary key,
expire_ts int,
items text,
description text
);''')
c.execute('''create table if not exists user_present(user_id int,
present_id text,
primary key(user_id, present_id)
);''')
char = ['Hikari', 'Tairitsu', 'Kou', 'Sapphire', 'Lethe', '', 'Tairitsu(Axium)', 'Tairitsu(Grievous Lady)', 'Stella', 'Hikari & Fisica', 'Ilith', 'Eto', 'Luna', 'Shirabe', 'Hikari(Zero)', 'Hikari(Fracture)', 'Hikari(Summer)', 'Tairitsu(Summer)', 'Tairitsu & Trin',
'Ayu', 'Eto & Luna', 'Yume', 'Seine & Hikari', 'Saya', 'Tairitsu & Chuni Penguin', 'Chuni Penguin', 'Haruna', 'Nono', 'MTA-XXX', 'MDA-21', 'Kanae', 'Hikari(Fantasia)', 'Tairitsu(Sonata)', 'Sia', 'DORO*C', 'Tairitsu(Tempest)', 'Brillante', 'Ilith(Summer)', 'Etude', 'Alice & Tenniel']

View File

@@ -3,7 +3,7 @@
"items": [{
"type": "pack",
"id": "core",
"_id": "5fc8306209787401bb857d1b",
"_id": "5fd01460a6e343038b057d28",
"is_available": true
}],
"price": 500,
@@ -15,12 +15,12 @@
"items": [{
"type": "pack",
"id": "shiawase",
"_id": "5fc8306209787401bb857d3b",
"_id": "5fd01461a6e343038b057d65",
"is_available": true
}, {
"type": "character",
"id": "kou",
"_id": "5fc8306209787401bb857d3a",
"_id": "5fd01461a6e343038b057d64",
"is_available": true
}],
"price": 500,
@@ -32,12 +32,12 @@
"items": [{
"type": "pack",
"id": "dynamix",
"_id": "5fc8306209787401bb857d33",
"_id": "5fd01461a6e343038b057d6f",
"is_available": true
}, {
"type": "character",
"id": "sapphire",
"_id": "5fc8306209787401bb857d32",
"_id": "5fd01461a6e343038b057d6e",
"is_available": true
}],
"price": 500,
@@ -49,12 +49,12 @@
"items": [{
"type": "pack",
"id": "mirai",
"_id": "5fc8306209787401bb857d37",
"_id": "5fd01461a6e343038b057d69",
"is_available": true
}, {
"type": "character",
"id": "lethe",
"_id": "5fc8306209787401bb857d36",
"_id": "5fd01461a6e343038b057d68",
"is_available": true
}],
"price": 500,
@@ -66,7 +66,7 @@
"items": [{
"type": "pack",
"id": "yugamu",
"_id": "5fc8306209787401bb857d1c",
"_id": "5fd01460a6e343038b057d29",
"is_available": true
}],
"price": 500,
@@ -78,7 +78,7 @@
"items": [{
"type": "pack",
"id": "lanota",
"_id": "5fc8306209787401bb857d26",
"_id": "5fd01460a6e343038b057d40",
"is_available": true
}],
"price": 500,
@@ -90,7 +90,7 @@
"items": [{
"type": "pack",
"id": "nijuusei",
"_id": "5fc8306209787401bb857d1d",
"_id": "5fd01460a6e343038b057d2a",
"is_available": true
}],
"price": 500,
@@ -102,7 +102,7 @@
"items": [{
"type": "pack",
"id": "rei",
"_id": "5fc8306209787401bb857cfa",
"_id": "5fd01460a6e343038b057d4d",
"is_available": true
}],
"price": 500,
@@ -114,7 +114,7 @@
"items": [{
"type": "pack",
"id": "tonesphere",
"_id": "5fc8306209787401bb857d28",
"_id": "5fd01460a6e343038b057d42",
"is_available": true
}],
"price": 500,
@@ -126,7 +126,7 @@
"items": [{
"type": "pack",
"id": "groovecoaster",
"_id": "5fc8306209787401bb857d14",
"_id": "5fd01460a6e343038b057d5b",
"is_available": true
}],
"price": 500,
@@ -138,7 +138,7 @@
"items": [{
"type": "pack",
"id": "zettai",
"_id": "5fc8306209787401bb857cfc",
"_id": "5fd01460a6e343038b057d4f",
"is_available": true
}],
"price": 500,
@@ -150,7 +150,7 @@
"items": [{
"type": "pack",
"id": "chunithm",
"_id": "5fc8306209787401bb857d09",
"_id": "5fd01460a6e343038b057d39",
"is_available": true
}],
"price": 300,
@@ -160,7 +160,7 @@
"items": [{
"type": "pack",
"id": "prelude",
"_id": "5fc8306209787401bb857d15",
"_id": "5fd01460a6e343038b057d5c",
"is_available": true
}],
"price": 400,
@@ -170,7 +170,7 @@
"items": [{
"type": "pack",
"id": "omatsuri",
"_id": "5fc8306209787401bb857cfd",
"_id": "5fd01460a6e343038b057d50",
"is_available": true
}],
"price": 500,
@@ -180,7 +180,7 @@
"items": [{
"type": "pack",
"id": "vs",
"_id": "5fc8306209787401bb857d0c",
"_id": "5fd01460a6e343038b057d3c",
"is_available": true
}],
"price": 500,
@@ -190,7 +190,7 @@
"items": [{
"type": "pack",
"id": "extend",
"_id": "5fc8306209787401bb857d18",
"_id": "5fd01460a6e343038b057d5f",
"is_available": true
}],
"price": 700,
@@ -200,9 +200,19 @@
"items": [{
"type": "pack",
"id": "alice",
"_id": "5fc8306209787401bb857d02",
"_id": "5fd01460a6e343038b057d55",
"is_available": true
}],
"orig_price": 500,
"price": 500
}, {
"name": "alice_append_1",
"items": [{
"type": "pack",
"id": "alice_append_1",
"_id": "5fd01460a6e343038b057d33",
"is_available": true
}],
"orig_price": 300,
"price": 300
}]

View File

@@ -470,9 +470,23 @@ def redeem():
# 礼物确认
@app.route('/coffee/12/present/me/claim/<present_id>', methods=['POST'])
def claim_present(present_id):
return jsonify({
"success": True
})
headers = request.headers
token = headers['Authorization']
token = token[7:]
try:
user_id = server.auth.token_get_id(token)
if user_id is not None:
flag = server.arcpurchase.claim_user_present(user_id, present_id)
if flag:
return jsonify({
"success": True
})
else:
return error_return(108)
else:
return error_return(108)
except:
return error_return(108)
# 购买为了world模式boost一下

View File

@@ -120,3 +120,38 @@ def buy_single(user_id, single_id):
return {
"success": True
}
def get_user_present(c, user_id):
# 获取用户奖励,返回字典列表
c.execute(
'''select * from present where present_id in (select present_id from user_present where user_id=:a)''', {'a': user_id})
x = c.fetchall()
re = []
if x:
for i in x:
re.append({'expire_ts': i[1],
'description': i[3],
'present_id': i[0],
'items': i[2]
})
return re
def claim_user_present(user_id, present_id):
# 确认并删除用户奖励,返回成功与否的布尔值
flag = False
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute('''select exists(select * from user_present where user_id=:a and present_id=:b)''',
{'a': user_id, 'b': present_id})
if c.fetchone() == (1,):
flag = True
c.execute('''delete from user_present where user_id=:a and present_id=:b''',
{'a': user_id, 'b': present_id})
conn.commit()
conn.close()
return flag

View File

@@ -1070,15 +1070,6 @@ def arc_all_get(user_id):
}, {
"unlock_key": "lucifer|2|0",
"complete": 1
}, {
"unlock_key": "saikyostronger|2|3|izana|2",
"complete": 1
}, {
"unlock_key": "halcyon|1|0",
"complete": 1
}, {
"unlock_key": "memoryforest|2|0",
"complete": 1
}, {
"unlock_key": "tiemedowngently|2|0",
"complete": 1
@@ -1103,6 +1094,21 @@ def arc_all_get(user_id):
}, {
"unlock_key": "ignotus|2|0",
"complete": 1
}, {
"unlock_key": "snowwhite|1|0",
"complete": 1
}, {
"unlock_key": "partyvinyl|1|0",
"complete": 1
}, {
"unlock_key": "axiumcrisis|1|0",
"complete": 1
}, {
"unlock_key": "ifi|2|0",
"complete": 1
}, {
"unlock_key": "jump|2|0",
"complete": 1
}, {
"unlock_key": "harutopia|2|0",
"complete": 1
@@ -1133,6 +1139,9 @@ def arc_all_get(user_id):
}, {
"unlock_key": "guardina|0|0",
"complete": 1
}, {
"unlock_key": "jump|1|0",
"complete": 1
}, {
"unlock_key": "blaster|2|0",
"complete": 1
@@ -1196,6 +1205,48 @@ def arc_all_get(user_id):
}, {
"unlock_key": "fractureray|2|101",
"complete": 100
}, {
"unlock_key": "monochromeprincess|2|0",
"complete": 1
}, {
"unlock_key": "babaroque|1|0",
"complete": 1
}, {
"unlock_key": "flyburg|2|0",
"complete": 1
}, {
"unlock_key": "nirvluce|1|0",
"complete": 1
}, {
"unlock_key": "monochromeprincess|1|0",
"complete": 1
}, {
"unlock_key": "clotho|1|0",
"complete": 1
}, {
"unlock_key": "lethaeus|1|0",
"complete": 1
}, {
"unlock_key": "halcyon|2|0",
"complete": 1
}, {
"unlock_key": "saikyostronger|2|3|izana|2",
"complete": 1
}, {
"unlock_key": "memoryforest|2|0",
"complete": 1
}, {
"unlock_key": "halcyon|1|0",
"complete": 1
}, {
"unlock_key": "toaliceliddell|2|0",
"complete": 1
}, {
"unlock_key": "blrink|1|0",
"complete": 1
}, {
"unlock_key": "felis|1|0",
"complete": 1
}, {
"unlock_key": "qualia|1|0",
"complete": 1
@@ -1220,18 +1271,6 @@ def arc_all_get(user_id):
}, {
"unlock_key": "espebranch|2|0",
"complete": 1
}, {
"unlock_key": "snowwhite|1|0",
"complete": 1
}, {
"unlock_key": "partyvinyl|1|0",
"complete": 1
}, {
"unlock_key": "axiumcrisis|1|0",
"complete": 1
}, {
"unlock_key": "ifi|2|0",
"complete": 1
}, {
"unlock_key": "tempestissimo|1|101",
"complete": 100
@@ -1328,18 +1367,6 @@ def arc_all_get(user_id):
}, {
"unlock_key": "ignotus|1|0",
"complete": 1
}, {
"unlock_key": "nirvluce|1|0",
"complete": 1
}, {
"unlock_key": "monochromeprincess|1|0",
"complete": 1
}, {
"unlock_key": "lethaeus|1|0",
"complete": 1
}, {
"unlock_key": "clotho|1|0",
"complete": 1
}, {
"unlock_key": "aterlbus|2|0",
"complete": 1
@@ -1370,12 +1397,6 @@ def arc_all_get(user_id):
}, {
"unlock_key": "genesis|2|0",
"complete": 1
}, {
"unlock_key": "halcyon|2|0",
"complete": 1
}, {
"unlock_key": "blrink|1|0",
"complete": 1
}, {
"unlock_key": "grievouslady|0|101",
"complete": 100
@@ -1415,15 +1436,6 @@ def arc_all_get(user_id):
}, {
"unlock_key": "cyaegha|1|0",
"complete": 1
}, {
"unlock_key": "monochromeprincess|2|0",
"complete": 1
}, {
"unlock_key": "babaroque|1|0",
"complete": 1
}, {
"unlock_key": "flyburg|2|0",
"complete": 1
}, {
"unlock_key": "goodtek|1|0",
"complete": 1
@@ -1436,6 +1448,12 @@ def arc_all_get(user_id):
}, {
"unlock_key": "blaster|1|0",
"complete": 1
}, {
"unlock_key": "felis|2|0",
"complete": 1
}, {
"unlock_key": "toaliceliddell|1|0",
"complete": 1
}, {
"unlock_key": "gothiveofra|2|0",
"complete": 1

View File

@@ -330,7 +330,7 @@ def arc_aggregate_big(user_id):
}
}, {
"id": 4,
"value": []
"value": server.arcpurchase.get_user_present(c, user_id)
}, {
"id": 5,
"value": {

View File

@@ -142,7 +142,7 @@ def update_user_char(c):
def update_database():
# 将old数据库不存在数据加入到新数据库上并删除old数据库
# 对于arcaea_datebase.db更新best_scorefriendrecent30useruser_world, user_item, user_save并用character数据更新user_char
# 对于arcaea_datebase.db更新best_scorefriendrecent30useruser_world, user_item, user_save, login, present, user_present并用character数据更新user_char
# 对于arcsong.db更新songs
if os.path.isfile("database/old_arcaea_database.db") and os.path.isfile("database/arcaea_database.db"):
conn1 = sqlite3.connect('./database/old_arcaea_database.db')
@@ -157,6 +157,9 @@ def update_database():
update_one_table(c1, c2, 'user_world')
update_one_table(c1, c2, 'user_item')
update_one_table(c1, c2, 'user_save')
update_one_table(c1, c2, 'login')
update_one_table(c1, c2, 'present')
update_one_table(c1, c2, 'user_present')
update_user_char(c2)