Fix a bug

Fix a bug about link play not getting the right address.
If you use reverse proxy, this may be helpful.
This commit is contained in:
Lost-MSth
2022-01-24 22:38:43 +08:00
parent d9a543bc5a
commit 5bc9b9a3dc
2 changed files with 26 additions and 3 deletions

View File

@@ -727,7 +727,11 @@ def room_create(user_id):
conn1, user_id, client_song_map)
if error_code == 0:
value['endPoint'] = request.host.split(':')[0]
if Config.LINK_PLAY_HOST == '':
value['endPoint'] = request.host.split(':')[0]
else:
value['endPoint'] = Config.LINK_PLAY_HOST
value['port'] = int(Config.UDP_PORT)
return jsonify({
"success": True,
@@ -749,7 +753,11 @@ def room_join(user_id, room_code):
conn1, user_id, client_song_map, room_code)
if error_code == 0:
value['endPoint'] = request.host.split(':')[0]
if Config.LINK_PLAY_HOST == '':
value['endPoint'] = request.host.split(':')[0]
else:
value['endPoint'] = Config.LINK_PLAY_HOST
value['port'] = int(Config.UDP_PORT)
return jsonify({
"success": True,
@@ -769,7 +777,11 @@ def multiplayer_update(user_id):
error_code, value = server.arclinkplay.update_room(conn1, user_id, token)
if error_code == 0:
value['endPoint'] = request.host.split(':')[0]
if Config.LINK_PLAY_HOST == '':
value['endPoint'] = request.host.split(':')[0]
else:
value['endPoint'] = Config.LINK_PLAY_HOST
value['port'] = int(Config.UDP_PORT)
return jsonify({
"success": True,

View File

@@ -46,6 +46,17 @@ class Config():
--------------------
'''
'''
--------------------
联机功能地址,留空则自动获取
Link Play address
If left blank, it will be obtained automatically.
'''
LINK_PLAY_HOST = '' # ***.com
'''
--------------------
'''
'''
--------------------
SSL证书路径