当前位置: 首页>>代码示例>>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;未经允许,请勿转载。