Update to v1.4

This commit is contained in:
Lost-MSth
2020-10-30 20:17:21 +08:00
parent bb7ba249e9
commit 123554e24d
46 changed files with 9758 additions and 9638 deletions

View File

@@ -176,9 +176,9 @@ char = ['Hikari','Tairitsu','Kou','Sapphire','Lethe','','Tairitsu(Axium)'
,'Shirabe','Hikari(Zero)','Hikari(Fracture)','Hikari(Summer)','Tairitsu(Summer)' ,'Shirabe','Hikari(Zero)','Hikari(Fracture)','Hikari(Summer)','Tairitsu(Summer)'
,'Tairitsu&Trin','Ayu','Eto&Luna','Yume','Seine & Hikari','Saya','Tairitsu & Chuni Penguin' ,'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' ,'Chuni Penguin','Haruna','Nono','MTA-XXX','MDA-21','Kanae','Hikari(Fantasia)','Tairitsu(Sonata)','Sia','DORO*C'
,'Tairitsu(Tempest)','Brillante','Ilith(Summer)'] ,'Tairitsu(Tempest)','Brillante','Ilith(Summer)','Etude']
for i in range(0, 38): for i in range(0, 39):
if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21]: if i in [0, 1, 2, 4, 13, 26, 27, 28, 29, 36, 21]:
sql = 'insert into character values('+str(i)+',"'+char[i]+'''",30,25000,25000,90,90,90,'',0,0,'',0,'',1,1)''' sql = 'insert into character values('+str(i)+',"'+char[i]+'''",30,25000,25000,90,90,90,'',0,0,'',0,'',1,1)'''
c.execute(sql) c.execute(sql)

View File

@@ -0,0 +1,21 @@
AudioOffset:408
-
timing(0,210.00,4.00);
(1142,4);
(1571,2);
(2857,1);
(3142,2);
(3428,3);
(3857,4);
(4142,3);
(4571,2);
(5000,1);
(5428,3);
arc(5714,6857,0.00,0.50,s,1.00,1.00,0,none,false);
arc(6857,8000,0.50,0.00,s,1.00,1.00,0,none,false);
arc(8000,9142,0.00,0.50,s,1.00,1.00,0,none,false);
arc(9142,10285,0.50,0.00,s,1.00,1.00,0,none,false);
arc(10285,11428,1.00,0.50,s,1.00,1.00,1,none,false);
arc(11428,12571,0.50,1.00,s,1.00,1.00,1,none,false);
arc(12571,13714,1.00,0.50,s,1.00,1.00,1,none,false);
arc(13714,14571,0.50,1.00,s,1.00,1.00,1,none,false);

View File

@@ -1,4 +1,4 @@
from flask import Flask, request, jsonify, make_response from flask import Flask, request, jsonify, make_response, send_from_directory
import configparser import configparser
import base64 import base64
import server.auth import server.auth
@@ -8,6 +8,8 @@ import server.arcscore
import web.login import web.login
import web.index import web.index
import server.arcworld import server.arcworld
import server.arcdownload
import os
app = Flask(__name__) app = Flask(__name__)
wsgi_app = app.wsgi_app wsgi_app = app.wsgi_app
@@ -22,6 +24,14 @@ def error_return(error_code): # 错误返回
# 105 24小时内登入两台设备 # 105 24小时内登入两台设备
# 106 账户冻结 # 106 账户冻结
# 107 你没有足够的体力 # 107 你没有足够的体力
# 113 活动已结束
# 114 该活动已结束,您的成绩不会提交
# 120 封号警告
# 121 账户冻结
# 122 账户暂时冻结
# 123 账户被限制
# 150 非常抱歉您已被限制使用此功能
# 151 目前无法使用此功能
# 401 用户不存在 # 401 用户不存在
# 403 无法连接至服务器 # 403 无法连接至服务器
# 501 502 此物品目前无法获取 # 501 502 此物品目前无法获取
@@ -31,6 +41,8 @@ def error_return(error_code): # 错误返回
# 601 好友列表已满 # 601 好友列表已满
# 602 此用户已是好友 # 602 此用户已是好友
# 604 你不能加自己为好友 # 604 你不能加自己为好友
# 1001 设备数量达到上限
# 1002 该设备已使用过本功能
# 其它 发生未知错误 # 其它 发生未知错误
return jsonify({ return jsonify({
"success": False, "success": False,
@@ -512,6 +524,45 @@ def world_one(map_id):
return error_return(108) return error_return(108)
@app.route('/coffee/12/serve/download/me/song', methods=['GET']) # 歌曲下载
def download_song():
headers = request.headers
token = headers['Authorization']
token = token[7:]
song_ids = request.args.getlist('sid')
try:
user_id = server.auth.token_get_id(token)
if user_id:
re = {}
if not song_ids:
re = server.arcdownload.get_all_songs()
else:
for song_id in song_ids:
re.update(server.arcdownload.get_one_song(song_id))
return jsonify({
"success": True,
"value": re
})
else:
return error_return(108)
except:
return error_return(108)
@app.route('/download/<path:file_path>', methods=['GET']) # 下载
def download(file_path):
try:
path = os.path.join('./database/songs', file_path)
if os.path.isfile(path) and not('../' in path or '..\\' in path):
return send_from_directory('./database/songs', file_path, as_attachment=True)
else:
return error_return(109)
except:
return error_return(108)
@app.route('/coffee/<path:path>', methods=['POST']) # 三个设置,写在最后降低优先级 @app.route('/coffee/<path:path>', methods=['POST']) # 三个设置,写在最后降低优先级
def sys_set(path): def sys_set(path):
set_arg = path[10:] set_arg = path[10:]

View File

@@ -0,0 +1,48 @@
import os
import hashlib
from flask import url_for
def get_file_md5(file_path):
# 计算文件MD5
if not os.path.isfile(file_path):
return None
myhash = hashlib.md5()
f = open(file_path, 'rb')
while True:
b = f.read(8096)
if not b:
break
myhash.update(b)
f.close()
return myhash.hexdigest()
def get_one_song(song_id, file_dir='./database/songs'):
# 获取一首歌的下载链接,返回字典
dir_list = os.listdir(os.path.join(file_dir, song_id))
re = {}
for i in dir_list:
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 i == 'base.ogg':
re['audio'] = {"checksum": get_file_md5(os.path.join(file_dir, song_id, 'base.ogg')),
"url": url_for('download', file_path=song_id+'/base.ogg', _external=True)}
else:
if 'chart' not in re:
re['chart'] = {}
re['chart'][i[0]] = {"checksum": get_file_md5(os.path.join(file_dir, song_id, i)),
"url": url_for('download', file_path=song_id+'/'+i, _external=True)}
return {song_id: re}
def get_all_songs(file_dir='./database/songs'):
# 获取所有歌的下载链接,返回字典
dir_list = os.listdir(file_dir)
re = {}
for i in dir_list:
if os.path.isdir(os.path.join(file_dir, i)):
re.update(get_one_song(i))
return re

View File

@@ -149,8 +149,8 @@ def get_value_0(c, user_id):
"max_stamina_ts": 1586274871917, "max_stamina_ts": 1586274871917,
"stamina": 12, "stamina": 12,
"world_unlocks": [], "world_unlocks": [],
"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"], "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"],
"singles": ["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", "buchigireberserker2"], "singles": ["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", "buchigireberserker2", "xeraphinite"],
"packs": ["vs", "extend", "dynamix", "prelude", "core", "yugamu", "omatsuri", "zettai", "mirai", "shiawase", "chunithm", "nijuusei", "groovecoaster", "rei", "tonesphere", "lanota"], "packs": ["vs", "extend", "dynamix", "prelude", "core", "yugamu", "omatsuri", "zettai", "mirai", "shiawase", "chunithm", "nijuusei", "groovecoaster", "rei", "tonesphere", "lanota"],
"characters": characters, "characters": characters,
"cores": [], "cores": [],

View File

@@ -264,7 +264,7 @@ def update_database():
flash('未选择文件 No selected file.') flash('未选择文件 No selected file.')
return redirect(request.url) return redirect(request.url)
if file and allowed_file(file.filename): if file and allowed_file(file.filename) and file.filename in ['arcsong.db', 'arcaea_database.db']:
filename = 'old_' + secure_filename(file.filename) filename = 'old_' + secure_filename(file.filename)
file.save(os.path.join(UPLOAD_FOLDER, filename)) file.save(os.path.join(UPLOAD_FOLDER, filename))
flash('上传成功 Success upload.') flash('上传成功 Success upload.')