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


PHP Server::getServerList方法代码示例

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


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

示例1: GenerateCSV

function GenerateCSV()
{
    $servers = Server::getServerList();
    $output = "";
    foreach ($servers as $s) {
        //Write server values into a line (separated by tabs)
        $output .= $s->getPublicKey() . "\t";
        $output .= $s->getName() . "\t";
        $output .= $s->getMotd() . "\t";
        $output .= $s->getPort() . "\t";
        $output .= $s->getAddress() . "\t";
        $output .= $s->getVersion() . "\t";
        $output .= $s->getUserCount() . "\t";
        $output .= $s->getMaxClients() . "\t";
        $output .= $s->getGameMode() . "\t";
        $output .= $s->getUserList() . "\n";
        //Terminate server entry using line break
    }
    return $output;
}
开发者ID:joshi1999,项目名称:manicdigger_website,代码行数:20,代码来源:csv.php

示例2: DateTime

			</div>
<?php 
}
?>
			<h1 class="is-center">Manic Digger Online Servers</h1>
			<div class="pure-g serverlist">
<?php 
require_once "classes/Utility.php";
require_once "classes/Server.php";
$loggedIn = false;
$username = null;
if (isset($_SESSION["user_name"])) {
    $username = $_SESSION["user_name"];
    $loggedIn = true;
}
$servers = Server::getServerList();
$now = new DateTime();
foreach ($servers as $s) {
    $link = "md://" . htmlspecialchars($s->getAddress()) . ":" . htmlspecialchars($s->getPort()) . "/?";
    if ($loggedIn) {
        $link .= "user=" . urlencode($username) . "&auth=" . urlencode(md5($s->getPrivateKey() . $username)) . "&";
    }
    $link .= "serverPassword=" . $s->getPasswordProtected();
    $heartbeat = new DateTime($s->getLastHeartbeatDate());
    $dateDiff = $now->diff($heartbeat);
    $timeDiff = $now->getTimestamp() - $heartbeat->getTimestamp();
    $offline = false;
    if ($timeDiff > 300) {
        $offline = true;
    }
    ?>
开发者ID:joshi1999,项目名称:manicdigger_website,代码行数:31,代码来源:content_servers.php

示例3: assignVariables

 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign('serverList', Server::getServerList());
 }
开发者ID:Evil-Co-Legacy,项目名称:Bash-Database,代码行数:5,代码来源:ServerListPage.class.php

示例4: readData

 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->serverList = Server::getServerList();
 }
开发者ID:Evil-Co-Legacy,项目名称:Bash-Database,代码行数:8,代码来源:BashEntryAddForm.class.php


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