8 Commits

Author SHA1 Message Date
Lost-MSth
d0be49fe20 Update to v2.7.0 2021-11-14 21:35:34 +08:00
Lost-MSth
b494b93c14 Update to v2.6.6 without release
- Fix a bug about purchase discount
- Fix a bug about database synchronization, which may make 'api_login' table empty
- For Arcaea 3.8.8
- Update a logout api
2021-10-22 20:00:22 +08:00
Lost-MSth
a523ff5aae Update README.md
Add some download links.

close #28
2021-10-01 16:24:56 +08:00
Lost-MSth
acbe9fc4a1 Merge pull request #31 from superDXZ/master
Try to add some download links.
2021-10-01 16:19:53 +08:00
superDXZ
9422bf7182 Update README.md
Found another download site
2021-10-01 02:49:06 +08:00
superDXZ
53acad4ffb Update README.md
Found another download site
2021-10-01 02:46:39 +08:00
Lost-MSth
13048e57f4 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.
2021-09-30 19:02:10 +08:00
Lost-MSth
39d3f073ba Update to v2.6.4 without release 2021-09-08 17:35:10 +08:00
16 changed files with 2451 additions and 1743 deletions

View File

@@ -53,7 +53,9 @@ It is just so interesting. What it can do is under exploration.
## 下载 Download ## 下载 Download
[这里 Here](https://github.com/Lost-MSth/Arcaea-server/releases) [这里 Here](https://github.com/Lost-MSth/Arcaea-server/releases)
[Arcaea](https://konmai.cn/#arcaea) [Arcaea-CN official](https://arcaea.lowiro.com/zh)
[Arcaea-lowi.ro](https://lowi.ro)
[Arcaea-RhyDown](https://rhydown.com)
## 更新日志 Update log ## 更新日志 Update log
只保留最新版本 Only keep the latest version. 只保留最新版本 Only keep the latest version.
@@ -62,10 +64,24 @@ 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. > Tips: When updating, please keep the original database in case of data loss.
### Version 2.6.3 ### Version 2.7.0
- 适用于Arcaea 3.8.2版本 For Arcaea 3.8.2 - 适用于Arcaea 3.9.0版本 For Arcaea 3.9.0
- 更新了歌曲数据库 Update the song database. - 更新了歌曲数据库 Update the song database.
- 新搭档 **群愿(盛夏** 已解锁 Unlock the new character **Kanae(Midsummer)**. - 新搭档 **爱丽丝 & 坦尼尔(小步舞曲** 已解锁 Unlock the new character **Alice & Tenniel (Minuet)**.
- 新搭档 **对立(挽歌)** 已解锁 Unlock the new character **Tairitsu (Elegy)**.
- 搭档 **爱托** 已觉醒 Uncap the character **Eto**.
- 搭档 **露娜** 已觉醒 Uncap the character **Luna**.
- 新增爱托和露娜的觉醒技能(可能有问题) Add the uncapped skills of Eto and Luna (There may be bugs.).
- 新增是否同步角色表的设置选项 Add the setting option of whether updating the character table.
- 以下是累积更新 The following are cumulative updates:
- 添加购买物品含有以太之滴的支持 Add support for purchasing items containing generic cores.
- 修复关于购买物品打折的问题 Fix a bug about purchase discount.
- 修复关于数据库同步的问题这可能导致api_login表为空 Fix a bug about database synchronization, which may make 'api_login' table empty.
- 新增登出API接口 Update a logout API.
> 提示:某些数据可能尚不完整,某个单曲的解锁和某两个角色的数据可能会有问题
> Tips: Some data may not be complete, so there may be problems with the unlocking of a single song and the data of two characters.
## 运行环境与依赖 Running environment and requirements ## 运行环境与依赖 Running environment and requirements

View File

@@ -52,9 +52,14 @@ def login(auth: str, ip: str):
return {'token': token, 'user_id': user_id}, 0 return {'token': token, 'user_id': user_id}, 0
def logout(): def logout(user: User):
# 登出接口 # 登出接口,返回错误码
pass code = 999
with Connect() as c:
c.execute('''delete from api_login where user_id=?''', (user.user_id,))
code = 0
return code
def id_get_role_id(c, user_id): def id_get_role_id(c, user_id):
@@ -119,7 +124,7 @@ def role_required(request, power=[]):
return jsonify({'status': 400, 'code': -1, 'data': {}, 'msg': 'Payload must be a valid json'}) return jsonify({'status': 400, 'code': -1, 'data': {}, 'msg': 'Payload must be a valid json'})
if not 'Token' in request.headers: if not 'Token' in request.headers:
return jsonify({'status': 401, 'code': -1, 'data': {}, 'msg': 'No Token'}) return jsonify({'status': 401, 'code': -1, 'data': {}, 'msg': 'No token'})
user = User() user = User()
if Config.API_TOKEN == request.headers['Token'] and Config.API_TOKEN != '': if Config.API_TOKEN == request.headers['Token'] and Config.API_TOKEN != '':
@@ -131,7 +136,7 @@ def role_required(request, power=[]):
user.user_id = api_token_get_id( user.user_id = api_token_get_id(
c, request.headers['Token']) c, request.headers['Token'])
if user.user_id is None: if user.user_id is None:
return jsonify({'status': 404, 'code': -1, 'data': {}, 'msg': ''}) return jsonify({'status': 401, 'code': -1, 'data': {}, 'msg': 'No token'})
role_id = id_get_role_id(c, user.user_id) role_id = id_get_role_id(c, user.user_id)
user.role = role_id_get_role(c, role_id) user.role = role_id_get_role(c, role_id)

View File

@@ -12,7 +12,8 @@ def code_get_msg(code):
'-103': 'Wrong sort parameter', '-103': 'Wrong sort parameter',
'-104': 'Wrong sort order parameter', '-104': 'Wrong sort order parameter',
'-201': 'Wrong username or password', '-201': 'Wrong username or password',
'-202': 'User is banned' '-202': 'User is banned',
'-999': 'Unknown error'
} }
return msg[str(code)] return msg[str(code)]

View File

@@ -101,7 +101,7 @@ def token_get(user):
@api.api_auth.role_required(request, ['change_me', 'select_me', 'select']) @api.api_auth.role_required(request, ['change_me', 'select_me', 'select'])
def token_delete(user): def token_delete(user):
# 登出 # 登出
return return_encode() return return_encode(api.api_auth.logout(user))
@bp.route('/users', methods=['GET']) @bp.route('/users', methods=['GET'])

Binary file not shown.

View File

@@ -4,7 +4,7 @@ import json
# 数据库初始化文件删掉arcaea_database.db文件后运行即可谨慎使用 # 数据库初始化文件删掉arcaea_database.db文件后运行即可谨慎使用
ARCAEA_SERVER_VERSION = 'v2.6.3' ARCAEA_SERVER_VERSION = 'v2.7.0'
def main(path='./'): def main(path='./'):
@@ -228,6 +228,7 @@ def main(path='./'):
c.execute('''create table if not exists purchase_item(purchase_name text, c.execute('''create table if not exists purchase_item(purchase_name text,
item_id text, item_id text,
type text, type text,
amount int,
primary key(purchase_name, item_id, type) primary key(purchase_name, item_id, type)
);''') );''')
c.execute('''create table if not exists user_save(user_id int primary key, c.execute('''create table if not exists user_save(user_id int primary key,
@@ -298,46 +299,46 @@ def main(path='./'):
# 搭档初始化 # 搭档初始化
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', 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', 'Luna & Mia', 'areus', 'seele', 'isabelle', 'mir', 'lagrange', 'linka', 'nami', 'Saya & Elizabeth', 'lily', 'kanae(midsummer)'] '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', 'Luna & Mia', 'areus', 'seele', 'isabelle', 'mir', 'lagrange', 'linka', 'nami', 'Saya & Elizabeth', 'lily', 'kanae(midsummer)', 'alice&tenniel(minuet)', 'tairitsu(elegy)']
skill_id = ['gauge_easy', '', '', '', 'note_mirror', '', '', 'gauge_hard', 'frag_plus_10_pack_stellights', 'gauge_easy|frag_plus_15_pst&prs', 'gauge_hard|fail_frag_minus_100', 'frag_plus_5_side_light', 'visual_hide_hp', 'frag_plus_5_side_conflict', 'challenge_fullcombo_0gauge', 'gauge_overflow', 'gauge_easy|note_mirror', 'note_mirror', 'visual_tomato_pack_tonesphere', skill_id = ['gauge_easy', '', '', '', 'note_mirror', '', '', 'gauge_hard', 'frag_plus_10_pack_stellights', 'gauge_easy|frag_plus_15_pst&prs', 'gauge_hard|fail_frag_minus_100', 'frag_plus_5_side_light', 'visual_hide_hp', 'frag_plus_5_side_conflict', 'challenge_fullcombo_0gauge', 'gauge_overflow', 'gauge_easy|note_mirror', 'note_mirror', 'visual_tomato_pack_tonesphere',
'frag_rng_ayu', 'gaugestart_30|gaugegain_70', 'combo_100-frag_1', 'audio_gcemptyhit_pack_groovecoaster', 'gauge_saya', 'gauge_chuni', 'kantandeshou', 'gauge_haruna', 'frags_nono', 'gauge_pandora', 'gauge_regulus', 'omatsuri_daynight', '', '', 'sometimes(note_mirror|frag_plus_5)', 'scoreclear_aa|visual_scoregauge', 'gauge_tempest', 'gauge_hard', 'gauge_ilith_summer', '', 'note_mirror|visual_hide_far', 'frags_ongeki', 'gauge_areus', 'gauge_seele', 'gauge_isabelle', 'gauge_exhaustion', 'skill_lagrange', 'gauge_safe_10', 'frags_nami', 'skill_elizabeth', 'skill_lily', 'skill_kanae_midsummer'] 'frag_rng_ayu', 'gaugestart_30|gaugegain_70', 'combo_100-frag_1', 'audio_gcemptyhit_pack_groovecoaster', 'gauge_saya', 'gauge_chuni', 'kantandeshou', 'gauge_haruna', 'frags_nono', 'gauge_pandora', 'gauge_regulus', 'omatsuri_daynight', '', '', 'sometimes(note_mirror|frag_plus_5)', 'scoreclear_aa|visual_scoregauge', 'gauge_tempest', 'gauge_hard', 'gauge_ilith_summer', '', 'note_mirror|visual_hide_far', 'frags_ongeki', 'gauge_areus', 'gauge_seele', 'gauge_isabelle', 'gauge_exhaustion', 'skill_lagrange', 'gauge_safe_10', 'frags_nami', 'skill_elizabeth', 'skill_lily', 'skill_kanae_midsummer', '', '']
skill_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', '', '', 'shirabe_entry_fee', skill_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', 'eto_uncap', 'luna_uncap', 'shirabe_entry_fee',
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''] '', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
skill_unlock_level = [0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, skill_unlock_level = [0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0,
0, 0, 0, 8, 0, 14, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 0, 0, 0, 8, 0, 14, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
frag1 = [55, 55, 60, 50, 47, 0, 47, 57, 41, 22, 50, 54, 60, 56, 78, 42, 41, 61, 52, 50, 52, 32, frag1 = [55, 55, 60, 50, 47, 0, 47, 57, 41, 22, 50, 54, 60, 56, 78, 42, 41, 61, 52, 50, 52, 32,
42, 55, 45, 58, 43, 0.5, 68, 50, 62, 45, 45, 52, 44, 27, 59, 0, 45, 50, 50, 47, 47, 61, 43, 42, 50, 25, 58, 50, 61] 42, 55, 45, 58, 43, 0.5, 68, 50, 62, 45, 45, 52, 44, 27, 59, 0, 45, 50, 50, 47, 47, 61, 43, 42, 50, 25, 58, 50, 61, 55, 55]
prog1 = [35, 55, 47, 50, 60, 0, 60, 70, 58, 45, 70, 45, 42, 46, 61, 67, 49, 44, 28, 45, 24, 46, 52, prog1 = [35, 55, 47, 50, 60, 0, 60, 70, 58, 45, 70, 45, 42, 46, 61, 67, 49, 44, 28, 45, 24, 46, 52,
59, 62, 33, 58, 25, 63, 69, 50, 45, 45, 51, 34, 70, 62, 70, 45, 32, 32, 61, 47, 47, 37, 42, 50, 50, 45, 41, 61] 59, 62, 33, 58, 25, 63, 69, 50, 45, 45, 51, 34, 70, 62, 70, 45, 32, 32, 61, 47, 47, 37, 42, 50, 50, 45, 41, 61, 55, 55]
overdrive1 = [35, 55, 25, 50, 47, 0, 72, 57, 41, 7, 10, 32, 65, 31, 61, 53, 31, 47, 38, 12, 39, 18, overdrive1 = [35, 55, 25, 50, 47, 0, 72, 57, 41, 7, 10, 32, 65, 31, 61, 53, 31, 47, 38, 12, 39, 18,
48, 65, 45, 55, 44, 25, 46, 44, 33, 45, 45, 37, 25, 27, 50, 20, 45, 63, 21, 47, 61, 47, 65, 80, 50, 30, 49, 15, 34] 48, 65, 45, 55, 44, 25, 46, 44, 33, 45, 45, 37, 25, 27, 50, 20, 45, 63, 21, 47, 61, 47, 65, 80, 50, 30, 49, 15, 34, 55, 55]
frag20 = [78, 80, 90, 75, 70, 0, 70, 79, 65, 40, 50, 80, 90, 82, 0, 61, 67, 92, 85, 50, 86, 52, frag20 = [78, 80, 90, 75, 70, 0, 70, 79, 65, 40, 50, 80, 90, 82, 0, 61, 67, 92, 85, 50, 86, 52,
65, 85, 67, 88, 64, 0.5, 95, 70, 95, 50, 80, 87, 71, 50, 85, 0, 80, 75, 50, 70, 70, 90, 65, 80, 100, 50, 68, 60, 90] 65, 85, 67, 88, 64, 0.5, 95, 70, 95, 50, 80, 87, 71, 50, 85, 0, 80, 75, 50, 70, 70, 90, 65, 80, 100, 50, 68, 60, 90, 80, 80]
prog20 = [61, 80, 70, 75, 90, 0, 90, 102, 84, 78, 105, 67, 63, 68, 0, 99, 80, 66, 46, 83, 40, 73, prog20 = [61, 80, 70, 75, 90, 0, 90, 102, 84, 78, 105, 67, 63, 68, 0, 99, 80, 66, 46, 83, 40, 73,
80, 90, 93, 50, 86, 78, 89, 98, 75, 80, 50, 64, 55, 100, 90, 110, 80, 50, 74, 90, 70, 70, 56, 80, 100, 55, 65, 59, 90] 80, 90, 93, 50, 86, 78, 89, 98, 75, 80, 50, 64, 55, 100, 90, 110, 80, 50, 74, 90, 70, 70, 56, 80, 100, 55, 65, 59, 90, 80, 80]
overdrive20 = [61, 80, 47, 75, 70, 0, 95, 79, 65, 31, 50, 59, 90, 58, 0, 78, 50, 70, 62, 49, 64, overdrive20 = [61, 80, 47, 75, 70, 0, 95, 79, 65, 31, 50, 59, 90, 58, 0, 78, 50, 70, 62, 49, 64,
46, 73, 95, 67, 84, 70, 78, 69, 70, 50, 80, 80, 63, 25, 50, 72, 55, 50, 95, 55, 70, 90, 70, 99, 80, 100, 40, 69, 62, 51] 46, 73, 95, 67, 84, 70, 78, 69, 70, 50, 80, 80, 63, 25, 50, 72, 55, 50, 95, 55, 70, 90, 70, 99, 80, 100, 40, 69, 62, 51, 80, 80]
frag30 = [88, 90, 100, 75, 80, 0, 70, 79, 65, 40, 50, 80, 90, 92, 0, 61, 67, 92, 85, 50, 86, 62, frag30 = [88, 90, 100, 75, 80, 0, 70, 79, 65, 40, 50, 90, 100, 92, 0, 61, 67, 92, 85, 50, 86, 62,
65, 85, 67, 88, 74, 0.5, 105, 80, 95, 50, 80, 87, 71, 50, 95, 0, 80, 75, 50, 70, 80, 100, 65, 80, 100, 50, 68, 60, 90] 65, 85, 67, 88, 74, 0.5, 105, 80, 95, 50, 80, 87, 71, 50, 95, 0, 80, 75, 50, 70, 80, 100, 65, 80, 100, 50, 68, 60, 90, 80, 80]
prog30 = [71, 90, 80, 75, 100, 0, 90, 102, 84, 78, 105, 67, 63, 78, 0, 99, 80, 66, 46, 83, 40, 83, prog30 = [71, 90, 80, 75, 100, 0, 90, 102, 84, 78, 105, 77, 73, 78, 0, 99, 80, 66, 46, 83, 40, 83,
80, 90, 93, 50, 96, 88, 99, 108, 75, 80, 50, 64, 55, 100, 100, 110, 80, 50, 74, 90, 80, 80, 56, 80, 100, 55, 65, 59, 90] 80, 90, 93, 50, 96, 88, 99, 108, 75, 80, 50, 64, 55, 100, 100, 110, 80, 50, 74, 90, 80, 80, 56, 80, 100, 55, 65, 59, 90, 80, 80]
overdrive30 = [71, 90, 57, 75, 80, 0, 95, 79, 65, 31, 50, 59, 90, 68, 0, 78, 50, 70, 62, 49, 64, overdrive30 = [71, 90, 57, 75, 80, 0, 95, 79, 65, 31, 50, 69, 100, 68, 0, 78, 50, 70, 62, 49, 64,
56, 73, 95, 67, 84, 80, 88, 79, 80, 50, 80, 80, 63, 25, 50, 82, 55, 50, 95, 55, 70, 100, 80, 99, 80, 100, 40, 69, 62, 51] 56, 73, 95, 67, 84, 80, 88, 79, 80, 50, 80, 80, 63, 25, 50, 82, 55, 50, 95, 55, 70, 100, 80, 99, 80, 100, 40, 69, 62, 51, 80, 80]
char_type = [1, 0, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, 0, 2, 3, 1, 0, 0, 0, 1, char_type = [1, 0, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, 0, 2, 3, 1, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0] 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0]
char_core = { char_core = {
0: [{'core_id': 'core_hollow', 'amount': 25}, {'core_id': 'core_desolate', 'amount': 5}], 0: [{'core_id': 'core_hollow', 'amount': 25}, {'core_id': 'core_desolate', 'amount': 5}],
@@ -352,13 +353,15 @@ def main(path='./'):
29: [{'core_id': 'core_chunithm', 'amount': 15}], 29: [{'core_id': 'core_chunithm', 'amount': 15}],
36: [{'core_id': 'core_chunithm', 'amount': 15}], 36: [{'core_id': 'core_chunithm', 'amount': 15}],
42: [{'core_id': 'core_chunithm', 'amount': 15}], 42: [{'core_id': 'core_chunithm', 'amount': 15}],
43: [{'core_id': 'core_chunithm', 'amount': 15}] 43: [{'core_id': 'core_chunithm', 'amount': 15}],
11: [{'core_id': 'core_binary', 'amount': 25}, {'core_id': 'core_hollow', 'amount': 5}],
12: [{'core_id': 'core_binary', 'amount': 25}, {'core_id': 'core_desolate', 'amount': 5}]
} }
for i in range(0, 51): for i in range(0, 53):
skill_requires_uncap = 1 if i == 2 else 0 skill_requires_uncap = 1 if i == 2 else 0
if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21, 42, 43]: if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21, 42, 43, 11, 12]:
sql = '''insert into character values(?,?,30,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1)''' sql = '''insert into character values(?,?,30,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1)'''
c.execute(sql, (i, char[i], frag1[i], prog1[i], overdrive1[i], frag20[i], prog20[i], overdrive20[i], c.execute(sql, (i, char[i], frag1[i], prog1[i], overdrive1[i], frag20[i], prog20[i], overdrive20[i],
frag30[i], prog30[i], overdrive30[i], skill_id[i], skill_unlock_level[i], skill_requires_uncap, skill_id_uncap[i], char_type[i])) frag30[i], prog30[i], overdrive30[i], skill_id[i], skill_unlock_level[i], skill_requires_uncap, skill_id_uncap[i], char_type[i]))
@@ -373,13 +376,13 @@ def main(path='./'):
c.execute('''insert into char_item values(?,?,'core',?)''', c.execute('''insert into char_item values(?,?,'core',?)''',
(i, j['core_id'], j['amount'])) (i, j['core_id'], j['amount']))
cores = ['core_hollow', 'core_desolate', 'core_chunithm', 'core_crimson', cores = ['core_hollow', 'core_desolate', 'core_chunithm', 'core_crimson',
'core_ambivalent', 'core_scarlet', 'core_groove', 'core_generic'] 'core_ambivalent', 'core_scarlet', 'core_groove', 'core_generic', 'core_binary']
for i in cores: for i in cores:
c.execute('''insert into item values(?,"core",1,'')''', (i,)) c.execute('''insert into item values(?,"core",1,'')''', (i,))
world_songs = ["babaroque", "shadesoflight", "kanagawa", "lucifer", "anokumene", "ignotus", "rabbitintheblackroom", "qualia", "redandblue", "bookmaker", "darakunosono", "espebranch", "blacklotus", "givemeanightmare", "vividtheory", "onefr", "gekka", "vexaria3", "infinityheaven3", "fairytale3", "goodtek3", "suomi", "rugie", "faintlight", "harutopia", "goodtek", "dreaminattraction", "syro", "diode", "freefall", "grimheart", "blaster", world_songs = ["babaroque", "shadesoflight", "kanagawa", "lucifer", "anokumene", "ignotus", "rabbitintheblackroom", "qualia", "redandblue", "bookmaker", "darakunosono", "espebranch", "blacklotus", "givemeanightmare", "vividtheory", "onefr", "gekka", "vexaria3", "infinityheaven3", "fairytale3", "goodtek3", "suomi", "rugie", "faintlight", "harutopia", "goodtek", "dreaminattraction", "syro", "diode", "freefall", "grimheart", "blaster",
"cyberneciacatharsis", "monochromeprincess", "revixy", "vector", "supernova", "nhelv", "purgatorium3", "dement3", "crossover", "guardina", "axiumcrisis", "worldvanquisher", "sheriruth", "pragmatism", "gloryroad", "etherstrike", "corpssansorganes", "lostdesire", "blrink", "essenceoftwilight", "lapis", "solitarydream", "lumia3", "purpleverse", "moonheart3", "glow", "enchantedlove", "take", "lifeispiano", "vandalism", "nexttoyou3", "lostcivilization3", "turbocharger", "bookmaker3", "laqryma3", "kyogenkigo", "hivemind", "seclusion", "quonwacca3", "bluecomet"] "cyberneciacatharsis", "monochromeprincess", "revixy", "vector", "supernova", "nhelv", "purgatorium3", "dement3", "crossover", "guardina", "axiumcrisis", "worldvanquisher", "sheriruth", "pragmatism", "gloryroad", "etherstrike", "corpssansorganes", "lostdesire", "blrink", "essenceoftwilight", "lapis", "solitarydream", "lumia3", "purpleverse", "moonheart3", "glow", "enchantedlove", "take", "lifeispiano", "vandalism", "nexttoyou3", "lostcivilization3", "turbocharger", "bookmaker3", "laqryma3", "kyogenkigo", "hivemind", "seclusion", "quonwacca3", "bluecomet", "energysynergymatrix", "gengaozo", "lastendconductor3"]
for i in world_songs: for i in world_songs:
c.execute('''insert into item values(?,"world_song",1,'')''', (i,)) c.execute('''insert into item values(?,"world_song",1,'')''', (i,))
@@ -411,10 +414,17 @@ def main(path='./'):
_id = '' _id = ''
else: else:
_id = j['_id'] _id = j['_id']
c.execute('''insert into item values(?,?,?,?)''', c.execute(
(j['id'], j['type'], j['is_available'], _id)) '''select exists(select * from item where item_id=?)''', (j['id'],))
c.execute('''insert into purchase_item values(?,?,?)''', if c.fetchone() == (0,):
(i['name'], j['id'], j['type'])) c.execute('''insert into item values(?,?,?,?)''',
(j['id'], j['type'], j['is_available'], _id))
if 'amount' in j:
amount = j['amount']
else:
amount = 1
c.execute('''insert into purchase_item values(?,?,?,?)''',
(i['name'], j['id'], j['type'], amount))
# item初始化 # item初始化
f = open(path+'singles.json', 'r') f = open(path+'singles.json', 'r')

View File

@@ -1,268 +1,515 @@
[{ [
"name": "core", {
"items": [{ "name": "core",
"type": "pack", "items": [
"id": "core", {
"is_available": true "type": "pack",
}], "id": "core",
"price": 500, "is_available": true
"orig_price": 500, },
"discount_from": 1615248000000, {
"discount_to": 1615852799000 "type": "core",
}, { "amount": 5,
"name": "shiawase", "id": "core_generic",
"items": [{ "is_available": true
"type": "pack", }
"id": "shiawase", ],
"is_available": true "price": 500,
}, { "orig_price": 500,
"type": "character", "discount_from": 1615248000000,
"id": "kou", "discount_to": 1615852799000
"is_available": true },
}], {
"price": 500, "name": "shiawase",
"orig_price": 500, "items": [
"discount_from": 1615248000000, {
"discount_to": 1615852799000 "type": "pack",
}, { "id": "shiawase",
"name": "dynamix", "is_available": true
"items": [{ },
"type": "pack", {
"id": "dynamix", "type": "character",
"is_available": true "id": "kou",
}, { "is_available": true
"type": "character", },
"id": "sapphire", {
"is_available": true "type": "core",
}], "amount": 5,
"price": 500, "id": "core_generic",
"orig_price": 500, "is_available": true
"discount_from": 1615248000000, }
"discount_to": 1615852799000 ],
}, { "price": 500,
"name": "mirai", "orig_price": 500,
"items": [{ "discount_from": 1615248000000,
"type": "pack", "discount_to": 1615852799000
"id": "mirai", },
"is_available": true {
}, { "name": "dynamix",
"type": "character", "items": [
"id": "lethe", {
"is_available": true "type": "pack",
}], "id": "dynamix",
"price": 500, "is_available": true
"orig_price": 500, },
"discount_from": 1615248000000, {
"discount_to": 1615852799000 "type": "character",
}, { "id": "sapphire",
"name": "yugamu", "is_available": true
"items": [{ },
"type": "pack", {
"id": "yugamu", "type": "core",
"is_available": true "amount": 5,
}], "id": "core_generic",
"price": 500, "is_available": true
"orig_price": 500, }
"discount_from": 1615248000000, ],
"discount_to": 1615852799000 "price": 500,
}, { "orig_price": 500,
"name": "lanota", "discount_from": 1615248000000,
"items": [{ "discount_to": 1615852799000
"type": "pack", },
"id": "lanota", {
"is_available": true "name": "mirai",
}], "items": [
"price": 500, {
"orig_price": 500, "type": "pack",
"discount_from": 1615248000000, "id": "mirai",
"discount_to": 1615852799000 "is_available": true
}, { },
"name": "nijuusei", {
"items": [{ "type": "character",
"type": "pack", "id": "lethe",
"id": "nijuusei", "is_available": true
"is_available": true },
}], {
"price": 500, "type": "core",
"orig_price": 500, "amount": 5,
"discount_from": 1615248000000, "id": "core_generic",
"discount_to": 1615852799000 "is_available": true
}, { }
"name": "rei", ],
"items": [{ "price": 500,
"type": "pack", "orig_price": 500,
"id": "rei", "discount_from": 1615248000000,
"is_available": true "discount_to": 1615852799000
}], },
"price": 500, {
"orig_price": 500, "name": "yugamu",
"discount_from": 1615248000000, "items": [
"discount_to": 1615852799000 {
}, { "type": "pack",
"name": "tonesphere", "id": "yugamu",
"items": [{ "is_available": true
"type": "pack", },
"id": "tonesphere", {
"is_available": true "type": "core",
}], "amount": 5,
"price": 500, "id": "core_generic",
"orig_price": 500, "is_available": true
"discount_from": 1615248000000, }
"discount_to": 1615852799000 ],
}, { "price": 500,
"name": "groovecoaster", "orig_price": 500,
"items": [{ "discount_from": 1615248000000,
"type": "pack", "discount_to": 1615852799000
"id": "groovecoaster", },
"is_available": true {
}], "name": "lanota",
"price": 500, "items": [
"orig_price": 500, {
"discount_from": 1615248000000, "type": "pack",
"discount_to": 1615852799000 "id": "lanota",
}, { "is_available": true
"name": "zettai", },
"items": [{ {
"type": "pack", "type": "core",
"id": "zettai", "amount": 5,
"is_available": true "id": "core_generic",
}], "is_available": true
"price": 500, }
"orig_price": 500, ],
"discount_from": 1615248000000, "price": 500,
"discount_to": 1615852799000 "orig_price": 500,
}, { "discount_from": 1615248000000,
"name": "chunithm", "discount_to": 1615852799000
"items": [{ },
"type": "pack", {
"id": "chunithm", "name": "nijuusei",
"is_available": true "items": [
}], {
"price": 300, "type": "pack",
"orig_price": 300 "id": "nijuusei",
}, { "is_available": true
"name": "prelude", },
"items": [{ {
"type": "pack", "type": "core",
"id": "prelude", "amount": 5,
"is_available": true "id": "core_generic",
}], "is_available": true
"price": 400, }
"orig_price": 400, ],
"discount_from": 1615248000000, "price": 500,
"discount_to": 1615852799000 "orig_price": 500,
}, { "discount_from": 1615248000000,
"name": "omatsuri", "discount_to": 1615852799000
"items": [{ },
"type": "pack", {
"id": "omatsuri", "name": "rei",
"is_available": true "items": [
}], {
"price": 500, "type": "pack",
"orig_price": 500, "id": "rei",
"discount_from": 1615248000000, "is_available": true
"discount_to": 1615852799000 },
}, { {
"name": "vs", "type": "core",
"items": [{ "amount": 5,
"type": "pack", "id": "core_generic",
"id": "vs", "is_available": true
"is_available": true }
}], ],
"price": 500, "price": 500,
"orig_price": 500, "orig_price": 500,
"discount_from": 1615248000000, "discount_from": 1615248000000,
"discount_to": 1615852799000 "discount_to": 1615852799000
}, { },
"name": "extend", {
"items": [{ "name": "tonesphere",
"type": "pack", "items": [
"id": "extend", {
"is_available": true "type": "pack",
}], "id": "tonesphere",
"price": 700, "is_available": true
"orig_price": 700, },
"discount_from": 1615248000000, {
"discount_to": 1615852799000 "type": "core",
}, { "amount": 5,
"name": "alice", "id": "core_generic",
"items": [{ "is_available": true
"type": "pack", }
"id": "alice", ],
"is_available": true "price": 500,
}], "orig_price": 500,
"orig_price": 500, "discount_from": 1615248000000,
"price": 500 "discount_to": 1615852799000
}, { },
"name": "alice_append_1", {
"items": [{ "name": "groovecoaster",
"type": "pack", "items": [
"id": "alice_append_1", {
"is_available": true "type": "pack",
}], "id": "groovecoaster",
"orig_price": 300, "is_available": true
"price": 300 },
}, { {
"name": "ongeki", "type": "core",
"items": [{ "amount": 5,
"type": "pack", "id": "core_generic",
"id": "ongeki", "is_available": true
"is_available": true }
}], ],
"orig_price": 400, "price": 500,
"price": 400 "orig_price": 500,
}, { "discount_from": 1615248000000,
"name": "maimai", "discount_to": 1615852799000
"items": [{ },
"type": "pack", {
"id": "maimai", "name": "zettai",
"is_available": true "items": [
}], {
"orig_price": 400, "type": "pack",
"price": 400 "id": "zettai",
}, { "is_available": true
"name": "chunithm_append_1", },
"items": [{ {
"type": "pack", "type": "core",
"id": "chunithm_append_1", "amount": 5,
"is_available": true "id": "core_generic",
}], "is_available": true
"orig_price": 300, }
"price": 300 ],
}, { "price": 500,
"name": "observer_append_1", "orig_price": 500,
"items": [{ "discount_from": 1615248000000,
"type": "pack", "discount_to": 1615852799000
"id": "observer_append_1", },
"is_available": true {
}], "name": "chunithm",
"orig_price": 300, "items": [
"price": 300 {
}, { "type": "pack",
"name": "observer", "id": "chunithm",
"items": [{ "is_available": true
"type": "pack", },
"id": "observer", {
"is_available": true "type": "core",
}], "amount": 3,
"orig_price": 500, "id": "core_generic",
"price": 500 "is_available": true
}, { }
"name": "observer_append_2", ],
"items": [{ "price": 300,
"type": "pack", "orig_price": 300
"id": "observer_append_2", },
"is_available": true {
}], "name": "prelude",
"orig_price": 300, "items": [
"price": 300 {
}, { "type": "pack",
"name": "wacca", "id": "prelude",
"items": [{ "is_available": true
"type": "pack", },
"id": "wacca", {
"is_available": true "type": "core",
}], "amount": 4,
"orig_price": 500, "id": "core_generic",
"price": 500 "is_available": true
}] }
],
"price": 400,
"orig_price": 400,
"discount_from": 1615248000000,
"discount_to": 1615852799000
},
{
"name": "omatsuri",
"items": [
{
"type": "pack",
"id": "omatsuri",
"is_available": true
},
{
"type": "core",
"amount": 5,
"id": "core_generic",
"is_available": true
}
],
"price": 500,
"orig_price": 500,
"discount_from": 1615248000000,
"discount_to": 1615852799000
},
{
"name": "vs",
"items": [
{
"type": "pack",
"id": "vs",
"is_available": true
},
{
"type": "core",
"amount": 5,
"id": "core_generic",
"is_available": true
}
],
"price": 500,
"orig_price": 500,
"discount_from": 1615248000000,
"discount_to": 1615852799000
},
{
"name": "extend",
"items": [
{
"type": "pack",
"id": "extend",
"is_available": true
},
{
"type": "core",
"amount": 7,
"id": "core_generic",
"is_available": true
}
],
"price": 0,
"orig_price": 700,
"discount_from": 1615248000000,
"discount_to": 1615852799000
},
{
"name": "alice",
"items": [
{
"type": "pack",
"id": "alice",
"is_available": true
},
{
"type": "core",
"amount": 5,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 500,
"price": 500
},
{
"name": "alice_append_1",
"items": [
{
"type": "pack",
"id": "alice_append_1",
"is_available": true
},
{
"type": "core",
"amount": 3,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 300,
"price": 300
},
{
"name": "ongeki",
"items": [
{
"type": "pack",
"id": "ongeki",
"is_available": true
},
{
"type": "core",
"amount": 4,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 400,
"price": 400
},
{
"name": "maimai",
"items": [
{
"type": "pack",
"id": "maimai",
"is_available": true
},
{
"type": "core",
"amount": 4,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 400,
"price": 400
},
{
"name": "chunithm_append_1",
"items": [
{
"type": "pack",
"id": "chunithm_append_1",
"is_available": true
},
{
"type": "core",
"amount": 3,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 300,
"price": 300
},
{
"name": "observer_append_1",
"items": [
{
"type": "pack",
"id": "observer_append_1",
"is_available": true
},
{
"type": "core",
"amount": 3,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 300,
"price": 300
},
{
"name": "observer",
"items": [
{
"type": "pack",
"id": "observer",
"is_available": true
},
{
"type": "core",
"amount": 5,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 500,
"price": 500
},
{
"name": "observer_append_2",
"items": [
{
"type": "pack",
"id": "observer_append_2",
"is_available": true
},
{
"type": "core",
"amount": 3,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 300,
"price": 300
},
{
"name": "wacca",
"items": [
{
"type": "pack",
"id": "wacca",
"is_available": true
},
{
"type": "core",
"amount": 5,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 500,
"price": 500
},
{
"name": "nijuusei_append_1",
"items": [
{
"type": "pack",
"id": "nijuusei_append_1",
"is_available": true
},
{
"type": "core",
"amount": 3,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 300,
"price": 300
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -25,15 +25,35 @@ def get_purchase(c, type='pack'):
for i in x: for i in x:
items = [] items = []
c.execute( 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() y = c.fetchall()
t = None
if y: if y:
for j in y: for j in y:
items.append({ if j[3]:
"type": j[1], amount = j[3]
"id": j[0], else:
"is_available": int2b(j[2]) 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], r = {"name": i[0],
"items": items, "items": items,
@@ -104,7 +124,7 @@ def buy_thing(user_id, purchase_id):
} }
c.execute( 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() x = c.fetchall()
if x: if x:
now = int(time.time() * 1000) now = int(time.time() * 1000)
@@ -115,7 +135,11 @@ def buy_thing(user_id, purchase_id):
if flag: if flag:
for i in x: 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 success_flag = True
else: else:

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,10 @@ import os
import time import time
ETO_UNCAP_BONUS_PROGRESS = 7
LUNA_UNCAP_BONUS_PROGRESS = 7
def int2b(x): def int2b(x):
# int与布尔值转换 # int与布尔值转换
if x is None or x == 0: if x is None or x == 0:
@@ -127,9 +131,12 @@ def get_available_maps():
for i in Config.AVAILABLE_MAP: for i in Config.AVAILABLE_MAP:
info = get_world_info(i) info = get_world_info(i)
del info['steps'] del info['steps']
del info['is_locked'] try:
del info['curr_position'] del info['is_locked']
del info['curr_capture'] del info['curr_position']
del info['curr_capture']
except:
pass
re.append(info) re.append(info)
return re return re
@@ -360,12 +367,23 @@ def world_update(c, user_id, song_id, difficulty, rating, clear_type, beyond_gau
'a': user_id, 'b': song_id, 'c': difficulty}) 'a': user_id, 'b': song_id, 'c': difficulty})
c.execute( c.execute(
'''select character_id, max_stamina_ts, stamina from user where user_id=?''', (user_id,)) '''select character_id, max_stamina_ts, stamina, is_skill_sealed, is_char_uncapped, is_char_uncapped_override from user where user_id=?''', (user_id,))
x = c.fetchone() x = c.fetchone()
character_id = x[0] if x and x[0] is not None else 0 character_id = x[0] if x and x[0] is not None else 0
max_stamina_ts = x[1] if x and x[1] is not None else 0 max_stamina_ts = x[1] if x and x[1] is not None else 0
stamina = x[2] if x and x[2] is not None else 12 stamina = x[2] if x and x[2] is not None else 12
c.execute('''select frag1,prog1,overdrive1,frag20,prog20,overdrive20,frag30,prog30,overdrive30 from character where character_id=?''', (character_id,)) is_skill_sealed = x[3] if x and x[3] is not None else 1
skill = False
skill_uncap = False
if not is_skill_sealed:
if x:
skill = True
if x[4] is not None and x[4] == 1:
skill_uncap = True
if x[5] is not None and x[5] == 1:
skill_uncap = False
c.execute('''select frag1,prog1,overdrive1,frag20,prog20,overdrive20,frag30,prog30,overdrive30,skill_id,skill_id_uncap from character where character_id=?''', (character_id,))
x = c.fetchone() x = c.fetchone()
if Config.CHARACTER_FULL_UNLOCK: if Config.CHARACTER_FULL_UNLOCK:
@@ -386,10 +404,20 @@ def world_update(c, user_id, song_id, difficulty, rating, clear_type, beyond_gau
flag = server.character.calc_char_value(level, x[0], x[3], x[6]) flag = server.character.calc_char_value(level, x[0], x[3], x[6])
prog = server.character.calc_char_value(level, x[1], x[4], x[7]) prog = server.character.calc_char_value(level, x[1], x[4], x[7])
overdrive = server.character.calc_char_value(level, x[2], x[5], x[8]) overdrive = server.character.calc_char_value(level, x[2], x[5], x[8])
if x[9] is not None and x[9] != '' and skill:
skill = x[9]
else:
skill = None
if x[10] is not None and x[9] != '' and skill_uncap:
skill_uncap = x[10]
else:
skill_uncap = None
else: else:
flag = 0 flag = 0
prog = 0 prog = 0
overdrive = 0 overdrive = 0
skill = None
skill_uncap = None
c.execute('''select current_map from user where user_id = :a''', { c.execute('''select current_map from user where user_id = :a''', {
'a': user_id}) 'a': user_id})
@@ -421,6 +449,37 @@ def world_update(c, user_id, song_id, difficulty, rating, clear_type, beyond_gau
rewards, steps, curr_position, curr_capture, info = climb_step( rewards, steps, curr_position, curr_capture, info = climb_step(
user_id, map_id, step, y[3], y[2]) user_id, map_id, step, y[3], y[2])
# Eto和Luna的技能
character_bonus_progress = None
skill_special = ''
if skill_uncap is not None and skill_uncap and skill_uncap in ['eto_uncap', 'luna_uncap']:
skill_special = skill_uncap
elif skill is not None and skill and skill in ['eto_uncap', 'luna_uncap']:
skill_special = skill
if skill_special == 'eto_uncap':
# eto觉醒技能获得残片奖励时世界模式进度加7
fragment_flag = False
for i in rewards:
for j in i['items']:
if j['type'] == 'fragment':
fragment_flag = True
break
if fragment_flag:
break
if fragment_flag:
character_bonus_progress = ETO_UNCAP_BONUS_PROGRESS
step += character_bonus_progress * step_times
rewards, steps, curr_position, curr_capture, info = climb_step(
user_id, map_id, step, y[3], y[2]) # 二次爬梯,重新计算
elif skill_special == 'luna_uncap':
# luna觉醒技能限制格开始时世界模式进度加7
if 'restrict_id' in steps[0] and 'restrict_type' in steps[0] and steps[0]['restrict_type'] != '' and steps[0]['restrict_id'] != '':
character_bonus_progress = LUNA_UNCAP_BONUS_PROGRESS
step += character_bonus_progress * step_times
rewards, steps, curr_position, curr_capture, info = climb_step(
user_id, map_id, step, y[3], y[2]) # 二次爬梯,重新计算
for i in rewards: # 物品分发 for i in rewards: # 物品分发
for j in i['items']: for j in i['items']:
amount = j['amount'] if 'amount' in j else 1 amount = j['amount'] if 'amount' in j else 1
@@ -496,6 +555,9 @@ def world_update(c, user_id, song_id, difficulty, rating, clear_type, beyond_gau
"max_stamina_ts": max_stamina_ts "max_stamina_ts": max_stamina_ts
} }
if character_bonus_progress is not None:
re['character_bonus_progress'] = character_bonus_progress
if stamina_multiply != 1: if stamina_multiply != 1:
re['stamina_multiply'] = stamina_multiply re['stamina_multiply'] = stamina_multiply
if fragment_multiply != 100: if fragment_multiply != 100:

View File

@@ -19,7 +19,7 @@ class Config():
游戏API地址前缀 游戏API地址前缀
Game API's URL prefix Game API's URL prefix
''' '''
GAME_API_PREFIX = '/kusoatui/15' GAME_API_PREFIX = '/earlgrey/16'
''' '''
-------------------- --------------------
''' '''
@@ -30,7 +30,8 @@ class Config():
Allowed game versions Allowed game versions
If it is blank, all are allowed. If it is blank, all are allowed.
''' '''
ALLOW_APPVERSION = ['3.5.3', '3.5.3c', '3.8.2', '3.8.2c'] ALLOW_APPVERSION = ['3.5.3', '3.5.3c',
'3.9.0', '3.9.0c', '3.9.1', '3.9.1c']
''' '''
-------------------- --------------------
''' '''
@@ -179,6 +180,18 @@ class Config():
-------------------- --------------------
''' '''
'''
--------------------
数据库更新时,是否采用最新的角色数据,如果你想采用最新的官方角色数据
注意:如果是,旧的数据将丢失;如果否,某些角色的数据变动将无法同步
If using the latest character data when updating database. If you want to only keep newest official character data, please set it `True`.
Note: If `True`, the old data will be lost; If `False`, the data changes of some characters will not be synchronized.
'''
UPDATE_WITH_NEW_CHARACTER_DATA = True
'''
--------------------
'''
''' '''
-------------------- --------------------
是否全解锁搭档 是否全解锁搭档

View File

@@ -37,6 +37,10 @@
<span class="char-num">{{x['type']}}</span> <span class="char-num">{{x['type']}}</span>
<br /> <br />
<span>Amount: </span>
<span class="char-num">{{x['amount']}}</span>
<br />
{% if not loop.last %} {% if not loop.last %}

View File

@@ -17,8 +17,11 @@
<option value='pack'>Song pack</option> <option value='pack'>Song pack</option>
<option value='world_song'>World song</option> <option value='world_song'>World song</option>
<option value='character'>Character</option> <option value='character'>Character</option>
<option value='core'>Core</option>
</select> </select>
</div> </div>
<label for="amount">Amount</label>
<input name="amount" id="amount" value="1" required>
<br /> <br />
<input type="submit" value="Add"> <input type="submit" value="Add">
</form> </form>
@@ -36,6 +39,7 @@
<option value='pack'>Pack</option> <option value='pack'>Pack</option>
<option value='world_song'>World song</option> <option value='world_song'>World song</option>
<option value='character'>Character</option> <option value='character'>Character</option>
<option value='core'>Core</option>
</select> </select>
</div> </div>
<br /> <br />

View File

@@ -418,7 +418,7 @@ def all_character():
def change_character(): def change_character():
# 修改角色数据 # 修改角色数据
skill_ids = ['No_skill', 'gauge_easy', 'note_mirror', 'gauge_hard', 'frag_plus_10_pack_stellights', 'gauge_easy|frag_plus_15_pst&prs', 'gauge_hard|fail_frag_minus_100', 'frag_plus_5_side_light', 'visual_hide_hp', 'frag_plus_5_side_conflict', 'challenge_fullcombo_0gauge', 'gauge_overflow', 'gauge_easy|note_mirror', 'note_mirror', 'visual_tomato_pack_tonesphere', skill_ids = ['No_skill', 'gauge_easy', 'note_mirror', 'gauge_hard', 'frag_plus_10_pack_stellights', 'gauge_easy|frag_plus_15_pst&prs', 'gauge_hard|fail_frag_minus_100', 'frag_plus_5_side_light', 'visual_hide_hp', 'frag_plus_5_side_conflict', 'challenge_fullcombo_0gauge', 'gauge_overflow', 'gauge_easy|note_mirror', 'note_mirror', 'visual_tomato_pack_tonesphere',
'frag_rng_ayu', 'gaugestart_30|gaugegain_70', 'combo_100-frag_1', 'audio_gcemptyhit_pack_groovecoaster', 'gauge_saya', 'gauge_chuni', 'kantandeshou', 'gauge_haruna', 'frags_nono', 'gauge_pandora', 'gauge_regulus', 'omatsuri_daynight', 'sometimes(note_mirror|frag_plus_5)', 'scoreclear_aa|visual_scoregauge', 'gauge_tempest', 'gauge_hard', 'gauge_ilith_summer', 'frags_kou', 'visual_ink', 'shirabe_entry_fee', 'frags_yume', 'note_mirror|visual_hide_far', 'frags_ongeki', 'gauge_areus', 'gauge_seele', 'gauge_isabelle', 'gauge_exhaustion', 'skill_lagrange', 'gauge_safe_10', 'frags_nami', 'skill_elizabeth', 'skill_lily', 'skill_kanae_midsummer'] 'frag_rng_ayu', 'gaugestart_30|gaugegain_70', 'combo_100-frag_1', 'audio_gcemptyhit_pack_groovecoaster', 'gauge_saya', 'gauge_chuni', 'kantandeshou', 'gauge_haruna', 'frags_nono', 'gauge_pandora', 'gauge_regulus', 'omatsuri_daynight', 'sometimes(note_mirror|frag_plus_5)', 'scoreclear_aa|visual_scoregauge', 'gauge_tempest', 'gauge_hard', 'gauge_ilith_summer', 'frags_kou', 'visual_ink', 'shirabe_entry_fee', 'frags_yume', 'note_mirror|visual_hide_far', 'frags_ongeki', 'gauge_areus', 'gauge_seele', 'gauge_isabelle', 'gauge_exhaustion', 'skill_lagrange', 'gauge_safe_10', 'frags_nami', 'skill_elizabeth', 'skill_lily', 'skill_kanae_midsummer', 'eto_uncap', 'luna_uncap']
return render_template('web/changechar.html', skill_ids=skill_ids) return render_template('web/changechar.html', skill_ids=skill_ids)
@@ -777,12 +777,12 @@ def change_purchase():
discount_from = int(time.mktime(time.strptime( discount_from = int(time.mktime(time.strptime(
discount_from, "%Y-%m-%dT%H:%M"))) * 1000 discount_from, "%Y-%m-%dT%H:%M"))) * 1000
else: else:
discount_from = None discount_from = -1
if discount_to: if discount_to:
discount_to = int(time.mktime(time.strptime( discount_to = int(time.mktime(time.strptime(
discount_to, "%Y-%m-%dT%H:%M"))) * 1000 discount_to, "%Y-%m-%dT%H:%M"))) * 1000
else: else:
discount_to = None discount_to = -1
except: except:
error = '数据错误 Wrong data.' error = '数据错误 Wrong data.'
flash(error) flash(error)
@@ -847,6 +847,7 @@ def change_purchase_item():
purchase_name = request.form['purchase_name'] purchase_name = request.form['purchase_name']
item_id = request.form['item_id'] item_id = request.form['item_id']
item_type = request.form['type'] item_type = request.form['type']
amount = int(request.form['amount'])
except: except:
error = '数据错误 Wrong data.' error = '数据错误 Wrong data.'
flash(error) flash(error)
@@ -862,8 +863,8 @@ def change_purchase_item():
c.execute( c.execute(
'''select exists(select * from item where item_id=? and type=?)''', (item_id, item_type)) '''select exists(select * from item where item_id=? and type=?)''', (item_id, item_type))
if c.fetchone() == (1,): if c.fetchone() == (1,):
c.execute('''insert into purchase_item values(?,?,?)''', c.execute('''insert into purchase_item values(?,?,?,?)''',
(purchase_name, item_id, item_type)) (purchase_name, item_id, item_type, amount))
flash('''购买项目的物品添加成功 Successfully add the purchase's item.''') flash('''购买项目的物品添加成功 Successfully add the purchase's item.''')
else: else:
error = '''物品不存在 The item does not exist.''' error = '''物品不存在 The item does not exist.'''

View File

@@ -5,6 +5,7 @@ import json
import server.arcscore import server.arcscore
import hashlib import hashlib
from random import Random from random import Random
from setting import Config
def int2b(x): def int2b(x):
@@ -204,13 +205,13 @@ def update_database():
update_one_table(c1, c2, 'user_role') update_one_table(c1, c2, 'user_role')
update_one_table(c1, c2, 'power') update_one_table(c1, c2, 'power')
update_one_table(c1, c2, 'role_power') update_one_table(c1, c2, 'role_power')
update_one_table(c1, c2, 'api_auth') update_one_table(c1, c2, 'api_login')
update_one_table(c1, c2, 'user_char') update_one_table(c1, c2, 'user_char')
# ---You can comment this line by yourself, if you want to only keep newest official character data. if not Config.UPDATE_WITH_NEW_CHARACTER_DATA:
update_one_table(c1, c2, 'character') update_one_table(c1, c2, 'character')
# ---
update_user_char(c2) # 更新user_char_full update_user_char(c2) # 更新user_char_full
os.remove('database/old_arcaea_database.db') os.remove('database/old_arcaea_database.db')
@@ -301,7 +302,7 @@ def get_all_purchase():
items = [] items = []
if y: if y:
for j in y: for j in y:
items.append({'item_id': j[1], 'type': j[2]}) items.append({'item_id': j[1], 'type': j[2], 'amount':j[3]})
re.append({'purchase_name': i[0], re.append({'purchase_name': i[0],
'price': i[1], 'price': i[1],