Commit ab7b67ae authored by nanahira's avatar nanahira

add reconnect room tips

parent d35bd135
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
"add_windbot_failed": "AI addition failed, enter /ai again.", "add_windbot_failed": "AI addition failed, enter /ai again.",
"quit_watch": "quited spectating", "quit_watch": "quited spectating",
"left_game": "quited game", "left_game": "quited game",
"disconnect_from_game": "disconnected from the game",
"reconnect_to_game": "reconnected to the game",
"server_closed": "Connection terminated.", "server_closed": "Connection terminated.",
"server_error": "Server error:", "server_error": "Server error:",
"cloud_replay_no": "Replay not found.", "cloud_replay_no": "Replay not found.",
...@@ -297,6 +299,8 @@ ...@@ -297,6 +299,8 @@
"add_windbot_failed": "添加AI失败,可尝试输入 /ai 重新添加", "add_windbot_failed": "添加AI失败,可尝试输入 /ai 重新添加",
"quit_watch": "退出了观战", "quit_watch": "退出了观战",
"left_game": "离开了游戏", "left_game": "离开了游戏",
"disconnect_from_game": "断开了连接",
"reconnect_to_game": "重新连接了",
"server_closed": "服务器关闭了连接", "server_closed": "服务器关闭了连接",
"server_error": "服务器错误:", "server_error": "服务器错误:",
"cloud_replay_no": "没有找到录像", "cloud_replay_no": "没有找到录像",
......
...@@ -485,6 +485,7 @@ CLIENT_reconnect_register = (client, room_id, error) -> ...@@ -485,6 +485,7 @@ CLIENT_reconnect_register = (client, room_id, error) ->
, settings.modules.reconnect.wait_time) , settings.modules.reconnect.wait_time)
dinfo.timeout = tmot dinfo.timeout = tmot
disconnect_list[CLIENT_get_authorize_key(client)] = dinfo disconnect_list[CLIENT_get_authorize_key(client)] = dinfo
ygopro.stoc_send_chat_to_room(room, "#{client.name} ${disconnect_from_game}" + if error then ": #{error}" else '')
if settings.modules.reconnect.auto_surrender_after_disconnect and room.turn and room.turn > 0 if settings.modules.reconnect.auto_surrender_after_disconnect and room.turn and room.turn > 0
ygopro.ctos_send(client.server, 'SURRENDER') ygopro.ctos_send(client.server, 'SURRENDER')
return true return true
...@@ -623,6 +624,7 @@ CLIENT_reconnect = (client) -> ...@@ -623,6 +624,7 @@ CLIENT_reconnect = (client) ->
client.pre_establish_buffers = [] client.pre_establish_buffers = []
CLIENT_import_data(client, dinfo.old_client, room) CLIENT_import_data(client, dinfo.old_client, room)
CLIENT_send_reconnect_info(client, client.server, room) CLIENT_send_reconnect_info(client, client.server, room)
ygopro.stoc_send_chat_to_room(room, "#{client.name} ${reconnect_to_game}")
CLIENT_reconnect_unregister(client, true) CLIENT_reconnect_unregister(client, true)
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment