本文整理汇总了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";