Dateien hochladen nach „classen/OpenSimulator“
This commit is contained in:
parent
76e0bb1099
commit
3312269ae2
|
@ -11,7 +11,7 @@
|
|||
|
||||
private $Grid = null;
|
||||
|
||||
function __construct($regionName, $regionImage, $regionUUID, $userUUID, $regionHostname, $regionPort, $grid, $regionID = 0)
|
||||
function __construct($regionName, $regionUUID, $userUUID, $regionImage, $regionHostname, $regionPort, $grid, $regionID = 0)
|
||||
{
|
||||
global $RUNTIME;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
|||
$this->UserUUID = $userUUID;
|
||||
$this->RegionHostname = $regionHostname;
|
||||
$this->RegionPort = $regionPort;
|
||||
$this->RegionID = $regionID;
|
||||
|
||||
if($regionID == 0)
|
||||
{
|
||||
|
@ -40,5 +41,49 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getRegionForOnlineCheck($count)
|
||||
{
|
||||
global $RUNTIME;
|
||||
|
||||
$regionList = array();
|
||||
|
||||
$getRegionStatement = $RUNTIME['PDO']->prepare("SELECT * FROM regions ORDER BY LastSeen LIMIT 15");
|
||||
$getRegionStatement->execute(array());
|
||||
|
||||
while($regionRow = $getRegionStatement->fetch())
|
||||
{
|
||||
$getGridStatement = $RUNTIME['PDO']->prepare("SELECT * FROM grids WHERE GridID = :GridID");
|
||||
$getGridStatement->execute(array("GridID" => $regionRow['GridID']));
|
||||
|
||||
if($gridRow = $getGridStatement->fetch())
|
||||
{
|
||||
$gridData = new OSGrid($gridRow['GridName'], $gridRow['GridHomeURL'], $gridRow['GridAssetServer'], $gridRow['GridIMServer'], $gridRow['GridID']);
|
||||
|
||||
$regionList[] = new OSRegion($regionRow['RegionName'], $regionRow['RegionImage'], $regionRow['RegionUUID'], $regionRow['UserUUID'], $regionRow['RegionHostname'], $regionRow['RegionPort'], $gridData, $regionRow['RegionID']);
|
||||
}
|
||||
}
|
||||
|
||||
return $regionList;
|
||||
}
|
||||
|
||||
public function setOnline($online){
|
||||
global $RUNTIME;
|
||||
|
||||
$currentDateTime = new DateTime("NOW");
|
||||
$setOnlineStatement = $RUNTIME['PDO']->prepare("UPDATE regions SET Online = :OnlineStatus, LastSeen = :LastSeen WHERE RegionID = :RegionID");
|
||||
//$setOnlineStatement->debugDumpParams();
|
||||
$setOnlineStatement->execute(array("OnlineStatus" => $online, "RegionID" => $this->RegionID, "LastSeen" => $currentDateTime->format('Y-m-d H:i:s')));
|
||||
|
||||
echo "Set Online State '".$online."' for region ".$this->RegionName;
|
||||
}
|
||||
|
||||
public function getHostname(){
|
||||
return $this->RegionHostname;
|
||||
}
|
||||
|
||||
public function getPort(){
|
||||
return $this->RegionPort;
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue