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


PHP Server::setPort方法代码示例

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


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

 function getServerGroups()
 {
     $sql = "SELECT server_group_id, group_name, description FROM gban_server_group ORDER BY group_name ASC";
     $this->db->sql_query($sql);
     $groups = $this->db->get_array();
     $serverGroups = array();
     for ($i = 0; $i < count($groups); $i++) {
         $serverGroup = new ServerGroup();
         $serverGroup->setId($groups[$i]['server_group_id']);
         $serverGroup->setName(stripslashes($groups[$i]['group_name']));
         $serverGroup->setDescription(stripslashes($groups[$i]['description']));
         // Determine the servers associated with this server group
         if ($serverGroup->getId() != null) {
             $serversQuery = "SELECT server_id, name, ip, port, type, plugin\r\n                         FROM gban_servers\r\n                         WHERE server_group_id = '" . $serverGroup->getId() . "'\r\n                         ORDER BY server_id";
             $this->db->sql_query($serversQuery);
             $servers = $this->db->get_array();
             $serverList = array();
             for ($j = 0; $j < count($servers); $j++) {
                 $server = new Server();
                 $server->setId($servers[$j]['server_id']);
                 $server->setName(stripslashes($servers[$j]['name']));
                 $server->setIp($servers[$j]['ip']);
                 $server->setPort($servers[$j]['port']);
                 $server->setType($servers[$j]['type']);
                 $server->setPlugin($servers[$j]['plugin']);
                 array_push($serverList, $server);
                 // Add the server object to the array
             }
             $serverGroup->setServers($serverList);
         }
         // Done getting servers associated with this server group
         array_push($serverGroups, $serverGroup);
         // Add the server object to the array
     }
     return $serverGroups;
 }
开发者ID:googlecode-mirror,项目名称:globalban-spanish,代码行数:36,代码来源:class.ServerQueries.php

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