EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Feature Requests (https://www.eqemulator.org/forums/forumdisplay.php?f=612)
-   -   Users online php script . (https://www.eqemulator.org/forums/showthread.php?t=17806)

mwmdragon 08-08-2005 06:31 PM

php
 
Yeah PHP would be nice ;)

SuedeWorthey 08-09-2005 06:51 AM

Quote:

Originally Posted by mwmdragon
Yeah PHP would be nice ;)

I am working on a port now... Just gotta figure out all the authentication stuff...

sdabbs65 08-11-2005 05:52 AM

telnet
 
Quote:

Originally Posted by SuedeWorthey
I am working on a port now... Just gotta figure out all the authentication stuff...

I heard the telnet feature was disabled years ago...
it may still be in the source somewhere tho <shrug>..

SuedeWorthey 08-11-2005 09:48 AM

Quote:

Originally Posted by sdabbs65
I heard the telnet feature was disabled years ago...
it may still be in the source somewhere tho <shrug>..

Are you talking about in the World.exe or in PHP? I know telnet doesn't exist in PHP, and the wanna-be telnet class I downloaded sucks ass... Yeah, I always have to re-write everything... But it's still enabled in world.

sdabbs65 08-11-2005 03:49 PM

World.exe
 
Quote:

Originally Posted by SuedeWorthey
Are you talking about in the World.exe or in PHP? I know telnet doesn't exist in PHP, and the wanna-be telnet class I downloaded sucks ass... Yeah, I always have to re-write everything... But it's still enabled in world.

Well when I tryed it in World.exe it's in duplex and never works...
password never is acepted...
there is a ppm to download,it seems to work ok for other things.
but never got it to work for this item.

wize_one 08-11-2005 05:25 PM

you have to set a md5 password in your database per user you want to allow telnet to world.. we use it for some of our stuff.. thats what the password field is for in the accounts_ table(if i recall right)

sdabbs65 08-15-2005 07:51 AM

yup
 
Quote:

Originally Posted by wize_one
you have to set a md5 password in your database per user you want to allow telnet to world.. we use it for some of our stuff.. thats what the password field is for in the accounts_ table(if i recall right)

I got the password in and it connects but still refuses to allow log in hmmm.
.. im thinking maybe it's not enabled in command line functions in world.exe
or maybe a value in vars im missing,checking the source now.

back to the lab.

wize_one 08-15-2005 08:02 AM

telnet serverip:9000 login name: LoginserverName password: MD5Password
then,
echo off
acceptmessages on
and you should be at the world shell.. might have to open port 9000

Cisyouc 08-16-2005 12:41 PM

telnet in world does work, for sure.
I have had some trouble in the past with puTTY, don't know why.

sdabbs65 08-18-2005 12:21 AM

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.

Magoth78 08-21-2005 01:55 AM

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

sdabbs65 08-23-2005 01:06 PM

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 -

Magoth78 08-24-2005 03:49 AM

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

sdabbs65 08-25-2005 06:43 AM

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...

Magoth78 08-25-2005 11:08 AM

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);
                                      }
                               
                        }
?>



All times are GMT -4. The time now is 09:04 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.