mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-24 15:41:52 +00:00
23 lines
520 B
PHP
23 lines
520 B
PHP
<?php
|
|
requirePHPLib('judger');
|
|
requirePHPLib('svn');
|
|
|
|
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");
|
|
?>
|