S2OJ/web/app/controllers/judge/sync_judge_client.php
Masco Skray 96d4a3ecf7 style(judger,web): move code out from subfolder "1"
Due to historical reasons, the code is in subfolder "1".
With SVN removal, we place the code back and remove the annoying "1" folder.
2019-06-14 23:34:41 +08:00

22 lines
497 B
PHP

<?php
requirePHPLib('judger');
if (!authenticateJudger()) {
become404Page();
}
foreach (DB::selectAll("select * from judger_info where ip != ''") as $judger) {
$socket = fsockopen($judger['ip'], UOJConfig::$data['judger']['socket']['port']);
if ($socket === false) {
die("judge client {$judger['ip']} lost.");
}
fwrite($socket, json_encode([
'password' => UOJConfig::$data['judger']['socket']['password'],
'cmd' => 'update'
]));
fclose($socket);
}
die("ok");
?>