mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-10 01:37:27 +08:00
Fix a small bug
Fix a bug about double slashes in URL, which will influence character uncap, uncap override and level up with EXP cores when you use a special game API prefix, like '/latte' or '/latte/1'. It means that the length of game API prefix is not 2 in the end (not '/*** . . . **/**') and the bug will happen.
This commit is contained in:
@@ -263,9 +263,7 @@ def character_change(user_id):
|
|||||||
@app.route(add_url_prefix('/<path:path>/toggle_uncap', True), methods=['POST'])
|
@app.route(add_url_prefix('/<path:path>/toggle_uncap', True), methods=['POST'])
|
||||||
@server.auth.auth_required(request)
|
@server.auth.auth_required(request)
|
||||||
def character_uncap(user_id, path):
|
def character_uncap(user_id, path):
|
||||||
while '//' in path:
|
character_id = int(path[path.find('character')+10:])
|
||||||
path = path.replace('//', '/')
|
|
||||||
character_id = int(path[21:])
|
|
||||||
r = server.setme.change_char_uncap(user_id, character_id)
|
r = server.setme.change_char_uncap(user_id, character_id)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -283,9 +281,7 @@ def character_uncap(user_id, path):
|
|||||||
@app.route(add_url_prefix('/<path:path>/uncap', True), methods=['POST'])
|
@app.route(add_url_prefix('/<path:path>/uncap', True), methods=['POST'])
|
||||||
@server.auth.auth_required(request)
|
@server.auth.auth_required(request)
|
||||||
def character_first_uncap(user_id, path):
|
def character_first_uncap(user_id, path):
|
||||||
while '//' in path:
|
character_id = int(path[path.find('character')+10:])
|
||||||
path = path.replace('//', '/')
|
|
||||||
character_id = int(path[21:])
|
|
||||||
r = server.character.char_uncap(user_id, character_id)
|
r = server.character.char_uncap(user_id, character_id)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -300,9 +296,7 @@ def character_first_uncap(user_id, path):
|
|||||||
@app.route(add_url_prefix('/<path:path>/exp', True), methods=['POST'])
|
@app.route(add_url_prefix('/<path:path>/exp', True), methods=['POST'])
|
||||||
@server.auth.auth_required(request)
|
@server.auth.auth_required(request)
|
||||||
def character_exp(user_id, path):
|
def character_exp(user_id, path):
|
||||||
while '//' in path:
|
character_id = int(path[path.find('character')+10:])
|
||||||
path = path.replace('//', '/')
|
|
||||||
character_id = int(path[21:])
|
|
||||||
amount = int(request.form['amount'])
|
amount = int(request.form['amount'])
|
||||||
r = server.character.char_use_core(user_id, character_id, amount)
|
r = server.character.char_use_core(user_id, character_id, amount)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
@@ -652,7 +646,7 @@ def download(file_path):
|
|||||||
@app.route(add_url_prefix('/<path:path>', True), methods=['POST'])
|
@app.route(add_url_prefix('/<path:path>', True), methods=['POST'])
|
||||||
@server.auth.auth_required(request)
|
@server.auth.auth_required(request)
|
||||||
def sys_set(user_id, path):
|
def sys_set(user_id, path):
|
||||||
set_arg = path[10:]
|
set_arg = path[5:]
|
||||||
value = request.form['value']
|
value = request.form['value']
|
||||||
server.setme.arc_sys_set(user_id, value, set_arg)
|
server.setme.arc_sys_set(user_id, value, set_arg)
|
||||||
r = server.info.arc_aggregate_small(user_id)
|
r = server.info.arc_aggregate_small(user_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user