웹마스터 팁
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>";
?>
제목 | 글쓴이 | 날짜 |
---|---|---|
쉘 명령어 사용하기 [11] | 9000㎒ | 2003.12.02 |
세션을 이용한 관리자 모드 구축하기 1강(중복?) | 박정호 | 2003.12.09 |
세션을 이용한 관리자 모드 구축하기 2강 [6] | 박정호 | 2003.12.09 |
세션을 이용한 관리자 모드 구축하기 3강 [6] | 박정호 | 2003.12.09 |
DB에서 받은 데이터 배열로 하나씩 뿌리기 | LetMeLove | 2003.12.09 |
편법을 이용한 inlive 방송여부 체크 [7] | 심심타 | 2003.12.09 |
카일레라 서버 페이지 만들기. [2] | teslaMINT | 2003.12.09 |
[제로카운터] 자동으로 DB를 지우자. (IP와 referer 5일 분량만 남기기) [4] | 이주경 | 2003.12.17 |
나도 @ 도메인 서비스를 해보자 [29] | 김병철 | 2003.12.19 |
[MySQL] Set 형 자료형.. [3] | 서영태 | 2003.12.24 |
일정시간 이 지난 게시물 정리하기.. [3] | 명동욱 | 2003.12.24 |
GET으로 받는 변수가 하나일 때, 주소?변수값 사용하기 [5] | 버찌 | 2004.01.05 |
[팁&테크] 텍스트파일에서 디비 입력하기. [1] | 김영진 | 2004.01.09 |
include에서 Failed opening 발생문제 [4] | 이경훈 | 2004.01.10 |
unset / isset 를 알아보자. [2] | 씨파개 | 2004.01.12 |
제로보드 인크루드시 $DOCUMENT_ROOT 참조 [7] | 이경훈 | 2004.01.14 |
제로카운터 쉽게 설치하기 [26] | 대류 | 2004.01.17 |
(중복) 개인서버 운영하시는분들.. 좋은소스? [14] | SeePaGae | 2004.01.22 |
아이피를 숨겨보자 [5] | SeePaGae | 2004.01.23 |
[초허접기초!!] PHP 가 무엇인고..?? 1탄.. [6] | SeePaGae | 2004.01.24 |
php 기본도 모르는지라 이런팁이 매우 소중한... 하드안에 소중히 모셔놔야겠네여 ^^ 감사