Commit 9680fea7 authored by mercury233's avatar mercury233

windbot disable random room

parent a0aeacdd
...@@ -160,7 +160,8 @@ ...@@ -160,7 +160,8 @@
"arena_wait_timeout": "Your opponent did not appear, you may quit without any penalty.", "arena_wait_timeout": "Your opponent did not appear, you may quit without any penalty.",
"auto_death_part1": "This room is an auto-extra-duel room. The Extra Duel will begin after ", "auto_death_part1": "This room is an auto-extra-duel room. The Extra Duel will begin after ",
"auto_death_part2": " minutes.", "auto_death_part2": " minutes.",
"athletic_arena_tip": "During an athletic match, a game quit behavior is regarded as a surrender." "athletic_arena_tip": "During an athletic match, a game quit behavior is regarded as a surrender.",
"windbot_disable_random_room": "By adding the AI, this random game won't get any new player unless they enter the room name:"
}, },
"es-es": { "es-es": {
"random_duel_enter_room_waiting": "Tu oponente esta listo, Iniciar!", "random_duel_enter_room_waiting": "Tu oponente esta listo, Iniciar!",
...@@ -467,7 +468,8 @@ ...@@ -467,7 +468,8 @@
"arena_wait_timeout": "由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。", "arena_wait_timeout": "由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。",
"auto_death_part1": "本房间为自动加时赛房间。比赛开始", "auto_death_part1": "本房间为自动加时赛房间。比赛开始",
"auto_death_part2": "分钟后,将自动进入加时赛。", "auto_death_part2": "分钟后,将自动进入加时赛。",
"athletic_arena_tip": "在竞技匹配中,比赛开始前退出游戏也会视为投降。" "athletic_arena_tip": "在竞技匹配中,比赛开始前退出游戏也会视为投降。",
"windbot_disable_random_room": "因为添加了AI,本随机对战房间将只能通过房间名加入:"
}, },
"ko-kr": { "ko-kr": {
"random_duel_enter_room_waiting": "땅콩: 게임을 진행하게 준비 또는 시작을 하십시오.", "random_duel_enter_room_waiting": "땅콩: 게임을 진행하게 준비 또는 시작을 하십시오.",
......
...@@ -560,7 +560,7 @@ ROOM_find_or_create_random = (type, player_ip)-> ...@@ -560,7 +560,7 @@ ROOM_find_or_create_random = (type, player_ip)->
max_player = if type == 'T' then 4 else 2 max_player = if type == 'T' then 4 else 2
playerbanned = (bannedplayer and bannedplayer.count > 3 and moment() < bannedplayer.time) playerbanned = (bannedplayer and bannedplayer.count > 3 and moment() < bannedplayer.time)
result = _.find ROOM_all, (room)-> result = _.find ROOM_all, (room)->
return room and room.random_type != '' and !room.started and return room and room.random_type != '' and !room.started and !room.windbot and
((type == '' and (room.random_type == 'S' or (settings.modules.random_duel.blank_pass_match and room.random_type != 'T'))) or room.random_type == type) and ((type == '' and (room.random_type == 'S' or (settings.modules.random_duel.blank_pass_match and room.random_type != 'T'))) or room.random_type == type) and
room.get_playing_player().length < max_player and room.get_playing_player().length < max_player and
(settings.modules.random_duel.no_rematch_check or room.get_host() == null or (settings.modules.random_duel.no_rematch_check or room.get_host() == null or
...@@ -2857,6 +2857,8 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)-> ...@@ -2857,6 +2857,8 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
return return
else else
windbot = _.sample windbots windbot = _.sample windbots
if room.random_type
ygopro.stoc_send_chat(client, "${windbot_disable_random_room} " + room.name, ygopro.constants.COLORS.BABYBLUE)
room.add_windbot(windbot) room.add_windbot(windbot)
when '/roomname' when '/roomname'
......
...@@ -703,7 +703,7 @@ ...@@ -703,7 +703,7 @@
max_player = type === 'T' ? 4 : 2; max_player = type === 'T' ? 4 : 2;
playerbanned = bannedplayer && bannedplayer.count > 3 && moment() < bannedplayer.time; playerbanned = bannedplayer && bannedplayer.count > 3 && moment() < bannedplayer.time;
result = _.find(ROOM_all, function(room) { result = _.find(ROOM_all, function(room) {
return room && room.random_type !== '' && !room.started && ((type === '' && (room.random_type === 'S' || (settings.modules.random_duel.blank_pass_match && room.random_type !== 'T'))) || room.random_type === type) && room.get_playing_player().length < max_player && (settings.modules.random_duel.no_rematch_check || room.get_host() === null || room.get_host().ip !== ROOM_players_oppentlist[player_ip]) && (playerbanned === room.deprecated || type === 'T'); return room && room.random_type !== '' && !room.started && !room.windbot && ((type === '' && (room.random_type === 'S' || (settings.modules.random_duel.blank_pass_match && room.random_type !== 'T'))) || room.random_type === type) && room.get_playing_player().length < max_player && (settings.modules.random_duel.no_rematch_check || room.get_host() === null || room.get_host().ip !== ROOM_players_oppentlist[player_ip]) && (playerbanned === room.deprecated || type === 'T');
}); });
if (result) { if (result) {
result.welcome = '${random_duel_enter_room_waiting}'; result.welcome = '${random_duel_enter_room_waiting}';
...@@ -3629,6 +3629,9 @@ ...@@ -3629,6 +3629,9 @@
} else { } else {
windbot = _.sample(windbots); windbot = _.sample(windbots);
} }
if (room.random_type) {
ygopro.stoc_send_chat(client, "${windbot_disable_random_room} " + room.name, ygopro.constants.COLORS.BABYBLUE);
}
room.add_windbot(windbot); room.add_windbot(windbot);
} }
break; break;
......
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