You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
497 B
22 lines
497 B
<?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");
|
|
?>
|