웹마스터 팁
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>";
?>
제목 | 글쓴이 | 날짜 |
---|---|---|
[iframe:아이프레임] 내용에 맞게 사이즈 조절하기 한번입력으로 끝.[다른방법:중복아닌듯] [45] | beMax | 2004.04.23 |
(For 초보)원클릭으로 여러프레임 컨트롤하기 [2] | 쉬드 | 2004.04.19 |
자기가 살아온 시간 구하기.. 데스크탑에 나타내기 [4] | kein23 | 2004.04.14 |
브라우저 버젼별 다른 페이지 보여주기 [2] | Kuldahar | 2004.04.13 |
바보같은 MS의 parseInt 버그. [4] | 김관석 | 2004.04.09 |
XP계열의 방문자 컴에서 ClearType 효과 사용여부 확인 [4] | YeUPy | 2004.04.04 |
팝업공지창 2개이상 띄우기(시간제한 가능) [8] | lemin | 2004.03.23 |
허접한 풀다운 메뉴 소스입니다. (유용한 팁 일지는 모르겠네요.) [9] | tintintm | 2004.03.23 |
버튼 만들기 [1] | 旻天 | 2004.03.23 |
MS agent online object - Default Character 인 Merlin Action 추가 [2] | 꽃ちゃん | 2004.03.19 |
움직이는 타이틀바 [4] | 김동현 | 2004.03.18 |
웹브라우저 상태바가 밑으로 내려오는 소스 [5] | 프리서버 | 2004.03.16 |
브라우져(윈도우) 창의 크기(사이즈)를 조절하는 소스입니다 [5] | 나야 | 2004.03.15 |
프레임사이트에서 자식 프레임(URL)로 직접 치고 들어 올경우 다시 프레임 부모로 돌려보내는 소스 | 나야 | 2004.03.15 |
전체 include menu 만들기(롤오버 이미지 사용) [4] | Neoyoung | 2004.03.14 |
[초간단 자바스크립트!] 서브메뉴 만들기...~ [11] | ∑Ztxy | 2004.03.10 |
뉴스티커 [16] | zero | 2004.03.10 |
보안문서 만들기 [5] | 민우주 | 2004.03.07 |
팝업 창 띄우고 어미창 사라지게 하는 소스 [5] | piasol | 2004.03.06 |
방문자 OS보여주기 [5] | 구조반 | 2004.03.05 |
php 기본도 모르는지라 이런팁이 매우 소중한... 하드안에 소중히 모셔놔야겠네여 ^^ 감사