Commit 0d88f88d authored by nanahira's avatar nanahira

post challonge mid duel

parent e5d22127
......@@ -2637,6 +2637,18 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)->
ygopro.stoc_send_chat(client, "${side_remain_part1}#{client.side_tcount}${side_remain_part2}", ygopro.constants.COLORS.BABYBLUE)
, 60000
client.side_interval = sinterval
if settings.modules.challonge.enabled and client.pos == 0
temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log))
delete temp_log.winnerId
challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id),
matchId: room.challonge_info.id,
match: temp_log,
callback: (err, data) ->
if err
log.warn("Errored pushing scores to Challonge.", err)
return
})
if room.random_type or room.arena
if client.pos == 0
room.waiting_for_player = client
......
......@@ -3286,7 +3286,7 @@
});
ygopro.stoc_follow('CHANGE_SIDE', false, function(buffer, info, client, server) {
var room, sinterval;
var room, sinterval, temp_log;
room = ROOM_all[client.rid];
if (!room) {
return;
......@@ -3314,6 +3314,20 @@
}, 60000);
client.side_interval = sinterval;
}
if (settings.modules.challonge.enabled && client.pos === 0) {
temp_log = JSON.parse(JSON.stringify(room.challonge_duel_log));
delete temp_log.winnerId;
challonge.matches.update({
id: encodeURIComponent(settings.modules.challonge.tournament_id),
matchId: room.challonge_info.id,
match: temp_log,
callback: function(err, data) {
if (err) {
log.warn("Errored pushing scores to Challonge.", err);
}
}
});
}
if (room.random_type || room.arena) {
if (client.pos === 0) {
room.waiting_for_player = client;
......
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