|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Feature Requests Post suggestions/feature requests here. |

08-16-2005, 12:41 PM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
telnet in world does work, for sure.
I have had some trouble in the past with puTTY, don't know why.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|

08-18-2005, 12:21 AM
|
Dragon
|
|
Join Date: Dec 2003
Location: Earth
Posts: 818
|
|
y
Quote:
Originally Posted by Cisyouc
telnet in world does work, for sure.
I have had some trouble in the past with puTTY, don't know why.
|
yeah im useing putty...thats probbly the problem.
|
 |
|
 |

08-21-2005, 01:55 AM
|
Discordant
|
|
Join Date: Jun 2003
Posts: 345
|
|
Number of users online, their names and the number, using php.
It's my first Php code so don't be rude if it's extremly ugly, basic.
It will show the name and the amount of the connected characters char.
Code:
<?php
$Server = 'Host.com';
$Port = 9000;
$user = "your_user\r";
$pass = "your_pass\r";
$fp = fsockopen($Server, $Port);
fputs ($fp, $user);
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
fputs ($fp, "who\r");
usleep(125000);
do
{
$output = fgets($fp);
$output = str_replace("Username: Password: Login accepted.", "", $output);
$output = str_replace($user">", "", $output);
$output = str_replace("who", "", $output);
$output = str_replace("Players", "", $output);
$output = str_replace("on", "", $output);
$output = str_replace("server:", "", $output);
$output = str_replace("line", "", $output);
$who = preg_replace('#^.*]\s+(.*?)\(.*$#','\1',$output);
echo $who;
if (preg_match("/Players/i", $who)) {
Break;
}
}
while(!feof($fp));
fclose($fp);
?>
Mag
Last edited by Magoth78; 08-23-2005 at 08:03 AM..
|
 |
|
 |
 |
|
 |

08-23-2005, 01:06 PM
|
Dragon
|
|
Join Date: Dec 2003
Location: Earth
Posts: 818
|
|
hmmm
Quote:
Originally Posted by Magoth78
Number of users online, their names and the number, using php.
It's my first Php code so don't be rude if it's extremly ugly, basic.
It will show the name and the amount of the connected characters char.
Code:
<?php
$Server = 'Host.com';
$Port = 9000;
$user = "your_user\r";
$pass = "your_pass\r";
$fp = fsockopen($Server, $Port);
fputs ($fp, $user);
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
fputs ($fp, "who\r");
usleep(125000);
do
{
$output = fgets($fp);
$output = str_replace("Username: Password: Login accepted.", "", $output);
$output = str_replace($user">", "", $output);
$output = str_replace("who", "", $output);
$output = str_replace("Players", "", $output);
$output = str_replace("on", "", $output);
$output = str_replace("server:", "", $output);
$output = str_replace("line", "", $output);
$who = preg_replace('#^.*]\s+(.*?)\(.*$#','\1',$output);
echo $who;
if (preg_match("/Players/i", $who)) {
Break;
}
}
while(!feof($fp));
fclose($fp);
?>
Mag
|
All I get is a blank...
error msg says ..
xx.xx.xx.xxx - - [23/Aug/2005:20:32:47 -0400] "GET /who.php HTTP/1.1" 200 -
|
 |
|
 |

08-24-2005, 03:49 AM
|
Discordant
|
|
Join Date: Jun 2003
Posts: 345
|
|
Change this line :
Code:
$output = str_replace($user">", "", $output);
to
Code:
$output = str_replace("your_user>", "", $output);
You just have to edit "your_user".
Mag
|

08-25-2005, 06:43 AM
|
Dragon
|
|
Join Date: Dec 2003
Location: Earth
Posts: 818
|
|
hmm
Quote:
Originally Posted by Magoth78
Change this line :
Code:
$output = str_replace($user">", "", $output);
to
Code:
$output = str_replace("your_user>", "", $output);
You just have to edit "your_user".
Mag
|
$output = str_replace("your_user>", "", $output);
when I take out this line I get a return...
sdabbs65> Tailwind Kash Godenex Ydradi 4 players
when it's placed back in I get a empty screen...
|

08-25-2005, 11:08 AM
|
Discordant
|
|
Join Date: Jun 2003
Posts: 345
|
|
Ah yeah, if you don't want to have the characters name in the ouput, and just the number of connected players, you should use my simple script:
Code:
<?php
$Server = 'Host.com';
$Port = 9000;
$user = "your_user\r";
$pass = "your_pass\r";
$fp = fsockopen($Server, $Port);
fputs ($fp, $user);
//echo("Login Accepted\r\n");
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
//echo("Password Accepted\r\n");
fputs ($fp, "who\r");
usleep(125000);
//echo("Who launched\r\n");
while (!feof($fp))
{
$ret = fgets($fp, 128);
if (ereg("players", $ret)){
$ret = ereg_replace("players online","",$ret);
echo "$ret \n";
break;
fclose($fp);
}
}
?>
Last edited by Magoth78; 08-25-2005 at 07:12 PM..
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 07:46 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |