Commit ed52f897 authored by nanahira's avatar nanahira

add reconnect

parent 5c4550cb
......@@ -29,7 +29,8 @@
"34": "HS_READY",
"35": "HS_NOTREADY",
"36": "HS_KICK",
"37": "HS_START"
"37": "HS_START",
"48": "REQUEST_FIELD"
},
"STOC": {
"1": "GAME_MSG",
......@@ -51,7 +52,8 @@
"25": "CHAT",
"32": "HS_PLAYER_ENTER",
"33": "HS_PLAYER_CHANGE",
"34": "HS_WATCH_CHANGE"
"34": "HS_WATCH_CHANGE",
"48": "FIELD_FINISH"
},
"PLAYERCHANGE":{
"8": "OBSERVE",
......
......@@ -86,6 +86,10 @@
"enabled": true,
"max_retry_count": false
},
"reconnect": {
"enabled": true,
"wait_time": 300000
},
"mycard": {
"enabled": false,
"auth_base_url": "https://ygobbs.com",
......
......@@ -131,6 +131,10 @@
"retry_too_much_part2": " times.",
"retry_too_much_room_part1": " was kicked from the room for performing an illegal operation ",
"retry_too_much_room_part2": " times.",
"pre_reconnecting_to_room": "You will be reconnected to your previous game. Please pick your Previous deck.",
"deck_incorrect_reconnect": "Please pick your Previous deck.",
"reconnect_failed": "Reconnect failed.",
"reconnecting_to_room": "Reconnecting to server...",
"athletic_arena_tip": "During an athletic match, a game quit behavior is regarded as a surrender."
},
"es-es": {
......@@ -398,6 +402,10 @@
"retry_too_much_part2": "次,已被请出房间。",
"retry_too_much_room_part1": " 由于在决斗中违规操作",
"retry_too_much_room_part2": "次,已被请出房间。",
"pre_reconnecting_to_room": "你有未完成的对局,即将重新连接,请选择你在本局决斗中使用的卡组并准备。",
"deck_incorrect_reconnect": "请选择你在本局决斗中使用的卡组。",
"reconnect_failed": "重新连接失败。",
"reconnecting_to_room": "正在重新连接到服务器……",
"athletic_arena_tip": "在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
"ko-kr": {
......
......@@ -3,7 +3,7 @@
{"name": "lflist", "type": "unsigned int"},
{"name": "rule", "type": "unsigned char"},
{"name": "mode", "type": "unsigned char"},
{"name": "enable_priority", "type": "bool"},
{"name": "duel_rule", "type": "unsigned char"},
{"name": "no_check_deck", "type": "bool"},
{"name": "no_shuffle_deck", "type": "bool"},
{"name": "start_lp", "type": "unsigned int"},
......
This diff is collapsed.
This diff is collapsed.
......@@ -60,6 +60,8 @@ for name, declaration of structs_declaration
#消息发送函数,至少要把俩合起来....
@stoc_send = (socket, proto, info)->
if socket.closed
return
#console.log proto, proto_structs.STOC[proto], structs[proto_structs.STOC[proto]]
if typeof info == 'undefined'
buffer = ""
......@@ -86,6 +88,8 @@ for name, declaration of structs_declaration
return
@ctos_send = (socket, proto, info)->
if socket.closed
return
#console.log proto, proto_structs.CTOS[proto], structs[proto_structs.CTOS[proto]]
if typeof info == 'undefined'
buffer = ""
......@@ -164,5 +168,7 @@ for name, declaration of structs_declaration
msg: 1
code: 9
} if client
client.destroy() if client
if client
client.system_kicked = true
client.destroy()
return
\ No newline at end of file
......@@ -104,6 +104,9 @@
this.stoc_send = function(socket, proto, info) {
var buffer, header, key, ref, struct, value;
if (socket.closed) {
return;
}
if (typeof info === 'undefined') {
buffer = "";
} else if (Buffer.isBuffer(info)) {
......@@ -138,6 +141,9 @@
this.ctos_send = function(socket, proto, info) {
var buffer, header, key, ref, struct, value;
if (socket.closed) {
return;
}
if (typeof info === 'undefined') {
buffer = "";
} else if (Buffer.isBuffer(info)) {
......@@ -264,6 +270,7 @@
});
}
if (client) {
client.system_kicked = true;
client.destroy();
}
};
......
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