Commit 3cd87561 authored by mercury233's avatar mercury233

fix

parent 01328843
...@@ -1368,6 +1368,8 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)-> ...@@ -1368,6 +1368,8 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
for deck in decks for deck in decks
if _.endsWith(deck, client.name+".ydk") if _.endsWith(deck, client.name+".ydk")
found_deck=deck found_deck=deck
if _.endsWith(deck, client.name+".ydk.ydk")
found_deck=deck
if found_deck if found_deck
deck_text=fs.readFileSync(settings.modules.tournament_mode.deck_path+found_deck,{encoding:"ASCII"}) deck_text=fs.readFileSync(settings.modules.tournament_mode.deck_path+found_deck,{encoding:"ASCII"})
deck_array=deck_text.split("\n") deck_array=deck_text.split("\n")
...@@ -1445,7 +1447,7 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)-> ...@@ -1445,7 +1447,7 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)->
ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)-> ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)->
room=ROOM_all[client.rid] room=ROOM_all[client.rid]
return settings.modules.tournament_mode.enabled unless room return settings.modules.tournament_mode.enabled unless room
if settings.modules.enable_cloud_replay if settings.modules.enable_cloud_replay and room.random_type
Cloud_replay_ids.push room.cloud_replay_id Cloud_replay_ids.push room.cloud_replay_id
if settings.modules.tournament_mode.enabled if settings.modules.tournament_mode.enabled
if client.is_host if client.is_host
...@@ -1462,7 +1464,7 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)-> ...@@ -1462,7 +1464,7 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)->
settings.modules.tournament_mode.duel_log.push log settings.modules.tournament_mode.duel_log.push log
nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log) nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log)
if settings.modules.enable_cloud_replay if settings.modules.enable_cloud_replay
ygopro.stoc_send_chat(client, "本场比赛云录像:R##{room.cloud_replay_id}。将于MATCH结束后可播放。", ygopro.constants.COLORS.BABYBLUE) ygopro.stoc_send_chat(client, "本场比赛云录像:R##{room.cloud_replay_id}。将于本局结束后可播放。", ygopro.constants.COLORS.BABYBLUE)
return true return true
else else
return false return false
......
...@@ -1706,6 +1706,9 @@ ...@@ -1706,6 +1706,9 @@
if (_.endsWith(deck, client.name + ".ydk")) { if (_.endsWith(deck, client.name + ".ydk")) {
found_deck = deck; found_deck = deck;
} }
if (_.endsWith(deck, client.name + ".ydk.ydk")) {
found_deck = deck;
}
} }
if (found_deck) { if (found_deck) {
deck_text = fs.readFileSync(settings.modules.tournament_mode.deck_path + found_deck, { deck_text = fs.readFileSync(settings.modules.tournament_mode.deck_path + found_deck, {
...@@ -1816,7 +1819,7 @@ ...@@ -1816,7 +1819,7 @@
if (!room) { if (!room) {
return settings.modules.tournament_mode.enabled; return settings.modules.tournament_mode.enabled;
} }
if (settings.modules.enable_cloud_replay) { if (settings.modules.enable_cloud_replay && room.random_type) {
Cloud_replay_ids.push(room.cloud_replay_id); Cloud_replay_ids.push(room.cloud_replay_id);
} }
if (settings.modules.tournament_mode.enabled) { if (settings.modules.tournament_mode.enabled) {
...@@ -1844,7 +1847,7 @@ ...@@ -1844,7 +1847,7 @@
nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log); nconf.myset(settings, "modules:tournament_mode:duel_log", settings.modules.tournament_mode.duel_log);
} }
if (settings.modules.enable_cloud_replay) { if (settings.modules.enable_cloud_replay) {
ygopro.stoc_send_chat(client, "本场比赛云录像:R#" + room.cloud_replay_id + "。将于MATCH结束后可播放。", ygopro.constants.COLORS.BABYBLUE); ygopro.stoc_send_chat(client, "本场比赛云录像:R#" + room.cloud_replay_id + "。将于本局结束后可播放。", ygopro.constants.COLORS.BABYBLUE);
} }
return true; return true;
} else { } else {
......
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