コード例 #1
0
 public function __construct($id, $row = null)
 {
     if ($id != -1 && GameserverManager::ExistsById($id)) {
         // Check
         if (null != $row) {
             $this->Data = $row;
         } else {
             $con = Database::getCon();
             $res = $con->query("SELECT * FROM gameserver WHERE id = {$id}") or die(mysqli_error($con));
             $this->Data = $res->fetch_array();
             $this->Data["settings"] = json_decode($this->Data["settings"], true);
             unset($this->Data["settings"][0]);
             $this->initDataObject("gameserver", "id", $id);
         }
     } else {
         die("tried to create gameserver with no valid id");
     }
 }
コード例 #2
0
ファイル: User.class.php プロジェクト: xerox8521/FS-Gamepanel
 public function setSelectedGameserver($gameserver)
 {
     if ($gameserver != null) {
         if (GameserverManager::ExistsById($gameserver->getData("id"))) {
             if ($gameserver->getOwnerId() == $this->getData("id")) {
                 $_SESSION["gameserver"] = $gameserver->getData("id");
             } else {
                 $_SESSION["gameserver"] = INVALID_ID;
             }
         } else {
             $_SESSION["gameserver"] = INVALID_ID;
         }
     } else {
         $_SESSION["gameserver"] = INVALID_ID;
     }
 }