mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-10 18:07:28 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
941a79ccc7 | ||
|
|
62902a561c | ||
|
|
1660bc5899 | ||
|
|
d577246d28 | ||
|
|
9fd626468e | ||
|
|
c51a1b4e85 | ||
|
|
0e42123417 | ||
|
|
e216e6144b | ||
|
|
b70c435a4a | ||
|
|
eb03d2be93 | ||
|
|
fcb5d264ef | ||
|
|
d617951e1f | ||
|
|
febf931f1a | ||
|
|
981961d6a1 |
19
README.md
19
README.md
@@ -39,8 +39,8 @@ This procedure is mainly used for study and research, and shall not be used for
|
|||||||
- 服务器日志 Server log
|
- 服务器日志 Server log
|
||||||
|
|
||||||
没有以下 We don't have:
|
没有以下 We don't have:
|
||||||
- 角色数值 Character characteristic value
|
|
||||||
- 服务器安全性保证 Server security assurance
|
- 服务器安全性保证 Server security assurance
|
||||||
|
- 世界模式下的搭档升级、觉醒,以及某些奖励的获取 Partner upgrading, uncapping, and receiving some rewards in the world mode
|
||||||
|
|
||||||
可能有问题 There may be problems:
|
可能有问题 There may be problems:
|
||||||
- Recent 30
|
- Recent 30
|
||||||
@@ -60,17 +60,18 @@ It is just so interesting. What it can do is under exploration.
|
|||||||
## 更新日志 Update log
|
## 更新日志 Update log
|
||||||
只保留最新版本 Only keep the latest version.
|
只保留最新版本 Only keep the latest version.
|
||||||
|
|
||||||
> 提醒:更新时请注意保留原先的数据库,以防数据丢失
|
> 提醒:更新时请注意保留原先的数据库,以防数据丢失。使用前请先运行**database_initialize.py**以获得初始数据库。
|
||||||
>
|
>
|
||||||
> 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.
|
||||||
|
> Before using, please run **database_initialize.py** to get the initial database.
|
||||||
|
|
||||||
### Version 2.3
|
### Version 2.3.2
|
||||||
- 适用于Arcaea 3.5.2版本 For Arcaea 3.5.2
|
- 适用于Arcaea 3.5.4版本 For Arcaea 3.5.4
|
||||||
- 更新了歌曲数据库 Update the song database.
|
- 更新了歌曲数据库 Update the song database.
|
||||||
- 新增服务器日志 Add server log.
|
- 新增运行前关键性文件检查 Add checking critical files before running.
|
||||||
- 优化了代码结构 Optimize the code structure.
|
- 新增可下载数据的客户端校验更新 Add client verification update of downloadable data.
|
||||||
- 修复了一些Bug,提升服务器安全性 Fix some bugs and improve server security.
|
- 新增歌曲成绩的谱面校验 Add checking chart file when submitting the song score.
|
||||||
|
- 修复了一些Bug Fix some bugs.
|
||||||
|
|
||||||
## 运行环境与依赖 Running environment and requirements
|
## 运行环境与依赖 Running environment and requirements
|
||||||
- Windows/Linux/Mac OS/Android
|
- Windows/Linux/Mac OS/Android
|
||||||
@@ -78,6 +79,7 @@ It is just so interesting. What it can do is under exploration.
|
|||||||
- Flask module
|
- Flask module
|
||||||
- Charles (optional)
|
- Charles (optional)
|
||||||
|
|
||||||
|
<!--
|
||||||
## 环境搭建 Environment construction
|
## 环境搭建 Environment construction
|
||||||
[中文](https://github.com/Lost-MSth/Arcaea-server/wiki/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA)
|
[中文](https://github.com/Lost-MSth/Arcaea-server/wiki/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA)
|
||||||
[English](https://github.com/Lost-MSth/Arcaea-server/wiki/Environment-construction)
|
[English](https://github.com/Lost-MSth/Arcaea-server/wiki/Environment-construction)
|
||||||
@@ -89,6 +91,7 @@ It is just so interesting. What it can do is under exploration.
|
|||||||
## 注意 Attentions
|
## 注意 Attentions
|
||||||
[中文](https://github.com/Lost-MSth/Arcaea-server/wiki/%E6%B3%A8%E6%84%8F)
|
[中文](https://github.com/Lost-MSth/Arcaea-server/wiki/%E6%B3%A8%E6%84%8F)
|
||||||
[English](https://github.com/Lost-MSth/Arcaea-server/wiki/Attentions)
|
[English](https://github.com/Lost-MSth/Arcaea-server/wiki/Attentions)
|
||||||
|
-->
|
||||||
|
|
||||||
## 鸣谢 Thanks
|
## 鸣谢 Thanks
|
||||||
歌曲数据库来自 Using song database from
|
歌曲数据库来自 Using song database from
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -244,16 +244,36 @@ skill_id = ['gauge_easy', '', '', '', 'note_mirror', '', '', 'gauge_hard', 'frag
|
|||||||
skill_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', '', '', 'shirabe_entry_fee',
|
skill_id_uncap = ['', '', 'frags_kou', '', 'visual_ink', '', '', '', '', '', '', '', '', 'shirabe_entry_fee',
|
||||||
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
|
'', '', '', '', '', '', '', 'frags_yume', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
|
||||||
|
|
||||||
|
frag = [88, 90, 100, 75, 80, 0, 70, 79, 65, 40, 50, 80, 90, 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]
|
||||||
|
|
||||||
|
prog = [71, 90, 80, 75, 100, 0, 90, 102, 84, 78, 105, 67, 63, 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]
|
||||||
|
|
||||||
|
overdrive = [71, 90, 57, 75, 80, 0, 95, 79, 65, 31, 50, 59, 90, 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, 90]
|
||||||
|
|
||||||
|
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]
|
||||||
|
|
||||||
|
print(len(char))
|
||||||
|
print(len(skill_id))
|
||||||
|
print(len(skill_id_uncap))
|
||||||
|
print(len(frag))
|
||||||
|
print(len(prog))
|
||||||
|
print(len(overdrive))
|
||||||
|
print(len(char_type))
|
||||||
|
|
||||||
for i in range(0, 45):
|
for i in range(0, 45):
|
||||||
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]:
|
||||||
sql = 'insert into character values('+str(
|
sql = '''insert into character values(:a,:b,30,25000,25000,:c,:d,:e,:f,0,0,:g,:h,'',1,1)'''
|
||||||
i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',1,1)'''
|
c.execute(sql, {'a': i, 'b': char[i], 'c': frag[i], 'd': prog[i],
|
||||||
c.execute(sql)
|
'e': overdrive[i], 'f': skill_id[i], 'g': skill_id_uncap[i], 'h': char_type[i]})
|
||||||
else:
|
else:
|
||||||
if i != 5:
|
if i != 5:
|
||||||
sql = 'insert into character values('+str(
|
sql = '''insert into character values(:a,:b,20,10000,10000,:c,:d,:e,:f,0,0,:g,:h,'',0,0)'''
|
||||||
i)+',"'+char[i]+'''",30,25000,25000,90,90,90,"'''+skill_id[i]+'''",0,0,"'''+skill_id_uncap[i]+'''",0,'',0,0)'''
|
c.execute(sql, {'a': i, 'b': char[i], 'c': frag[i], 'd': prog[i],
|
||||||
c.execute(sql)
|
'e': overdrive[i], 'f': skill_id[i], 'g': skill_id_uncap[i], 'h': char_type[i]})
|
||||||
|
|
||||||
|
|
||||||
def b2int(x):
|
def b2int(x):
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"id": "dataerror",
|
"id": "dataerror",
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"_id": "6046bab736651a07ebc537f3",
|
"_id": "606f9f5636651a07ebc541f3",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -24,10 +24,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"id": "yourvoiceso",
|
"id": "yourvoiceso",
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"_id": "6046bab736651a07ebc53800",
|
"_id": "606f9f5636651a07ebc54201",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"id": "crosssoul",
|
"id": "crosssoul",
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"_id": "6046bab736651a07ebc5380d",
|
"_id": "606f9f5636651a07ebc5420e",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -48,10 +48,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "impurebird",
|
"id": "impurebird",
|
||||||
"_id": "6046bab736651a07ebc53801",
|
"_id": "606f9f5636651a07ebc541f4",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "auxesia",
|
"id": "auxesia",
|
||||||
"_id": "6046bab736651a07ebc5380e",
|
"_id": "606f9f5636651a07ebc5420f",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -72,10 +72,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "modelista",
|
"id": "modelista",
|
||||||
"_id": "6046bab736651a07ebc537f4",
|
"_id": "606f9f5636651a07ebc54202",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -84,10 +84,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "yozakurafubuki",
|
"id": "yozakurafubuki",
|
||||||
"_id": "6046bab736651a07ebc53802",
|
"_id": "606f9f5636651a07ebc541f5",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -96,10 +96,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "surrender",
|
"id": "surrender",
|
||||||
"_id": "6046bab736651a07ebc5380f",
|
"_id": "606f9f5636651a07ebc54210",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "metallicpunisher",
|
"id": "metallicpunisher",
|
||||||
"_id": "6046bab736651a07ebc537f5",
|
"_id": "606f9f5636651a07ebc54203",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "carminescythe",
|
"id": "carminescythe",
|
||||||
"_id": "6046bab736651a07ebc53803",
|
"_id": "606f9f5636651a07ebc541f6",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -128,10 +128,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "bethere",
|
"id": "bethere",
|
||||||
"_id": "6046bab736651a07ebc53810",
|
"_id": "606f9f5636651a07ebc54211",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -140,10 +140,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "callmyname",
|
"id": "callmyname",
|
||||||
"_id": "6046bab736651a07ebc537e9",
|
"_id": "606f9f5636651a07ebc5421c",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -152,10 +152,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "fallensquare",
|
"id": "fallensquare",
|
||||||
"_id": "6046bab736651a07ebc537de",
|
"_id": "606f9f5636651a07ebc541e9",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -164,10 +164,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "dropdead",
|
"id": "dropdead",
|
||||||
"_id": "6046bab736651a07ebc53804",
|
"_id": "606f9f5636651a07ebc541f7",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -176,10 +176,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "alexandrite",
|
"id": "alexandrite",
|
||||||
"_id": "6046bab736651a07ebc53811",
|
"_id": "606f9f5636651a07ebc54212",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -188,10 +188,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "astraltale",
|
"id": "astraltale",
|
||||||
"_id": "6046bab736651a07ebc537f7",
|
"_id": "606f9f5636651a07ebc54205",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "phantasia",
|
"id": "phantasia",
|
||||||
"_id": "6046bab736651a07ebc537df",
|
"_id": "606f9f5636651a07ebc541ea",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "empireofwinter",
|
"id": "empireofwinter",
|
||||||
"_id": "6046bab736651a07ebc53805",
|
"_id": "606f9f5636651a07ebc541f8",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -220,10 +220,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "libertas",
|
"id": "libertas",
|
||||||
"_id": "6046bab736651a07ebc537eb",
|
"_id": "606f9f5636651a07ebc5421e",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -232,10 +232,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "dottodot",
|
"id": "dottodot",
|
||||||
"_id": "6046bab736651a07ebc537e0",
|
"_id": "606f9f5636651a07ebc541eb",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -244,10 +244,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "dreadnought",
|
"id": "dreadnought",
|
||||||
"_id": "6046bab736651a07ebc537ec",
|
"_id": "606f9f5636651a07ebc5421f",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -256,10 +256,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "mirzam",
|
"id": "mirzam",
|
||||||
"_id": "6046bab736651a07ebc537e1",
|
"_id": "606f9f5636651a07ebc541ec",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -268,10 +268,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "heavenlycaress",
|
"id": "heavenlycaress",
|
||||||
"_id": "6046bab736651a07ebc53807",
|
"_id": "606f9f5636651a07ebc541fa",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -280,10 +280,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "filament",
|
"id": "filament",
|
||||||
"_id": "6046bab736651a07ebc53814",
|
"_id": "606f9f5636651a07ebc54215",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "avantraze",
|
"id": "avantraze",
|
||||||
"_id": "6046bab736651a07ebc537ed",
|
"_id": "606f9f5636651a07ebc54220",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -302,10 +302,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "battlenoone",
|
"id": "battlenoone",
|
||||||
"_id": "6046bab736651a07ebc537fa",
|
"_id": "606f9f5636651a07ebc54208",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -314,7 +314,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "saikyostronger",
|
"id": "saikyostronger",
|
||||||
"_id": "6046bab736651a07ebc537e2",
|
"_id": "606f9f5636651a07ebc541ed",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -324,10 +324,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "izana",
|
"id": "izana",
|
||||||
"_id": "6046bab736651a07ebc53808",
|
"_id": "606f9f5636651a07ebc541fb",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -336,10 +336,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "einherjar",
|
"id": "einherjar",
|
||||||
"_id": "6046bab736651a07ebc53815",
|
"_id": "606f9f5636651a07ebc54216",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -348,10 +348,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "laqryma",
|
"id": "laqryma",
|
||||||
"_id": "6046bab736651a07ebc537ee",
|
"_id": "606f9f5636651a07ebc54221",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -360,10 +360,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "amygdata",
|
"id": "amygdata",
|
||||||
"_id": "6046bab736651a07ebc537fb",
|
"_id": "606f9f5636651a07ebc54209",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -372,10 +372,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "altale",
|
"id": "altale",
|
||||||
"_id": "6046bab736651a07ebc537e3",
|
"_id": "606f9f5636651a07ebc541ee",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -384,10 +384,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "feelssoright",
|
"id": "feelssoright",
|
||||||
"_id": "6046bab736651a07ebc537ef",
|
"_id": "606f9f5636651a07ebc54222",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -396,7 +396,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "scarletcage",
|
"id": "scarletcage",
|
||||||
"_id": "6046bab736651a07ebc537fc",
|
"_id": "606f9f5636651a07ebc5420a",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -406,7 +406,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "teriqma",
|
"id": "teriqma",
|
||||||
"_id": "6046bab736651a07ebc537e4",
|
"_id": "606f9f5636651a07ebc541ef",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -416,10 +416,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "mahoroba",
|
"id": "mahoroba",
|
||||||
"_id": "6046bab736651a07ebc5380a",
|
"_id": "606f9f5636651a07ebc541fd",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -428,10 +428,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "badtek",
|
"id": "badtek",
|
||||||
"_id": "6046bab736651a07ebc537f0",
|
"_id": "606f9f5636651a07ebc54223",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -440,7 +440,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "maliciousmischance",
|
"id": "maliciousmischance",
|
||||||
"_id": "6046bab736651a07ebc53817",
|
"_id": "606f9f5636651a07ebc54218",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -450,7 +450,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "buchigireberserker",
|
"id": "buchigireberserker",
|
||||||
"_id": "6046bab736651a07ebc537e5",
|
"_id": "606f9f5636651a07ebc541f0",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -460,10 +460,10 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "galaxyfriends",
|
"id": "galaxyfriends",
|
||||||
"_id": "6046bab736651a07ebc5380b",
|
"_id": "606f9f5636651a07ebc541fe",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 50,
|
"price": 100,
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
"discount_from": 1615248000000,
|
"discount_from": 1615248000000,
|
||||||
"discount_to": 1615852799000
|
"discount_to": 1615852799000
|
||||||
@@ -472,7 +472,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "xeraphinite",
|
"id": "xeraphinite",
|
||||||
"_id": "6046bab736651a07ebc53818",
|
"_id": "606f9f5636651a07ebc54219",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
@@ -482,7 +482,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "xanatos",
|
"id": "xanatos",
|
||||||
"_id": "6046bab736651a07ebc537f1",
|
"_id": "606f9f5636651a07ebc54224",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"price": 100,
|
"price": 100,
|
||||||
@@ -492,7 +492,7 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "attraqtia",
|
"id": "attraqtia",
|
||||||
"_id": "6046bab736651a07ebc537ff",
|
"_id": "606f9f5636651a07ebc5420d",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
@@ -502,7 +502,17 @@
|
|||||||
"items": [{
|
"items": [{
|
||||||
"type": "single",
|
"type": "single",
|
||||||
"id": "gimmedablood",
|
"id": "gimmedablood",
|
||||||
"_id": "6046bab736651a07ebc537e7",
|
"_id": "606f9f5636651a07ebc541f2",
|
||||||
|
"is_available": true
|
||||||
|
}],
|
||||||
|
"orig_price": 100,
|
||||||
|
"price": 100
|
||||||
|
}, {
|
||||||
|
"name": "bassline",
|
||||||
|
"items": [{
|
||||||
|
"type": "single",
|
||||||
|
"id": "bassline",
|
||||||
|
"_id": "606f9f5636651a07ebc54200",
|
||||||
"is_available": true
|
"is_available": true
|
||||||
}],
|
}],
|
||||||
"orig_price": 100,
|
"orig_price": 100,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ import web.index
|
|||||||
import server.arcworld
|
import server.arcworld
|
||||||
import server.arcdownload
|
import server.arcdownload
|
||||||
import server.arcpurchase
|
import server.arcpurchase
|
||||||
|
import server.init
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -89,7 +91,11 @@ def login():
|
|||||||
id_pwd = headers['Authorization']
|
id_pwd = headers['Authorization']
|
||||||
id_pwd = base64.b64decode(id_pwd[6:]).decode()
|
id_pwd = base64.b64decode(id_pwd[6:]).decode()
|
||||||
name, password = id_pwd.split(':', 1)
|
name, password = id_pwd.split(':', 1)
|
||||||
device_id = headers['DeviceId']
|
if 'DeviceId' in headers:
|
||||||
|
device_id = headers['DeviceId']
|
||||||
|
else:
|
||||||
|
device_id = 'low_version'
|
||||||
|
|
||||||
token, error_code = server.auth.arc_login(name, password, device_id)
|
token, error_code = server.auth.arc_login(name, password, device_id)
|
||||||
if not error_code:
|
if not error_code:
|
||||||
r = {"success": True, "token_type": "Bearer"}
|
r = {"success": True, "token_type": "Bearer"}
|
||||||
@@ -103,7 +109,11 @@ def login():
|
|||||||
def register():
|
def register():
|
||||||
name = request.form['name']
|
name = request.form['name']
|
||||||
password = request.form['password']
|
password = request.form['password']
|
||||||
device_id = request.form['device_id']
|
if 'device_id' in request.form:
|
||||||
|
device_id = request.form['device_id']
|
||||||
|
else:
|
||||||
|
device_id = 'low_version'
|
||||||
|
|
||||||
user_id, token, error_code = server.auth.arc_register(
|
user_id, token, error_code = server.auth.arc_register(
|
||||||
name, password, device_id)
|
name, password, device_id)
|
||||||
if user_id is not None:
|
if user_id is not None:
|
||||||
@@ -513,6 +523,7 @@ def sys_set(user_id, path):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
os.chdir(sys.path[0]) # 更改工作路径,以便于愉快使用相对路径
|
||||||
app.config.from_mapping(SECRET_KEY=Config.SECRET_KEY)
|
app.config.from_mapping(SECRET_KEY=Config.SECRET_KEY)
|
||||||
app.config['SESSION_TYPE'] = 'filesystem'
|
app.config['SESSION_TYPE'] = 'filesystem'
|
||||||
app.register_blueprint(web.login.bp)
|
app.register_blueprint(web.login.bp)
|
||||||
@@ -560,6 +571,11 @@ def main():
|
|||||||
|
|
||||||
dictConfig(log_dict)
|
dictConfig(log_dict)
|
||||||
|
|
||||||
|
if not server.init.check_before_run(app):
|
||||||
|
app.logger.error('Something wrong. The server will not run.')
|
||||||
|
input('Press ENTER key to exit.')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
app.logger.info("Start to initialize data in 'songfile' table...")
|
app.logger.info("Start to initialize data in 'songfile' table...")
|
||||||
try:
|
try:
|
||||||
error = server.arcdownload.initialize_songfile()
|
error = server.arcdownload.initialize_songfile()
|
||||||
@@ -570,7 +586,11 @@ def main():
|
|||||||
else:
|
else:
|
||||||
app.logger.info('Complete!')
|
app.logger.info('Complete!')
|
||||||
|
|
||||||
app.run(Config.HOST, Config.PORT)
|
if Config.SSL_CERT and Config.SSL_KEY:
|
||||||
|
app.run(Config.HOST, Config.PORT, ssl_context=(
|
||||||
|
Config.SSL_CERT, Config.SSL_KEY))
|
||||||
|
else:
|
||||||
|
app.run(Config.HOST, Config.PORT)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -25,7 +25,24 @@ def get_file_md5(file_path):
|
|||||||
return myhash.hexdigest()
|
return myhash.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def get_one_song(c, user_id, song_id, file_dir='./database/songs'):
|
def get_url(file_path, **kwargs):
|
||||||
|
# 获取下载地址
|
||||||
|
|
||||||
|
t = ''
|
||||||
|
if 't' in kwargs:
|
||||||
|
t = kwargs['t']
|
||||||
|
|
||||||
|
if Config.DOWNLOAD_LINK_PREFIX:
|
||||||
|
prefix = Config.DOWNLOAD_LINK_PREFIX
|
||||||
|
if prefix[-1] != '/':
|
||||||
|
prefix += '/'
|
||||||
|
|
||||||
|
return prefix + file_path + '?t=' + t
|
||||||
|
else:
|
||||||
|
return url_for('download', file_path=file_path, t=t, _external=True)
|
||||||
|
|
||||||
|
|
||||||
|
def get_one_song(c, user_id, song_id, file_dir='./database/songs', url_flag=True):
|
||||||
# 获取一首歌的下载链接,返回字典
|
# 获取一首歌的下载链接,返回字典
|
||||||
dir_list = os.listdir(os.path.join(file_dir, song_id))
|
dir_list = os.listdir(os.path.join(file_dir, song_id))
|
||||||
re = {}
|
re = {}
|
||||||
@@ -37,7 +54,6 @@ def get_one_song(c, user_id, song_id, file_dir='./database/songs'):
|
|||||||
if os.path.isfile(os.path.join(file_dir, song_id, i)) and i in ['0.aff', '1.aff', '2.aff', '3.aff', 'base.ogg']:
|
if os.path.isfile(os.path.join(file_dir, song_id, i)) and i in ['0.aff', '1.aff', '2.aff', '3.aff', 'base.ogg']:
|
||||||
token = hashlib.md5(
|
token = hashlib.md5(
|
||||||
(str(user_id) + song_id + i + str(now)).encode(encoding='UTF-8')).hexdigest()
|
(str(user_id) + song_id + i + str(now)).encode(encoding='UTF-8')).hexdigest()
|
||||||
token = token[:8]
|
|
||||||
|
|
||||||
if i == 'base.ogg':
|
if i == 'base.ogg':
|
||||||
c.execute(
|
c.execute(
|
||||||
@@ -48,8 +64,12 @@ def get_one_song(c, user_id, song_id, file_dir='./database/songs'):
|
|||||||
else:
|
else:
|
||||||
checksum = get_file_md5(os.path.join(
|
checksum = get_file_md5(os.path.join(
|
||||||
file_dir, song_id, 'base.ogg'))
|
file_dir, song_id, 'base.ogg'))
|
||||||
re['audio'] = {"checksum": checksum,
|
|
||||||
"url": url_for('download', file_path=song_id+'/base.ogg', t=token, _external=True)}
|
if url_flag:
|
||||||
|
re['audio'] = {"checksum": checksum, "url": get_url(
|
||||||
|
file_path=song_id+'/base.ogg', t=token)}
|
||||||
|
else:
|
||||||
|
re['audio'] = {"checksum": checksum}
|
||||||
else:
|
else:
|
||||||
if 'chart' not in re:
|
if 'chart' not in re:
|
||||||
re['chart'] = {}
|
re['chart'] = {}
|
||||||
@@ -60,23 +80,28 @@ def get_one_song(c, user_id, song_id, file_dir='./database/songs'):
|
|||||||
checksum = x[0]
|
checksum = x[0]
|
||||||
else:
|
else:
|
||||||
checksum = get_file_md5(os.path.join(file_dir, song_id, i))
|
checksum = get_file_md5(os.path.join(file_dir, song_id, i))
|
||||||
re['chart'][i[0]] = {"checksum": checksum,
|
|
||||||
"url": url_for('download', file_path=song_id+'/'+i, t=token, _external=True)}
|
|
||||||
|
|
||||||
c.execute('''insert into download_token values(:a,:b,:c,:d,:e)''', {
|
if url_flag:
|
||||||
'a': user_id, 'b': song_id, 'c': i, 'd': token, 'e': now})
|
re['chart'][i[0]] = {"checksum": checksum, "url": get_url(
|
||||||
|
file_path=song_id+'/'+i, t=token)}
|
||||||
|
else:
|
||||||
|
re['chart'][i[0]] = {"checksum": checksum}
|
||||||
|
|
||||||
|
if url_flag:
|
||||||
|
c.execute('''insert into download_token values(:a,:b,:c,:d,:e)''', {
|
||||||
|
'a': user_id, 'b': song_id, 'c': i, 'd': token, 'e': now})
|
||||||
|
|
||||||
return {song_id: re}
|
return {song_id: re}
|
||||||
|
|
||||||
|
|
||||||
def get_all_songs(user_id, file_dir='./database/songs'):
|
def get_all_songs(user_id, file_dir='./database/songs', url_flag=True):
|
||||||
# 获取所有歌的下载链接,返回字典
|
# 获取所有歌的下载链接,返回字典
|
||||||
dir_list = os.listdir(file_dir)
|
dir_list = os.listdir(file_dir)
|
||||||
re = {}
|
re = {}
|
||||||
with Connect() as c:
|
with Connect() as c:
|
||||||
for i in dir_list:
|
for i in dir_list:
|
||||||
if os.path.isdir(os.path.join(file_dir, i)):
|
if os.path.isdir(os.path.join(file_dir, i)):
|
||||||
re.update(get_one_song(c, user_id, i, file_dir))
|
re.update(get_one_song(c, user_id, i, file_dir, url_flag))
|
||||||
|
|
||||||
return re
|
return re
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -111,9 +111,9 @@ def arc_register(name: str, password: str, device_id: str): # 注册
|
|||||||
user_id = build_user_id(c)
|
user_id = build_user_id(c)
|
||||||
now = int(time.time() * 1000)
|
now = int(time.time() * 1000)
|
||||||
c.execute('''insert into user(user_id, name, password, join_date, user_code, rating_ptt,
|
c.execute('''insert into user(user_id, name, password, join_date, user_code, rating_ptt,
|
||||||
character_id, is_skill_sealed, is_char_uncapped, is_char_uncapped_override, is_hide_rating, favorite_character, max_stamina_notification_enabled, current_map, ticket)
|
character_id, is_skill_sealed, is_char_uncapped, is_char_uncapped_override, is_hide_rating, favorite_character, max_stamina_notification_enabled, current_map, ticket, prog_boost)
|
||||||
values(:user_id, :name, :password, :join_date, :user_code, 0, 0, 0, 0, 0, 0, -1, 0, '', 0)
|
values(:user_id, :name, :password, :join_date, :user_code, 0, 0, 0, 0, 0, 0, -1, 0, '', :memories, 0)
|
||||||
''', {'user_code': user_code, 'user_id': user_id, 'join_date': now, 'name': name, 'password': hash_pwd})
|
''', {'user_code': user_code, 'user_id': user_id, 'join_date': now, 'name': name, 'password': hash_pwd, 'memories': Config.DEFAULT_MEMORIES})
|
||||||
c.execute('''insert into recent30(user_id) values(:user_id)''', {
|
c.execute('''insert into recent30(user_id) values(:user_id)''', {
|
||||||
'user_id': user_id})
|
'user_id': user_id})
|
||||||
|
|
||||||
@@ -168,9 +168,10 @@ def auth_required(request):
|
|||||||
user_id = None
|
user_id = None
|
||||||
with Connect() as c:
|
with Connect() as c:
|
||||||
headers = request.headers
|
headers = request.headers
|
||||||
token = headers['Authorization']
|
if 'Authorization' in headers:
|
||||||
token = token[7:]
|
token = headers['Authorization']
|
||||||
user_id = token_get_id(token)
|
token = token[7:]
|
||||||
|
user_id = token_get_id(token)
|
||||||
|
|
||||||
if user_id is not None:
|
if user_id is not None:
|
||||||
return view(user_id, *args, **kwargs)
|
return view(user_id, *args, **kwargs)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
from server.sql import Connect
|
from server.sql import Connect
|
||||||
import server.arcworld
|
import server.arcworld
|
||||||
import server.arcpurchase
|
import server.arcpurchase
|
||||||
|
import server.arcdownload
|
||||||
import time
|
import time
|
||||||
|
from setting import Config
|
||||||
|
|
||||||
|
|
||||||
def int2b(x):
|
def int2b(x):
|
||||||
@@ -174,7 +176,7 @@ def get_value_0(c, user_id):
|
|||||||
if x[27] and x[27] != 0:
|
if x[27] and x[27] != 0:
|
||||||
prog_boost = 300
|
prog_boost = 300
|
||||||
|
|
||||||
r = {"is_aprilfools": False,
|
r = {"is_aprilfools": Config.IS_APRILFOOLS,
|
||||||
"curr_available_maps": [],
|
"curr_available_maps": [],
|
||||||
"character_stats": user_character,
|
"character_stats": user_character,
|
||||||
"friends": get_user_friend(c, user_id),
|
"friends": get_user_friend(c, user_id),
|
||||||
@@ -197,7 +199,7 @@ def get_value_0(c, user_id):
|
|||||||
"max_stamina_ts": 1586274871917,
|
"max_stamina_ts": 1586274871917,
|
||||||
"stamina": 12,
|
"stamina": 12,
|
||||||
"world_unlocks": ["scenery_chap1", "scenery_chap2", "scenery_chap3", "scenery_chap4", "scenery_chap5"],
|
"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"],
|
"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"],
|
||||||
"singles": get_user_singles(c, user_id),
|
"singles": get_user_singles(c, user_id),
|
||||||
"packs": get_user_packs(c, user_id),
|
"packs": get_user_packs(c, user_id),
|
||||||
"characters": characters,
|
"characters": characters,
|
||||||
@@ -225,7 +227,7 @@ def arc_aggregate_small(user_id):
|
|||||||
|
|
||||||
|
|
||||||
def arc_aggregate_big(user_id):
|
def arc_aggregate_big(user_id):
|
||||||
# 返回用户数据和地图歌曲信息
|
# 返回比较全的用户数据
|
||||||
r = {"success": False}
|
r = {"success": False}
|
||||||
with Connect() as c:
|
with Connect() as c:
|
||||||
r = {"success": True,
|
r = {"success": True,
|
||||||
@@ -237,7 +239,7 @@ def arc_aggregate_big(user_id):
|
|||||||
"value": server.arcpurchase.get_item(c, 'pack')
|
"value": server.arcpurchase.get_item(c, 'pack')
|
||||||
}, {
|
}, {
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"value": {}
|
"value": server.arcdownload.get_all_songs(user_id, url_flag=False)
|
||||||
}, {
|
}, {
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"value": {
|
"value": {
|
||||||
|
|||||||
29
latest version/server/init.py
Normal file
29
latest version/server/init.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def check_before_run(app):
|
||||||
|
# 运行前检查关键文件,返回布尔值,其实是因为有人经常忘了
|
||||||
|
|
||||||
|
f = True
|
||||||
|
|
||||||
|
if not os.path.exists('setting.py'):
|
||||||
|
app.logger.warning('File `setting.py` is missing.')
|
||||||
|
f = False
|
||||||
|
|
||||||
|
if not os.path.exists('database'):
|
||||||
|
app.logger.warning('Folder `database` is missing.')
|
||||||
|
f = False
|
||||||
|
|
||||||
|
if not os.path.exists('database/songs'):
|
||||||
|
app.logger.warning('Folder `database/songs` is missing.')
|
||||||
|
f = False
|
||||||
|
|
||||||
|
if not os.path.exists('database/arcaea_database.db'):
|
||||||
|
app.logger.warning('File `database/arcaea_database.db` is missing.')
|
||||||
|
f = False
|
||||||
|
|
||||||
|
if not os.path.exists('database/arcsong.db'):
|
||||||
|
app.logger.warning('File `database/arcsong.db` is missing.')
|
||||||
|
f = False
|
||||||
|
|
||||||
|
return f
|
||||||
@@ -8,12 +8,35 @@ class Config():
|
|||||||
主机的地址和端口号
|
主机的地址和端口号
|
||||||
Host and port of your server
|
Host and port of your server
|
||||||
'''
|
'''
|
||||||
HOST = '192.168.1.105'
|
HOST = '192.168.1.101'
|
||||||
PORT = '80'
|
PORT = '80'
|
||||||
'''
|
'''
|
||||||
--------------------
|
--------------------
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
SSL证书路径
|
||||||
|
留空则使用HTTP
|
||||||
|
SSL certificate path
|
||||||
|
If left blank, use HTTP.
|
||||||
|
'''
|
||||||
|
SSL_CERT = '' # *.pem
|
||||||
|
SSL_KEY = '' # *.key
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
愚人节模式开关
|
||||||
|
Switch of April Fool's Day
|
||||||
|
'''
|
||||||
|
IS_APRILFOOLS = True
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
'''
|
||||||
|
|
||||||
'''
|
'''
|
||||||
--------------------
|
--------------------
|
||||||
Web后台管理页面的用户名和密码
|
Web后台管理页面的用户名和密码
|
||||||
@@ -36,6 +59,17 @@ class Config():
|
|||||||
--------------------
|
--------------------
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
歌曲下载地址前缀,留空则自动获取
|
||||||
|
Song download address prefix
|
||||||
|
If left blank, it will be obtained automatically.
|
||||||
|
'''
|
||||||
|
DOWNLOAD_LINK_PREFIX = '' # http://***.com/download/
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
'''
|
||||||
|
|
||||||
'''
|
'''
|
||||||
--------------------
|
--------------------
|
||||||
玩家歌曲下载的24小时次数限制,每个文件算一次
|
玩家歌曲下载的24小时次数限制,每个文件算一次
|
||||||
@@ -75,3 +109,23 @@ class Config():
|
|||||||
'''
|
'''
|
||||||
--------------------
|
--------------------
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
用户注册时的默认记忆源点数量
|
||||||
|
The default amount of memories at the time of user registration
|
||||||
|
'''
|
||||||
|
DEFAULT_MEMORIES = 0
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
是否强制使用全解锁云端存档
|
||||||
|
If forcing full unlocked cloud save is enabled
|
||||||
|
'''
|
||||||
|
SAVE_FULL_UNLOCK = False
|
||||||
|
'''
|
||||||
|
--------------------
|
||||||
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user