웹마스터 팁
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>";
?>
제목 | 글쓴이 | 날짜 |
---|---|---|
Whois를 이용해서 접속자가 사용하는 ISP출력(한국통신,하나로,두루넷 등등) [6] | 김재경 | 2003.09.23 |
내 홈페이지의 방문자 어디서 접속했을까 알아봅시다 [21] | 버찌소년 | 2003.10.08 |
알기쉬운 웹용 MySQL 관리도구, phpMyAdmin 설치하기 [10] | 허창원 | 2003.10.11 |
공지사항|일기장 4강 - notice.php 간단한 글보이기 | 시루바 | 2003.10.16 |
include, onload, <span id=...> 다계층메뉴 활용 강좌 [2] | 김병희 | 2003.10.25 |
홈페이지 관리자 모드 구축하기 (HTTP 인증, 중복 맞음) [10] | 9000㎒ | 2003.11.01 |
지금은 시스템 점검중 만들기... [8] | zentoo.com | 2003.11.11 |
회원 포인트 랭킹(중복 -_-a) [4] | weky | 2003.11.15 |
한꼬마의 제로보드 활용방법 (로그인 값 알아 보기) [3] | 한꼬마 | 2003.11.20 |
한꼬마의 제로보드 이용법 (sql로 테이블 호출) [2] | 한꼬마 | 2003.11.26 |
throttle-me를 이용한 계정 트래픽 나타내기 [39] | 旻天 | 2003.11.27 |
랜덤 배경음악 만들기. [6] | 폭주나루 | 2003.12.01 |
세션을 이용한 관리자 모드 구축하기 1강(중복?) | 박정호 | 2003.12.09 |
세션을 이용한 관리자 모드 구축하기 2강 [6] | 박정호 | 2003.12.09 |
세션을 이용한 관리자 모드 구축하기 3강 [6] | 박정호 | 2003.12.09 |
카일레라 서버 페이지 만들기. [2] | teslaMINT | 2003.12.09 |
나도 @ 도메인 서비스를 해보자 [29] | 김병철 | 2003.12.19 |
[팁&테크] 텍스트파일에서 디비 입력하기. [1] | 김영진 | 2004.01.09 |
include에서 Failed opening 발생문제 [4] | 이경훈 | 2004.01.10 |
unset / isset 를 알아보자. [2] | 씨파개 | 2004.01.12 |
php 기본도 모르는지라 이런팁이 매우 소중한... 하드안에 소중히 모셔놔야겠네여 ^^ 감사