Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nonga.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nonga.eemo.co.kr/public_html/www/maonwebsock_93.php
<?php $wshome="/home/nongapp.eemo.co.kr/public_html/www"; require_once($wshome.'/websockets_93.php'); include_once($wshome."/lib.php"); // 로그인단 : ["cardcheck"]|[rfid값][login상태값(0:로그아웃,1:로그인)] // 종료단 : ["finish"]|[rfid값]|[htype]|[맵이름]|[거리]|[칼로리]|[착순]|[사용마일리지]|[획득마일리지]|[이용시간]|[실제운동시간]|[온라인여부(1:온라인,0:로컬)] $testmode=1; $db=mysql_pconnect("localhost","root","web!@#") or die(mysql_error()); mysql_select_db("egg") or die(mysql_error()); class echoServer extends WebSocketServer { //protected $maxBufferSize = 1048576; //1MB... overkill for an echo server, but potentially plausible for other applications. protected $arr=array(); protected function process2 ($user, $mes) { global $WSSERIP; global $wshome; global $testmode; $db=mysql_pconnect("localhost","root","web!@#") or die(mysql_error()); mysql_select_db("egg") or die(mysql_error()); $tmp_message=$mes; $mes=base64_decode($tmp_message); } protected function irnd($tt,$no) { $rnd=rand(1,$tt); if($this->arr[$rnd]>0) { $this->irnd($tt,$no); } else { $this->arr[$rnd]=$no; } } protected function process ($user, $message) { global $WSSERIP; global $wshome; global $testmode; } protected function connected ($user) { /* $db=mysql_connect("218.38.12.119","root","web!@#") or die(mysql_error()); mysql_select_db("tophorsev2") or die(mysql_error()); $rs_c=RS("select * from conf "); if($rs_c[is_s] != '1') { exit; } */ global $WSSERIP; global $wshome; // Do nothing: This is just an echo server, there's no need to track the user. // However, if we did care about the users, we would probably have a cookie to // parse at this step, would be looking them up in permanent storage, etc. //echo "First CON : ".$user->ip." , Sock_ID : ".$user->id."\n"; $db=mysql_pconnect("localhost","root","web!@#") or die(mysql_error()); mysql_select_db("egg") or die(mysql_error()); } protected function closed ($user) { //echo 'CLOSED : '.$user->ip." , Sock_ID : ".$user->id."\n"; // Do nothing: This is where cleanup would go, in case the user had any sort of // open files or other objects associated with them. This runs after the socket // has been closed, so there is no need to clean up the socket itself here. global $WSSERIP; global $wshome; // Do nothing: This is just an echo server, there's no need to track the user. // However, if we did care about the users, we would probably have a cookie to // parse at this step, would be looking them up in permanent storage, etc. //echo "First CON : ".$user->ip." , Sock_ID : ".$user->id."\n"; } protected function closed2 ($user) { } protected function wupdate(){ global $WSSERIP; global $wshome; global $testmode; } } $echo = new echoServer("0.0.0.0","29000"); try { $echo->run(); } catch (Exception $e) { $echo->stdout($e->getMessage()); }