Commit daa9b667 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 5986ba58 14f2b9d9
......@@ -22,6 +22,8 @@
"add_windbot_failed": "AI addition failed, enter /ai again.",
"quit_watch": "quited spectating",
"left_game": "quited game",
"disconnect_from_game": "disconnected from the game",
"reconnect_to_game": "reconnected to the game",
"server_closed": "Connection terminated.",
"server_error": "Server error:",
"cloud_replay_no": "Replay not found.",
......@@ -297,6 +299,8 @@
"add_windbot_failed": "添加AI失败,可尝试输入 /ai 重新添加",
"quit_watch": "退出了观战",
"left_game": "离开了游戏",
"disconnect_from_game": "断开了连接",
"reconnect_to_game": "重新连接了",
"server_closed": "服务器关闭了连接",
"server_error": "服务器错误:",
"cloud_replay_no": "没有找到录像",
......
......@@ -500,6 +500,7 @@ CLIENT_reconnect_register = (client, room_id, error) ->
, settings.modules.reconnect.wait_time)
dinfo.timeout = tmot
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
ygopro.ctos_send(client.server, 'SURRENDER')
return true
......@@ -638,6 +639,7 @@ CLIENT_reconnect = (client) ->
client.pre_establish_buffers = []
CLIENT_import_data(client, dinfo.old_client, 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)
return
......
......@@ -642,6 +642,7 @@
}, settings.modules.reconnect.wait_time);
dinfo.timeout = tmot;
disconnect_list[CLIENT_get_authorize_key(client)] = dinfo;
ygopro.stoc_send_chat_to_room(room, (client.name + " ${disconnect_from_game}") + (error ? ": " + error : ''));
if (settings.modules.reconnect.auto_surrender_after_disconnect && room.turn && room.turn > 0) {
ygopro.ctos_send(client.server, 'SURRENDER');
}
......@@ -824,6 +825,7 @@
client.pre_establish_buffers = [];
CLIENT_import_data(client, dinfo.old_client, 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);
};
......
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