add region checker cron
parent
ca9bb849a0
commit
4e889de090
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
$statement = $RUNTIME['PDO']->prepare("SELECT * FROM regions");
|
||||||
|
$statement->execute();
|
||||||
|
|
||||||
|
ini_set('default_socket_timeout', 3);
|
||||||
|
|
||||||
|
$ctx = stream_context_create(array('http'=>
|
||||||
|
array(
|
||||||
|
'timeout' => 3, //1200 Seconds is 20 Minutes
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
while($row = $statement->fetch())
|
||||||
|
{
|
||||||
|
$result = @file_get_contents($row['serverURI']."jsonSimStats", false, $ctx);
|
||||||
|
|
||||||
|
if($result == FALSE || $result == "")
|
||||||
|
{
|
||||||
|
sendInworldIM("00000000-0000-0000-0000-000000000000", $row['owner_uuid'], "Inventory", $RUNTIME['GRID']['HOMEURL'], "WARNUNG: Deine Region '".$row['regionName']."' ist nicht erreichbar und wurde deshalb aus dem Grid entfernt.");
|
||||||
|
echo "Die Region ".$row['regionName']." von ".$RUNTIME['OPENSIM']->getUserName($row['owner_uuid'])." ist nicht erreichbar.\n";
|
||||||
|
|
||||||
|
$statementUpdate = $RUNTIME['PDO']->prepare('DELETE FROM regions WHERE uuid = :uuid');
|
||||||
|
$statementUpdate->execute(['uuid' => $row['uuid']]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in New Issue