Update to v2.3

This commit is contained in:
Lost-MSth
2021-03-09 13:46:49 +08:00
parent df181f104e
commit 4f66f492fc
18 changed files with 450 additions and 343 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.log

View File

@@ -36,6 +36,7 @@ This procedure is mainly used for study and research, and shall not be used for
- 后台自定义信息 Customize some things in the background
- 成绩校验 Score check
- 下载校验 Download check
- 服务器日志 Server log
没有以下 We don't have
- 角色数值 Character characteristic value
@@ -63,24 +64,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 2.2
- 适用于Arcaea 3.5.1版本 For Arcaea 3.5.1
### Version 2.3
- 适用于Arcaea 3.5.2版本 For Arcaea 3.5.2
- 更新了歌曲数据库 Update the song database.
- 新增多设备登录 Add multi device login.
- 修改了配置文件结构 The configuration file structure has been modified.
- 新增服务器日志 Add server log.
- 优化了代码结构 Optimize the code structure.
- 修复了一Bug Fix many bugs.
> 提醒:本次更新需重新登录
>
> Tip: You need to log in Arcaea again in this update.
- 修复了一Bug,提升服务器安全性 Fix some bugs and improve server security.
## 运行环境与依赖 Running environment and requirements
- Windows操作系统 Windows operating system
- Windows/Linux/Mac OS/Android
- Python 3
- Flask模块 Flask module
- Charles
- Flask module
- Charles (optional)
## 环境搭建 Environment construction
[中文](https://github.com/Lost-MSth/Arcaea-server/wiki/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA)

Binary file not shown.

View File

@@ -236,15 +236,15 @@ primary key(user_id, code)
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']
'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']
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']
'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_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', '', '', 'shirabe_entry_fee',
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
for i in range(0, 44):
for i in range(0, 45):
if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21, 42, 43]:
sql = 'insert into character values('+str(
i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',1,1)'''

View File

@@ -3,154 +3,154 @@
"items": [{
"type": "pack",
"id": "core",
"_id": "6008c2ff36651a07ebc52ca9",
"_id": "6046bab736651a07ebc537db",
"is_available": true
}],
"price": 500,
"price": 400,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "shiawase",
"items": [{
"type": "pack",
"id": "shiawase",
"_id": "6008c2ff36651a07ebc52ce0",
"_id": "6046bab736651a07ebc53823",
"is_available": true
}, {
"type": "character",
"id": "kou",
"_id": "6008c2ff36651a07ebc52cdf",
"_id": "6046bab736651a07ebc53822",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1552089600000,
"discount_to": 1552694399000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "dynamix",
"items": [{
"type": "pack",
"id": "dynamix",
"_id": "6008c2ff36651a07ebc52ce4",
"_id": "6046bab736651a07ebc53827",
"is_available": true
}, {
"type": "character",
"id": "sapphire",
"_id": "6008c2ff36651a07ebc52ce3",
"_id": "6046bab736651a07ebc53826",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "mirai",
"items": [{
"type": "pack",
"id": "mirai",
"_id": "6008c2ff36651a07ebc52cdc",
"_id": "6046bab736651a07ebc5381d",
"is_available": true
}, {
"type": "character",
"id": "lethe",
"_id": "6008c2ff36651a07ebc52cdb",
"_id": "6046bab736651a07ebc5381c",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1552089600000,
"discount_to": 1552694399000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "yugamu",
"items": [{
"type": "pack",
"id": "yugamu",
"_id": "6008c2ff36651a07ebc52caa",
"_id": "6046bab736651a07ebc537dc",
"is_available": true
}],
"price": 500,
"price": 400,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "lanota",
"items": [{
"type": "pack",
"id": "lanota",
"_id": "6008c2ff36651a07ebc52cd0",
"_id": "6046bab736651a07ebc537e8",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "nijuusei",
"items": [{
"type": "pack",
"id": "nijuusei",
"_id": "6008c2ff36651a07ebc52cab",
"_id": "6046bab736651a07ebc537dd",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "rei",
"items": [{
"type": "pack",
"id": "rei",
"_id": "6008c2ff36651a07ebc52cc5",
"_id": "6046bab736651a07ebc537f6",
"is_available": true
}],
"price": 500,
"price": 400,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "tonesphere",
"items": [{
"type": "pack",
"id": "tonesphere",
"_id": "6008c2ff36651a07ebc52cd2",
"_id": "6046bab736651a07ebc537ea",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "groovecoaster",
"items": [{
"type": "pack",
"id": "groovecoaster",
"_id": "6008c2ff36651a07ebc52ca1",
"_id": "6046bab736651a07ebc53812",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "zettai",
"items": [{
"type": "pack",
"id": "zettai",
"_id": "6008c2ff36651a07ebc52cc7",
"_id": "6046bab736651a07ebc537f8",
"is_available": true
}],
"price": 500,
"price": 250,
"orig_price": 500,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "chunithm",
"items": [{
"type": "pack",
"id": "chunithm",
"_id": "6008c2ff36651a07ebc52cbb",
"_id": "6046bab736651a07ebc53806",
"is_available": true
}],
"price": 300,
@@ -160,47 +160,55 @@
"items": [{
"type": "pack",
"id": "prelude",
"_id": "6008c2ff36651a07ebc52ca2",
"_id": "6046bab736651a07ebc53813",
"is_available": true
}],
"price": 400,
"orig_price": 400
"price": 250,
"orig_price": 400,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "omatsuri",
"items": [{
"type": "pack",
"id": "omatsuri",
"_id": "6008c2ff36651a07ebc52cc8",
"_id": "6046bab736651a07ebc537f9",
"is_available": true
}],
"price": 500,
"orig_price": 500
"price": 250,
"orig_price": 500,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "vs",
"items": [{
"type": "pack",
"id": "vs",
"_id": "6008c2ff36651a07ebc52cbe",
"_id": "6046bab736651a07ebc53809",
"is_available": true
}],
"price": 500,
"orig_price": 500
"price": 400,
"orig_price": 500,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "extend",
"items": [{
"type": "pack",
"id": "extend",
"_id": "6008c2ff36651a07ebc52ca5",
"_id": "6046bab736651a07ebc53816",
"is_available": true
}],
"price": 700,
"orig_price": 700
"price": 500,
"orig_price": 700,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "alice",
"items": [{
"type": "pack",
"id": "alice",
"_id": "6008c2ff36651a07ebc52ccd",
"_id": "6046bab736651a07ebc537fe",
"is_available": true
}],
"orig_price": 500,
@@ -210,7 +218,7 @@
"items": [{
"type": "pack",
"id": "alice_append_1",
"_id": "6008c2ff36651a07ebc52cb4",
"_id": "6046bab736651a07ebc537e6",
"is_available": true
}],
"orig_price": 300,
@@ -220,7 +228,7 @@
"items": [{
"type": "pack",
"id": "ongeki",
"_id": "6008c2ff36651a07ebc52cc1",
"_id": "6046bab736651a07ebc5380c",
"is_available": true
}],
"orig_price": 400,
@@ -230,7 +238,7 @@
"items": [{
"type": "pack",
"id": "maimai",
"_id": "6008c2ff36651a07ebc52ca8",
"_id": "6046bab736651a07ebc53819",
"is_available": true
}],
"orig_price": 400,
@@ -240,7 +248,7 @@
"items": [{
"type": "pack",
"id": "chunithm_append_1",
"_id": "6008c2ff36651a07ebc52cda",
"_id": "6046bab736651a07ebc537f2",
"is_available": true
}],
"orig_price": 300,

View File

@@ -12,55 +12,55 @@
"items": [{
"id": "dataerror",
"type": "single",
"_id": "6008c2ff36651a07ebc52cb5",
"_id": "6046bab736651a07ebc537f3",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "yourvoiceso",
"items": [{
"id": "yourvoiceso",
"type": "single",
"_id": "6008c2ff36651a07ebc52cc2",
"_id": "6046bab736651a07ebc53800",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "crosssoul",
"items": [{
"id": "crosssoul",
"type": "single",
"_id": "6008c2ff36651a07ebc52ccf",
"_id": "6046bab736651a07ebc5380d",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "impurebird",
"items": [{
"type": "single",
"id": "impurebird",
"_id": "6008c2ff36651a07ebc52cb6",
"_id": "6046bab736651a07ebc53801",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "auxesia",
"items": [{
"type": "single",
"id": "auxesia",
"_id": "6008c2ff36651a07ebc52c9d",
"_id": "6046bab736651a07ebc5380e",
"is_available": true
}],
"price": 100,
@@ -72,43 +72,43 @@
"items": [{
"type": "single",
"id": "modelista",
"_id": "6008c2ff36651a07ebc52cc3",
"_id": "6046bab736651a07ebc537f4",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "yozakurafubuki",
"items": [{
"type": "single",
"id": "yozakurafubuki",
"_id": "6008c2ff36651a07ebc52cb7",
"_id": "6046bab736651a07ebc53802",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "surrender",
"items": [{
"type": "single",
"id": "surrender",
"_id": "6008c2ff36651a07ebc52c9e",
"_id": "6046bab736651a07ebc5380f",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "metallicpunisher",
"items": [{
"type": "single",
"id": "metallicpunisher",
"_id": "6008c2ff36651a07ebc52cc4",
"_id": "6046bab736651a07ebc537f5",
"is_available": true
}],
"price": 100,
@@ -118,7 +118,7 @@
"items": [{
"type": "single",
"id": "carminescythe",
"_id": "6008c2ff36651a07ebc52cb8",
"_id": "6046bab736651a07ebc53803",
"is_available": true
}],
"price": 100,
@@ -128,79 +128,79 @@
"items": [{
"type": "single",
"id": "bethere",
"_id": "6008c2ff36651a07ebc52c9f",
"_id": "6046bab736651a07ebc53810",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "callmyname",
"items": [{
"type": "single",
"id": "callmyname",
"_id": "6008c2ff36651a07ebc52cd1",
"_id": "6046bab736651a07ebc537e9",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "fallensquare",
"items": [{
"type": "single",
"id": "fallensquare",
"_id": "6008c2ff36651a07ebc52cac",
"_id": "6046bab736651a07ebc537de",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "dropdead",
"items": [{
"type": "single",
"id": "dropdead",
"_id": "6008c2ff36651a07ebc52cb9",
"_id": "6046bab736651a07ebc53804",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "alexandrite",
"items": [{
"type": "single",
"id": "alexandrite",
"_id": "6008c2ff36651a07ebc52ca0",
"_id": "6046bab736651a07ebc53811",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "astraltale",
"items": [{
"type": "single",
"id": "astraltale",
"_id": "6008c2ff36651a07ebc52cc6",
"_id": "6046bab736651a07ebc537f7",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "phantasia",
"items": [{
"type": "single",
"id": "phantasia",
"_id": "6008c2ff36651a07ebc52cad",
"_id": "6046bab736651a07ebc537df",
"is_available": true
}],
"price": 100,
@@ -210,7 +210,7 @@
"items": [{
"type": "single",
"id": "empireofwinter",
"_id": "6008c2ff36651a07ebc52cba",
"_id": "6046bab736651a07ebc53805",
"is_available": true
}],
"price": 100,
@@ -220,75 +220,79 @@
"items": [{
"type": "single",
"id": "libertas",
"_id": "6008c2ff36651a07ebc52cd3",
"_id": "6046bab736651a07ebc537eb",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "dottodot",
"items": [{
"type": "single",
"id": "dottodot",
"_id": "6008c2ff36651a07ebc52cae",
"_id": "6046bab736651a07ebc537e0",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "dreadnought",
"items": [{
"type": "single",
"id": "dreadnought",
"_id": "6008c2ff36651a07ebc52cd4",
"_id": "6046bab736651a07ebc537ec",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "mirzam",
"items": [{
"type": "single",
"id": "mirzam",
"_id": "6008c2ff36651a07ebc52caf",
"_id": "6046bab736651a07ebc537e1",
"is_available": true
}],
"price": 100,
"price": 50,
"orig_price": 100,
"discount_from": 1583712000000,
"discount_to": 1584316799000
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "heavenlycaress",
"items": [{
"type": "single",
"id": "heavenlycaress",
"_id": "6008c2ff36651a07ebc52cbc",
"_id": "6046bab736651a07ebc53807",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "filament",
"items": [{
"type": "single",
"id": "filament",
"_id": "6008c2ff36651a07ebc52ca3",
"_id": "6046bab736651a07ebc53814",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "avantraze",
"items": [{
"type": "single",
"id": "avantraze",
"_id": "6008c2ff36651a07ebc52cd5",
"_id": "6046bab736651a07ebc537ed",
"is_available": true
}],
"price": 100,
@@ -298,17 +302,19 @@
"items": [{
"type": "single",
"id": "battlenoone",
"_id": "6008c2ff36651a07ebc52cc9",
"_id": "6046bab736651a07ebc537fa",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "saikyostronger",
"items": [{
"type": "single",
"id": "saikyostronger",
"_id": "6008c2ff36651a07ebc52cb0",
"_id": "6046bab736651a07ebc537e2",
"is_available": true
}],
"price": 100,
@@ -318,67 +324,79 @@
"items": [{
"type": "single",
"id": "izana",
"_id": "6008c2ff36651a07ebc52cbd",
"_id": "6046bab736651a07ebc53808",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "einherjar",
"items": [{
"type": "single",
"id": "einherjar",
"_id": "6008c2ff36651a07ebc52ca4",
"_id": "6046bab736651a07ebc53815",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "laqryma",
"items": [{
"type": "single",
"id": "laqryma",
"_id": "6008c2ff36651a07ebc52cd6",
"_id": "6046bab736651a07ebc537ee",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "amygdata",
"items": [{
"type": "single",
"id": "amygdata",
"_id": "6008c2ff36651a07ebc52cca",
"_id": "6046bab736651a07ebc537fb",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "altale",
"items": [{
"type": "single",
"id": "altale",
"_id": "6008c2ff36651a07ebc52cb1",
"_id": "6046bab736651a07ebc537e3",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "feelssoright",
"items": [{
"type": "single",
"id": "feelssoright",
"_id": "6008c2ff36651a07ebc52cd7",
"_id": "6046bab736651a07ebc537ef",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "scarletcage",
"items": [{
"type": "single",
"id": "scarletcage",
"_id": "6008c2ff36651a07ebc52ccb",
"_id": "6046bab736651a07ebc537fc",
"is_available": true
}],
"price": 100,
@@ -388,7 +406,7 @@
"items": [{
"type": "single",
"id": "teriqma",
"_id": "6008c2ff36651a07ebc52cb2",
"_id": "6046bab736651a07ebc537e4",
"is_available": true
}],
"price": 100,
@@ -398,27 +416,31 @@
"items": [{
"type": "single",
"id": "mahoroba",
"_id": "6008c2ff36651a07ebc52cbf",
"_id": "6046bab736651a07ebc5380a",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "badtek",
"items": [{
"type": "single",
"id": "badtek",
"_id": "6008c2ff36651a07ebc52cd8",
"_id": "6046bab736651a07ebc537f0",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "maliciousmischance",
"items": [{
"type": "single",
"id": "maliciousmischance",
"_id": "6008c2ff36651a07ebc52ccc",
"_id": "6046bab736651a07ebc53817",
"is_available": true
}],
"price": 100,
@@ -428,7 +450,7 @@
"items": [{
"type": "single",
"id": "buchigireberserker",
"_id": "6008c2ff36651a07ebc52cb3",
"_id": "6046bab736651a07ebc537e5",
"is_available": true
}],
"price": 100,
@@ -438,17 +460,19 @@
"items": [{
"type": "single",
"id": "galaxyfriends",
"_id": "6008c2ff36651a07ebc52cc0",
"_id": "6046bab736651a07ebc5380b",
"is_available": true
}],
"price": 100,
"orig_price": 100
"price": 50,
"orig_price": 100,
"discount_from": 1615248000000,
"discount_to": 1615852799000
}, {
"name": "xeraphinite",
"items": [{
"type": "single",
"id": "xeraphinite",
"_id": "6008c2ff36651a07ebc52ca7",
"_id": "6046bab736651a07ebc53818",
"is_available": true
}],
"orig_price": 100,
@@ -458,7 +482,7 @@
"items": [{
"type": "single",
"id": "xanatos",
"_id": "6008c2ff36651a07ebc52cd9",
"_id": "6046bab736651a07ebc537f1",
"is_available": true
}],
"price": 100,
@@ -468,7 +492,17 @@
"items": [{
"type": "single",
"id": "attraqtia",
"_id": "6008c2ff36651a07ebc52cce",
"_id": "6046bab736651a07ebc537ff",
"is_available": true
}],
"orig_price": 100,
"price": 100
}, {
"name": "gimmedablood",
"items": [{
"type": "single",
"id": "gimmedablood",
"_id": "6046bab736651a07ebc537e7",
"is_available": true
}],
"orig_price": 100,

View File

@@ -514,18 +514,51 @@ def sys_set(user_id, path):
def main():
app.config.from_mapping(SECRET_KEY=Config.SECRET_KEY)
app.config['SESSION_TYPE'] = 'filesystem'
app.register_blueprint(web.login.bp)
app.register_blueprint(web.index.bp)
dictConfig({
log_dict = {
'version': 1,
'formatters': {'default': {
'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s',
}},
'root': {
'level': 'INFO'
'level': 'INFO',
'handlers': ['wsgi', 'error_file']
},
'handlers': {
'wsgi': {
'class': 'logging.StreamHandler',
'stream': 'ext://flask.logging.wsgi_errors_stream',
'formatter': 'default'
},
"error_file": {
"class": "logging.handlers.RotatingFileHandler",
"maxBytes": 1024 * 1024,
"backupCount": 1,
"encoding": "utf-8",
"level": "ERROR",
"formatter": "default",
"filename": "./log/error.log"
}
},
'formatters': {
'default': {
'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s'
}
}
})
}
if Config.ALLOW_LOG_INFO:
log_dict['root']['handlers'] = ['wsgi', 'info_file', 'error_file']
log_dict['handlers']['info_file'] = {
"class": "logging.handlers.RotatingFileHandler",
"maxBytes": 1024 * 1024,
"backupCount": 1,
"encoding": "utf-8",
"level": "INFO",
"formatter": "default",
"filename": "./log/info.log"
}
dictConfig(log_dict)
app.logger.info("Start to initialize data in 'songfile' table...")
try:

View File

@@ -242,8 +242,9 @@ def get_song_state(x):
return 0
def get_user_ptt(c, user_id) -> int:
# 总ptt计算
def get_user_ptt_float(c, user_id) -> float:
# 总ptt计算,返回浮点数
sumr = 0
c.execute('''select rating from best_score where user_id = :a order by rating DESC limit 30''', {
'a': user_id})
@@ -272,8 +273,13 @@ def get_user_ptt(c, user_id) -> int:
sumr += r30[i]
songs.append(s30[i])
i += 1
return sumr/40
return int(sumr/40*100)
def get_user_ptt(c, user_id) -> int:
# 总ptt计算返回4位整数向下取整
return int(get_user_ptt_float(c, user_id)*100)
def update_recent30(c, user_id, song_id, rating, is_protected):
@@ -333,7 +339,7 @@ def update_recent30(c, user_id, song_id, rating, is_protected):
b.append(x[i+1])
if is_protected:
ptt_pre = get_user_ptt(c, user_id)
ptt_pre = get_user_ptt_float(c, user_id)
a_pre = [x for x in a]
b_pre = [x for x in b]
@@ -346,7 +352,7 @@ def update_recent30(c, user_id, song_id, rating, is_protected):
insert_r30table(c, user_id, a, b)
if is_protected:
ptt = get_user_ptt(c, user_id)
ptt = get_user_ptt_float(c, user_id)
if ptt < ptt_pre:
# 触发保护
if song_id in b_pre:
@@ -898,7 +904,23 @@ def arc_all_get(user_id):
"mi": 6,
"c": True,
"r": True
}]},
}, {
"ma": 8,
"mi": 1,
"c": True,
"r": True
}, {
"ma": 8,
"mi": 2,
"c": True,
"r": True
}, {
"ma": 8,
"mi": 3,
"c": True,
"r": True
}]
},
"devicemodelname": {
"val": devicemodelname_data
},

View File

@@ -198,9 +198,8 @@ def get_value_0(c, user_id):
"stamina": 12,
"world_unlocks": ["scenery_chap1", "scenery_chap2", "scenery_chap3", "scenery_chap4", "scenery_chap5"],
"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"],
"singles": get_user_singles(c, user_id), # ["dataerror", "yourvoiceso", "crosssoul", "impurebird", "auxesia", "modelista", "yozakurafubuki", "surrender", "metallicpunisher", "carminescythe", "bethere", "callmyname", "fallensquare", "dropdead", "alexandrite", "astraltale", "phantasia", "empireofwinter", "libertas", "dottodot", "dreadnought", "mirzam", "heavenlycaress", "filament", "avantraze", "battlenoone", "saikyostronger", "izana", "einherjar", "laqryma", "amygdata", "altale", "feelssoright", "scarletcage", "teriqma", "mahoroba", "badtek", "maliciousmischance", "buchigireberserker", "galaxyfriends", "xeraphinite", "xanatos"]
"singles": get_user_singles(c, user_id),
"packs": get_user_packs(c, user_id),
# ["vs", "extend", "dynamix", "prelude", "core", "yugamu", "omatsuri", "zettai", "mirai", "shiawase", "chunithm", "nijuusei", "groovecoaster", "rei", "tonesphere", "lanota"]
"characters": characters,
"cores": [],
"recent_score": get_recent_score(c, user_id),

View File

@@ -1,4 +1,6 @@
import sqlite3
from flask import current_app
import traceback
class Connect():
@@ -22,4 +24,8 @@ class Connect():
self.conn.commit()
self.conn.close()
if exc_type is not None:
current_app.logger.error(
traceback.format_exception(exc_type, exc_val, exc_tb))
return True

View File

@@ -8,7 +8,7 @@ class Config():
主机的地址和端口号
Host and port of your server
'''
HOST = '192.168.1.101'
HOST = '192.168.1.105'
PORT = '80'
'''
--------------------
@@ -38,8 +38,8 @@ class Config():
'''
--------------------
玩家歌曲下载的24小时次数限制
Player's song download limit times in 24 hours
玩家歌曲下载的24小时次数限制,每个文件算一次
Player's song download limit times in 24 hours, once per file
'''
DOWNLOAD_TIMES_LIMIT = 3000
'''
@@ -59,9 +59,19 @@ class Config():
LOGIN_DEVICE_NUMBER_LIMIT = 1
'''
是否允许同设备多应用共存登录
If multiple applications on the same device to log in is allowed
If logging in from multiple applications on the same device is allowed
'''
ALLOW_LOGIN_SAME_DEVICE = False
'''
--------------------
'''
'''
--------------------
是否记录详细的服务器日志
If recording detailed server logs is enabled
'''
ALLOW_LOG_INFO = False
'''
--------------------
'''

View File

@@ -11,6 +11,9 @@
<div class="name">{{user['name']}}
<span class="rank">UID: {{user['user_id']}}</span>
<span class="rank">User code: {{user['user_code']}}</span>
{% if user['ban_flag'] %}
<span class="rank">Banned</span>
{% endif %}
</div>
<div class="join-date">注册于 Registered in: {{user['join_date']}}</div>
<div class="ptt">PTT: {{'%0.2f'|format(user['rating_ptt']/100|float)}}</div>

View File

@@ -22,6 +22,9 @@
<div class="name">{{user['name']}}
<span class="rank">UID: {{user['user_id']}}</span>
<span class="rank">User code: {{user['user_code']}}</span>
{% if user['ban_flag'] %}
<span class="rank">Banned</span>
{% endif %}
</div>
<div class="join-date">注册于 Registered in: {{user['join_date']}}</div>
<div class="ptt">Memories: {{user['ticket']}}</div>
@@ -161,7 +164,7 @@
{% if recent %}
<div class="title">Recent 30</div>
{% for i in recent %}
{% if i %}
<div class="score-item">
<span class="song-title">

View File

@@ -138,6 +138,11 @@ def all_player():
if i[20]:
time_played = time.strftime('%Y-%m-%d %H:%M:%S',
time.localtime(int(i[20])//1000))
if i[2] == '':
ban_flag = True
else:
ban_flag = False
posts.append({'name': i[1],
'user_id': i[0],
'join_date': join_date,
@@ -153,7 +158,8 @@ def all_player():
'time_played': time_played,
'clear_type': i[21],
'rating': i[22],
'ticket': i[26]
'ticket': i[26],
'ban_flag': ban_flag
})
else:
error = '没有玩家数据 No player data.'

View File

@@ -3,6 +3,7 @@ from flask import (Blueprint, flash, g, redirect,
render_template, request, session, url_for)
import functools
from setting import Config
import hashlib
bp = Blueprint('login', __name__, url_prefix='/web')
@@ -20,7 +21,11 @@ def login():
if error is None:
session.clear()
session['user_id'] = Config.USERNAME + Config.PASSWORD
hash_session = username + \
hashlib.sha256(password.encode("utf8")).hexdigest()
hash_session = hashlib.sha256(
hash_session.encode("utf8")).hexdigest()
session['user_id'] = hash_session
return redirect(url_for('index.index'))
flash(error)
@@ -42,7 +47,11 @@ def login_required(view):
def wrapped_view(**kwargs):
x = session.get('user_id')
if x != Config.USERNAME + Config.PASSWORD:
hash_session = Config.USERNAME + \
hashlib.sha256(Config.PASSWORD.encode("utf8")).hexdigest()
hash_session = hashlib.sha256(hash_session.encode("utf8")).hexdigest()
if x != hash_session:
return redirect(url_for('login.login'))
g.user = {'user_id': x, 'username': Config.USERNAME}

View File

@@ -1,5 +1,5 @@
import os
import sqlite3
from server.sql import Connect
import time
import json
import server.arcscore
@@ -179,46 +179,34 @@ def update_database():
# 对于arcaea_datebase.db更新一些表并用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')
c1 = conn1.cursor()
conn2 = sqlite3.connect('./database/arcaea_database.db')
c2 = conn2.cursor()
with Connect('./database/old_arcaea_database.db') as c1:
with Connect() as c2:
update_one_table(c1, c2, 'user')
update_one_table(c1, c2, 'friend')
update_one_table(c1, c2, 'best_score')
update_one_table(c1, c2, 'recent30')
update_one_table(c1, c2, 'user_world')
update_one_table(c1, c2, 'item')
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_one_table(c1, c2, 'redeem')
update_one_table(c1, c2, 'user_redeem')
update_one_table(c1, c2, 'user')
update_one_table(c1, c2, 'friend')
update_one_table(c1, c2, 'best_score')
update_one_table(c1, c2, 'recent30')
update_one_table(c1, c2, 'user_world')
update_one_table(c1, c2, 'item')
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_one_table(c1, c2, 'redeem')
update_one_table(c1, c2, 'user_redeem')
update_user_char(c2)
update_user_char(c2)
conn1.commit()
conn1.close()
conn2.commit()
conn2.close()
os.remove('database/old_arcaea_database.db')
# songs
if os.path.isfile("database/old_arcsong.db") and os.path.isfile("database/arcsong.db"):
conn1 = sqlite3.connect('./database/old_arcsong.db')
c1 = conn1.cursor()
conn2 = sqlite3.connect('./database/arcsong.db')
c2 = conn2.cursor()
with Connect('./database/old_arcsong.db') as c1:
with Connect('./database/arcsong.db') as c2:
update_one_table(c1, c2, 'songs')
update_one_table(c1, c2, 'songs')
conn1.commit()
conn1.close()
conn2.commit()
conn2.close()
os.remove('database/old_arcsong.db')
@@ -257,34 +245,31 @@ def unlock_user_item(c, user_id):
def get_all_item():
# 所有购买数据查询
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute('''select * from item''')
x = c.fetchall()
re = []
if x:
for i in x:
discount_from = None
discount_to = None
with Connect() as c:
c.execute('''select * from item''')
x = c.fetchall()
re = []
if x:
for i in x:
discount_from = None
discount_to = None
if i[5] and i[5] >= 0:
discount_from = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(int(i[5])/1000))
if i[6] and i[6] >= 0:
discount_to = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(int(i[6])//1000))
if i[5] and i[5] >= 0:
discount_from = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(int(i[5])/1000))
if i[6] and i[6] >= 0:
discount_to = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(int(i[6])//1000))
re.append({'item_id': i[0],
'type': i[1],
'is_available': int2b(i[2]),
'price': i[3],
'orig_price': i[4],
'discount_from': discount_from,
'discount_to': discount_to
})
re.append({'item_id': i[0],
'type': i[1],
'is_available': int2b(i[2]),
'price': i[3],
'orig_price': i[4],
'discount_from': discount_from,
'discount_to': discount_to
})
conn.commit()
conn.close()
return re
@@ -346,19 +331,16 @@ def add_one_present(present_id, expire_ts, description, items):
# 添加一个奖励
message = None
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute(
'''select exists(select * from present where present_id=:a)''', {'a': present_id})
if c.fetchone() == (0,):
c.execute('''insert into present values(:a,:b,:c,:d)''', {
'a': present_id, 'b': expire_ts, 'c': items, 'd': description})
message = '添加成功 Successfully add it.'
else:
message = '奖励已存在 The present exists.'
with Connect() as c:
c.execute(
'''select exists(select * from present where present_id=:a)''', {'a': present_id})
if c.fetchone() == (0,):
c.execute('''insert into present values(:a,:b,:c,:d)''', {
'a': present_id, 'b': expire_ts, 'c': items, 'd': description})
message = '添加成功 Successfully add it.'
else:
message = '奖励已存在 The present exists.'
conn.commit()
conn.close()
return message
@@ -366,21 +348,18 @@ def delete_one_present(present_id):
# 删除一个奖励
message = None
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute(
'''select exists(select * from present where present_id=:a)''', {'a': present_id})
if c.fetchone() == (1,):
c.execute('''delete from present where present_id = :a''',
{'a': present_id})
c.execute('''delete from user_present where present_id =:a''', {
'a': present_id})
message = '删除成功 Successfully delete it.'
else:
message = '奖励不存在 The present does not exist.'
with Connect() as c:
c.execute(
'''select exists(select * from present where present_id=:a)''', {'a': present_id})
if c.fetchone() == (1,):
c.execute('''delete from present where present_id = :a''',
{'a': present_id})
c.execute('''delete from user_present where present_id =:a''', {
'a': present_id})
message = '删除成功 Successfully delete it.'
else:
message = '奖励不存在 The present does not exist.'
conn.commit()
conn.close()
return message
@@ -423,19 +402,16 @@ def add_one_redeem(code, redeem_type, items):
# 添加一个兑换码
message = None
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (0,):
c.execute('''insert into redeem values(:a,:b,:c)''', {
'a': code, 'b': items, 'c': redeem_type})
message = '添加成功 Successfully add it.'
else:
message = '兑换码已存在 The redeem code exists.'
with Connect() as c:
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (0,):
c.execute('''insert into redeem values(:a,:b,:c)''', {
'a': code, 'b': items, 'c': redeem_type})
message = '添加成功 Successfully add it.'
else:
message = '兑换码已存在 The redeem code exists.'
conn.commit()
conn.close()
return message
@@ -443,21 +419,19 @@ def add_some_random_redeem(amount, redeem_type, items):
# 随机生成一堆10位的兑换码
message = None
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
i = 1
while i <= amount:
code = random_str()
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (0,):
c.execute('''insert into redeem values(:a,:b,:c)''',
{'a': code, 'b': items, 'c': redeem_type})
i += 1
with Connect() as c:
i = 1
while i <= amount:
code = random_str()
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (0,):
c.execute('''insert into redeem values(:a,:b,:c)''',
{'a': code, 'b': items, 'c': redeem_type})
i += 1
message = '添加成功 Successfully add it.'
message = '添加成功 Successfully add it.'
conn.commit()
conn.close()
return message
@@ -465,19 +439,17 @@ def delete_one_redeem(code):
# 删除一个兑换码
message = None
conn = sqlite3.connect('./database/arcaea_database.db')
c = conn.cursor()
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (1,):
c.execute('''delete from redeem where code = :a''', {'a': code})
c.execute('''delete from user_redeem where code =:a''', {'a': code})
message = '删除成功 Successfully delete it.'
else:
message = '兑换码不存在 The redeem code does not exist.'
with Connect() as c:
c.execute(
'''select exists(select * from redeem where code=:a)''', {'a': code})
if c.fetchone() == (1,):
c.execute('''delete from redeem where code = :a''', {'a': code})
c.execute(
'''delete from user_redeem where code =:a''', {'a': code})
message = '删除成功 Successfully delete it.'
else:
message = '兑换码不存在 The redeem code does not exist.'
conn.commit()
conn.close()
return message

View File

@@ -49,6 +49,10 @@ def get_user(c, user_id):
if x[20]:
time_played = time.strftime('%Y-%m-%d %H:%M:%S',
time.localtime(int(x[20])//1000))
if x[2] == '':
ban_flag = True
else:
ban_flag = False
r = {'name': x[1],
'user_id': user_id,
@@ -65,7 +69,8 @@ def get_user(c, user_id):
'time_played': time_played,
'clear_type': x[21],
'rating': x[22],
'ticket': x[26]
'ticket': x[26],
'ban_flag': ban_flag
}
return r