Commit 5faacb7e authored by nanahira's avatar nanahira

Merge branch 'master' into ai-play

parents 699f4dfc 260253aa
Pipeline #14350 failed with stages
in 9 minutes and 6 seconds
...@@ -28,6 +28,7 @@ class Challonge { ...@@ -28,6 +28,7 @@ class Challonge {
include_participants: 1, include_participants: 1,
include_matches: 1, include_matches: 1,
}, },
timeout: 5000,
}); });
this.previous = tournament; this.previous = tournament;
this.previousTime = (0, moment_1.default)(); this.previousTime = (0, moment_1.default)();
......
...@@ -176,6 +176,7 @@ export class Challonge { ...@@ -176,6 +176,7 @@ export class Challonge {
include_participants: 1, include_participants: 1,
include_matches: 1, include_matches: 1,
}, },
timeout: 5000,
}, },
); );
this.previous = tournament; this.previous = tournament;
......
...@@ -338,7 +338,7 @@ init = () -> ...@@ -338,7 +338,7 @@ init = () ->
imported = true imported = true
#import the old Challonge api key option #import the old Challonge api key option
if settings.modules.challonge.options if settings.modules.challonge.options
settings.modules.challonge.api_key = settings.modules.challonge.options.api_key settings.modules.challonge.api_key = settings.modules.challonge.options.apiKey
delete settings.modules.challonge.options delete settings.modules.challonge.options
imported = true imported = true
#import the old random_duel.blank_pass_match option #import the old random_duel.blank_pass_match option
...@@ -1262,7 +1262,7 @@ class Room ...@@ -1262,7 +1262,7 @@ class Room
@established = false @established = false
@watcher_buffers = [] @watcher_buffers = []
@recorder_buffers = [] @recorder_buffers = []
@cloud_replay_id = Math.floor(Math.random()*100000000) @cloud_replay_id = Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)
@watchers = [] @watchers = []
@random_type = '' @random_type = ''
@welcome = '' @welcome = ''
......
...@@ -438,7 +438,7 @@ ...@@ -438,7 +438,7 @@
} }
//import the old Challonge api key option //import the old Challonge api key option
if (settings.modules.challonge.options) { if (settings.modules.challonge.options) {
settings.modules.challonge.api_key = settings.modules.challonge.options.api_key; settings.modules.challonge.api_key = settings.modules.challonge.options.apiKey;
delete settings.modules.challonge.options; delete settings.modules.challonge.options;
imported = true; imported = true;
} }
...@@ -1658,7 +1658,7 @@ ...@@ -1658,7 +1658,7 @@
this.established = false; this.established = false;
this.watcher_buffers = []; this.watcher_buffers = [];
this.recorder_buffers = []; this.recorder_buffers = [];
this.cloud_replay_id = Math.floor(Math.random() * 100000000); this.cloud_replay_id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
this.watchers = []; this.watchers = [];
this.random_type = ''; this.random_type = '';
this.welcome = ''; this.welcome = '';
......
...@@ -158,14 +158,14 @@ const UploadToChallonge = async function () { ...@@ -158,14 +158,14 @@ const UploadToChallonge = async function () {
sendResponse("开始清空 Challonge 玩家列表。"); sendResponse("开始清空 Challonge 玩家列表。");
await axios.delete(`https://api.challonge.com/v1/tournaments/${challonge_config.tournament_id}/participants/clear.json`, { await axios.delete(`https://api.challonge.com/v1/tournaments/${challonge_config.tournament_id}/participants/clear.json`, {
params: { params: {
api_key: challonge_config.options.apiKey api_key: challonge_config.api_key
} }
}); });
sendResponse("开始上传玩家列表至 Challonge。"); sendResponse("开始上传玩家列表至 Challonge。");
for (const chunk of _.chunk(player_list, 10)) { for (const chunk of _.chunk(player_list, 10)) {
sendResponse(`开始上传玩家 ${chunk.join(', ')} 至 Challonge。`); sendResponse(`开始上传玩家 ${chunk.join(', ')} 至 Challonge。`);
await axios.post(`https://api.challonge.com/v1/tournaments/${challonge_config.tournament_id}/participants/bulk_add.json`, { await axios.post(`https://api.challonge.com/v1/tournaments/${challonge_config.tournament_id}/participants/bulk_add.json`, {
api_key: challonge_config.options.apiKey, api_key: challonge_config.api_key,
participants: chunk.map(name => ({ name })), participants: chunk.map(name => ({ name })),
}); });
} }
......
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