当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::setAllowGuests方法代码示例

本文整理汇总了PHP中Server::setAllowGuests方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::setAllowGuests方法的具体用法?PHP Server::setAllowGuests怎么用?PHP Server::setAllowGuests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server的用法示例。


在下文中一共展示了Server::setAllowGuests方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ServerPulse

function ServerPulse()
{
    $server = new Server();
    //Get server address
    $server->setAddress($_SERVER['REMOTE_ADDR']);
    //Grab input
    $server->setPort($_REQUEST["port"]);
    $server->setName($_REQUEST["name"]);
    $server->setVersion($_REQUEST["version"]);
    $server->setPrivateKey($_REQUEST["fingerprint"]);
    $server->setMaxClients($_REQUEST["max"]);
    $server->setPublic($_REQUEST["public"]);
    $server->setPasswordProtected($_REQUEST["passwordProtected"]);
    $server->setAllowGuests($_REQUEST["allowGuests"]);
    $server->setUserCount($_REQUEST["users"]);
    $server->setUserList($_REQUEST["players"]);
    $server->setMotd($_REQUEST["motd"]);
    $server->setGameMode($_REQUEST["gamemode"]);
    //Update (or create) server record
    return Server::updateServer($server);
}
开发者ID:joshi1999,项目名称:manicdigger_website,代码行数:21,代码来源:heartbeat.php

示例2: getServerList

 public static function getServerList()
 {
     //Grab connection object
     $mysqli = Utility::getSQLConnection();
     $sql = "SELECT server_id, address, port, version, name, private_key, key_hash, ";
     $sql .= "max_clients, public, password_protected, allow_guests, user_count, ";
     $sql .= "user_list, motd, game_mode, last_heartbeat_date, created_date ";
     $sql .= "FROM servers ";
     $sql .= "WHERE last_heartbeat_date > (NOW() - INTERVAL 8 HOUR) ";
     $sql .= "ORDER BY last_heartbeat_date DESC";
     //Prepare query to find server
     $stmt = $mysqli->prepare($sql);
     if ($mysqli->errno) {
         trigger_error($mysqli->error, E_USER_ERROR);
     }
     //Run query
     $stmt->execute();
     if ($mysqli->errno) {
         $stmt->close();
         unset($stmt);
         trigger_error($mysqli->error, E_USER_ERROR);
     }
     $stmt->bind_result($serverId, $address, $port, $version, $name, $privateKey, $keyHash, $maxClients, $public, $passwordProtected, $allowGuests, $userCount, $userList, $motd, $gameMode, $lastHeartbeatDate, $createdDate);
     $serverList = array();
     while ($stmt->fetch()) {
         $server = new Server();
         //Fill server object
         $server->setServerId($serverId);
         $server->setAddress($address);
         $server->setPort($port);
         $server->setVersion($version);
         $server->setName($name);
         $server->setPrivateKey($privateKey);
         $server->setPublicKey($keyHash);
         $server->setMaxClients($maxClients);
         $server->setPublic($public);
         $server->setPasswordProtected($passwordProtected);
         $server->setAllowGuests($allowGuests);
         $server->setUserCount($userCount);
         $server->setUserList($userList);
         $server->setMotd($motd);
         $server->setGameMode($gameMode);
         $server->setLastHeartbeatDate($lastHeartbeatDate);
         $server->setCreatedDate($createdDate);
         $serverList[] = $server;
     }
     $stmt->close();
     unset($stmt);
     return $serverList;
 }
开发者ID:joshi1999,项目名称:manicdigger_website,代码行数:50,代码来源:Server.php


注:本文中的Server::setAllowGuests方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。