當前位置: 首頁>>代碼示例>>PHP>>正文


PHP misc::getOnlinePlayersCount方法代碼示例

本文整理匯總了PHP中misc::getOnlinePlayersCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::getOnlinePlayersCount方法的具體用法?PHP misc::getOnlinePlayersCount怎麽用?PHP misc::getOnlinePlayersCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在misc的用法示例。


在下文中一共展示了misc::getOnlinePlayersCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

<?php

$data = $core->aConfig;
$hGwStatus = @fsockopen($data['serverIP'], $data['gatewayPort'], $errno, $errstr, 0.3);
$hGsStatus = @fsockopen($data['serverIP'], $data['gamePort'], $errno, $errstr, 0.3);
$hStatuses = array();
$onlineImg = "<img src='img/status/online.gif' />";
$offlineImg = "<img src='img/status/offline.gif' />";
if ($hGwStatus) {
    $hStatuses['gw'] = $onlineImg;
} else {
    $hStatuses['gw'] = $offlineImg;
}
if ($hGsStatus) {
    $hStatuses['gs'] = $onlineImg;
} else {
    $hStatuses['gs'] = $offlineImg;
}
$nOnlinePlayers = misc::getOnlinePlayersCount();
core::$sql->changeDB('acc');
$nAccounts = core::$sql->getRow("select count(*) from TB_User");
$nPlayersMax = core::$sql->getRow("SELECT top 1 nUserCount FROM _ShardCurrentUser WHERE nShardID = '" . $core->aConfig['shardID'] . "' ORDER BY nUserCount desc");
core::$sql->changeDB('shard');
$nChars = core::$sql->getRow("select count(*) from _Char");
$nGuilds = core::$sql->getRow("select count(*) from _Guild");
core::$sql->changeDB('acc');
echo " \r\n\t\t<hr>\r\n\t\t<b> Server info :</b><br/>\r\n\t\t<hr>\r\n\t\tPlayers online: <font color='green'>{$nOnlinePlayers}/{$data['playersLimit']}</font><br/>\r\n\t\tMax online: <font color='green'>{$nPlayersMax}</font><br/>\r\n\t\tExperience rate: <font color='green'>{$data['expRate']}</font><br/>\r\n\t\tParty Experience rate: <font color='green'>{$data['partyExpRate']}</font><br/>\r\n\t\tGold drop coeficent: <font color='green'>{$data['goldDropRate']}</font><br/>\r\n\t\tItem drop coeficent: <font color='green'>{$data['itemDropRate']}</font><br/>\r\n\t\t<hr>\r\n\t\t<b>Status :</b><br/>\r\n\t\t<hr>\r\n\t\tGateway Server: {$hStatuses['gw']}<br/>\r\n\t\tGame Server: {$hStatuses['gs']}<br/>\r\n\t\tAccounts: <font color='green'>{$nAccounts}</font><br/>\r\n\t\tCharacters: <font color='green'>{$nChars}</font><br/>\r\n\t\tGuilds: <font color='green'>{$nGuilds}</font>\r\n\t\t";
開發者ID:EbrahemS,項目名稱:SRCMS,代碼行數:27,代碼來源:stats_menu.php


注:本文中的misc::getOnlinePlayersCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。