99Game 模拟器研究 Ascent 's Archiver

随缘悟性 发表于 2007-11-30 21:54

在网页上显示服务器状态PHP源码

**** Hidden Message *****

艾森尼 发表于 2007-11-30 22:02

正解~ [s:14]

随缘悟性 发表于 2007-11-30 22:09

能显示在线人数

艾森尼 发表于 2007-12-1 04:41

[quote]引用第2楼随缘悟性于2007-11-30 22:09发表的 :
能显示在线人数[/quote]

这个PHP 不能显示在线人数的
只是通过 fsockopen() 连接 8085 端口
来判断游戏服务是否开启

zbnzbn 发表于 2007-12-1 06:47

看看的说,是什么东西撒

rsh012 发表于 2007-12-1 11:01

这个东西也不错,试试

woaikeke241 发表于 2007-12-1 16:00

AS默认不是8085的....

kkkwf 发表于 2007-12-1 17:33

关注一下

question 发表于 2007-12-1 20:02

再度关注一下

caixiaoxi 发表于 2007-12-2 00:24

在网页上显示服务器状态PHP源码 是中文的吗??

rumblemomo 发表于 2007-12-2 23:23

非常好的东西

whitehack 发表于 2007-12-3 15:45

看一下.3Q

whitehack 发表于 2007-12-3 15:53

我也共享一下我的
这个是config.php的 同时自己可以添加 多个服务器的IP和端口
[code]//-- --------------登陆服务器的IP-------------------------------------------------------- --//
$config_realmdip=    "127.0.0.1";
//-- -------------------------------------------------------------------------------- --//
//-- --------------游戏服务器的IP------------------------------------------------------- --//
$config_mangosdip=    "127.0.0.1";

//-- -------------------------------------------------------------------------------- --//
//-- --------------登陆服务器的端口------------------------------------------------------ --//
$config_realmdport=    "3724";
//-- -------------------------------------------------------------------------------- --//
//-- --------------游戏服务器的端口----------------------------------------------------- --//
$config_mangosdport=  "8085";[/code]

下面是调用代码
[code]       <?PHP
include(&#39;config.php&#39;);
echo "
  <table width=&#39;150&#39; border=&#39;0&#39; cellspacing=&#39;0&#39; cellpadding=&#39;0&#39;>
  <!-- 服务器状态-开始 -->";
  error_reporting(0);
  $IP = array("登陆服务器:" => "".$config_realmdip.":".$config_realmdport."","游戏服务器:" => "".$config_mangosdip.":".$config_mangosdport."",);
  while(list($ServerName,$Host)=each($IP)) {
  list($IPAddress,$Port)=explode(":",$Host);
  echo("<tr><TD align=&#39;left&#39; width=&#39;180&#39;>".$ServerName."</TD><TD align=&#39;left&#39; width=&#39;57&#39;>");
  if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
  echo("<font color=&#39;#336699&#39;>在线</font>");
  fclose($fp);
  }else{
  echo("<font color=&#39;#FF0000&#39;>离线</font>");
  }
  echo ("</TD></TR>");
  }
  echo ("<tr><TD align=&#39;left&#39; width=&#39;180&#39;>服务器版本:</TD><TD align=&#39;left&#39; width=&#39;57&#39;><font color=&#39;#6a7f9a&#39;>2.2.3</font></TD></TR>");
echo "  <!-- 服务器状态-结束 -->
  </table>
";

?>[/code]
可以直接建立个xx.php 或者插入调用网页里

zbnzbn 发表于 2007-12-4 14:43

这个要留着的,哈哈

ntcjx 发表于 2007-12-5 14:22

好东西 路过

goo123456 发表于 2007-12-9 17:17

看看~~~

................

ray 发表于 2007-12-9 22:15

这个PHP 不能显示在线人数的
只是通过 fsockopen() 连接 8085 端口
来判断游戏服务是否开启

neo 发表于 2007-12-11 15:32

[url]http://210.ce.net.cn/yb/gihc/http://210.ce.net.cn/yb/gihc/[/url]

jimzhang 发表于 2007-12-27 11:35

同时来看看。。。。。。。

karlson 发表于 2007-12-27 22:38

[s:11] [s:11]

mrhts 发表于 2007-12-27 23:54

[s:14] [s:14] [s:14] [s:14] [s:14] [s:14]

9551004225 发表于 2007-12-28 15:58

顶LZ和LS的~~~~

janglc 发表于 2008-1-3 14:49

eeeeeeeeeeeeeeeeeee

andyme 发表于 2008-1-3 16:30

[s:12] [s:12] [s:12]

seery 发表于 2008-1-7 20:54

看看 ?

kofzyb 发表于 2008-1-8 00:39

[s:12] [s:11] [s:10]

zciker 发表于 2008-1-10 09:48

[s:17] [s:17] [s:17] [s:51] [s:51]

ricky410 发表于 2008-1-10 12:36

looooooooooooooooooooooooooooook

liuyang999 发表于 2008-1-16 03:31

能显示在线人数

tianri 发表于 2008-1-16 15:40

看看。。学习学习。。xiexie

页: [1] 2 3 4 5 6

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.