웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
카일레라 서버 페이지 만들기.
2003.12.09 18:24
http://www.kaillera.com에뮬 멀티할때 접속하는 카일레라 서버의 상태 페이지를 만들어 봅시다. 'w'
카일레라 서버는 링크1에 있습니다.
--------------------------------------------------------------------
<pre>
<?php
$_ip="192.168.0.1:27888"; // 자신의 ip와 포트 번호로 수정합니다.
$file=@file("http://".$_ip."/?page=status");
if($file) {
echo "서버 상태(status): <font color=blue>가동중.(online)</font>nn";
$uptime=$file[3]; $uptime=str_replace("uptime:","",$uptime);
$uptime=str_replace("seconds","",$uptime); $uptime=trim($uptime);
$stamp=explode(".",$uptime);
$days=(int)($stamp[0]/86400);
$stamp[0]-=$days*86400;
$hrs=(int)($stamp[0]/3600);
$stamp[0]-=$hrs*3600;
$mins=(int)($stamp[0]/60);
$stamp[0]-=$mins*60;
$secs=(int)($stamp[0]);
echo "가동 시간(uptime): ".$days." days ".$hrs." hours ".$mins." min ".$secs." secs ".$stamp[1]." microsecs.n";
$clients=$file[5]; $clients=trim(str_replace("# clients:","",$clients));
echo "접속자(clients): ".$clients." 명n";
$games=$file[6]; $games=trim(str_replace("# games:","",$games));
echo "개설된 게임(games): ".$games." 개n";
echo"</pre>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
echo"<caption><font size=3 face="Tahoma"><b>Client List</b></font></caption>n";
echo"<tr><th>No</th><th>Name</th><th>Client</th><th>Connection</th><th>Status</th></tr>n";
for($i=10;$i<$clients+10;$i++) {
$j++;
$temp=explode("t",$file[$i]);
echo"<tr><td> ".$j." </td><td> ".$temp[0]." </td><td> ".$temp[1]." </td><td> ".$temp[2]." </td><td> ".$temp[3]." </td></tr>n";
} $j=0;
echo"</table>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
echo"<caption><font size=3 face="Tahoma"><b>Games List</b></font></caption>n";
echo"<tr><th>No</th><th>Title</th><th>Users</th><th>Status</th></tr>n";
for($i=$clients+13;$i<$clients+13+$games;$i++) {
$j++;
$temp=explode("t",$file[$i]);
echo"<tr><td>".$j."</td><td>".$temp[0]."</td><td>".$temp[1]."</td><td>".$temp[2]."</td></tr>n";
}
echo"</table>";
} else echo"서버 상태(status): <font color=red>정지.(offline)</font>n</pre>";
?>
카일레라 서버는 링크1에 있습니다.
--------------------------------------------------------------------
<pre>
<?php
$_ip="192.168.0.1:27888"; // 자신의 ip와 포트 번호로 수정합니다.
$file=@file("http://".$_ip."/?page=status");
if($file) {
echo "서버 상태(status): <font color=blue>가동중.(online)</font>nn";
$uptime=$file[3]; $uptime=str_replace("uptime:","",$uptime);
$uptime=str_replace("seconds","",$uptime); $uptime=trim($uptime);
$stamp=explode(".",$uptime);
$days=(int)($stamp[0]/86400);
$stamp[0]-=$days*86400;
$hrs=(int)($stamp[0]/3600);
$stamp[0]-=$hrs*3600;
$mins=(int)($stamp[0]/60);
$stamp[0]-=$mins*60;
$secs=(int)($stamp[0]);
echo "가동 시간(uptime): ".$days." days ".$hrs." hours ".$mins." min ".$secs." secs ".$stamp[1]." microsecs.n";
$clients=$file[5]; $clients=trim(str_replace("# clients:","",$clients));
echo "접속자(clients): ".$clients." 명n";
$games=$file[6]; $games=trim(str_replace("# games:","",$games));
echo "개설된 게임(games): ".$games." 개n";
echo"</pre>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
echo"<caption><font size=3 face="Tahoma"><b>Client List</b></font></caption>n";
echo"<tr><th>No</th><th>Name</th><th>Client</th><th>Connection</th><th>Status</th></tr>n";
for($i=10;$i<$clients+10;$i++) {
$j++;
$temp=explode("t",$file[$i]);
echo"<tr><td> ".$j." </td><td> ".$temp[0]." </td><td> ".$temp[1]." </td><td> ".$temp[2]." </td><td> ".$temp[3]." </td></tr>n";
} $j=0;
echo"</table>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
echo"<caption><font size=3 face="Tahoma"><b>Games List</b></font></caption>n";
echo"<tr><th>No</th><th>Title</th><th>Users</th><th>Status</th></tr>n";
for($i=$clients+13;$i<$clients+13+$games;$i++) {
$j++;
$temp=explode("t",$file[$i]);
echo"<tr><td>".$j."</td><td>".$temp[0]."</td><td>".$temp[1]."</td><td>".$temp[2]."</td></tr>n";
}
echo"</table>";
} else echo"서버 상태(status): <font color=red>정지.(offline)</font>n</pre>";
?>
댓글 2
제목 | 글쓴이 | 날짜 |
---|---|---|
(회원정보) 보기 페이지에서 포인트 변경하기
[4]
![]() | Simulz | 2007.11.28 |
윈도우 라이브 메신저를 홈페이지 서명난에 달자
[1]
![]() | Diver | 2007.11.26 |
배경이미지기능으로 페이지꾸미기
[3]
![]() | 팔공산 | 2007.11.23 |
간편해진 페이지 수정법
![]() | coll | 2007.11.16 |
관리자 페이지 모듈->댓글 내용에 & " < > 안 나오게 하기 [1] | 必得力 | 2007.10.18 |
홈페이지 주소 깔끔하게 사용하기 [초보용] [14] | 똑디 | 2007.10.13 |
페이지에 설문 조사 넣기 [2] | 지허 | 2007.10.01 |
메인 페이지 링크 www. 주소 표시, 로그인 링크 문제.... [5] | 마덴나 | 2007.09.08 |
페이지수정 안되시는 분들께 드리는 팁 [2] | 다케루 | 2007.08.30 |
홈페이지에 게시판을 iframe, include로 이용하시는분들 | 느까끼 | 2007.08.27 |
w3c.org의 웹페이지 유효성 검사기
![]() | 바람처럼831 | 2007.08.24 |
홈페이지 주소 고정시키기
[12]
![]() | :에반: | 2007.08.21 |
페이지 수정시 메뉴들 가지런히 놓이게 하기 [3] | 팔공산 | 2007.08.21 |
404 페이지 못찾음으로 나오는 문제 수정 [9] | 화니군 | 2007.08.18 |