Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2005, 06:25 PM
sdabbs65
Dragon
 
Join Date: Dec 2003
Location: Earth
Posts: 818
Default Users online php script .

Dunno nothing about how this.
Just an Idea, I would like to see a php script that could tell me how many users are online and the locations,kinda like the runuo emulator has.
it is even possable ?

--------------------------------------------------------

edit...ah nevermind i think I found it in a old thread...


<?php
$server = "localhost";
$username = "root";
$password = "xxxxxxx";
$dbname = "eq";

$link = mysql_pconnect($server,$username,$password);
mysql_select_db($dbname, $link);

$sql = "SELECT zonename, profile FROM character_";
$result = mysql_query($sql);

echo "<table border=\"0\" width=\"100%\">\n";
echo "<th>Name</th>\n";
echo "<th>Zone Name</th>\n";
echo "<th>Gender</th>\n";
echo "<th>Race</th>\n";
echo "<th>Level</th>\n";
echo "<th>Bind</th>\n";
while ($row = mysql_fetch_array($result)) {
$zonename = $row["zonename"];
$profile = $row["profile"];
$alt_adv = $row["alt_adv"];
$profileinfo = unpack("Lchecksum/a64firstname/a32lastname/Lgender/Lrace/Lclass/Lunknown/Llevel/Lzoneid/fbindx/fbindy/fbindz", $profile);

$firstname = $profileinfo["firstname"];
$lastname = $profileinfo["lastname"];
$gender = $profileinfo["gender"];
$race = $profileinfo["race"];
$class = $profileinfo["class"];
$level = $profileinfo["level"];
$zoneid = $profileinfo["zoneid"];
$bindx = $profileinfo["bindx"];
$bindy = $profileinfo["bindy"];
$bindz = $profileinfo["bindz"];
$bind = "$bindx, $bindy, $bindz";
$id++;


if ($gender == 0) {
$gender = "male";
} elseif ($gender == 1) {
$gender = "female";
}

echo "<tr>\n";
echo " <td align=center>$firstname $lastname</td>\n";
echo " <td align=center>$zonename ($zoneid)</td>\n";
echo " <td align=center>$gender</td>\n";
echo " <td align=center>$race</td>\n";
echo " <td align=center>$level</td>\n";
echo " <td align=center>$bind</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
?>
__________________
hosting Eqemu/Runuo/wow Emulators.

www.cheaterz.info

Last edited by sdabbs65; 02-02-2005 at 02:28 AM..
Reply With Quote
  #2  
Old 02-02-2005, 06:01 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

that actually just gives you stats, wether they are logged in or not.
To detect active connections, you would prolly have to telnet to the world console and ask it for a who.
Reply With Quote
  #3  
Old 02-02-2005, 04:50 PM
sdabbs65
Dragon
 
Join Date: Dec 2003
Location: Earth
Posts: 818
Default

Quote:
Originally Posted by fathernitwit
that actually just gives you stats, wether they are logged in or not.
To detect active connections, you would prolly have to telnet to the world console and ask it for a who.
.

hmmm i was hoping perl could do something like that , I will have to research that this weekend.
__________________
hosting Eqemu/Runuo/wow Emulators.

www.cheaterz.info
Reply With Quote
  #4  
Old 02-05-2005, 04:22 PM
Acolyte
Sarnak
 
Join Date: May 2002
Location: Oakland, CA
Posts: 83
Default

Damn, it's been a long time since I've posted or done anything with EQEmu... probably close to 3 years now.

I wrote a php script that did what you were asking for. I don't have a copy of it anymore, but I will tell you what it did.

Basically, using PHP, you CAN telnet into the world server and parse the output of players to display it on a webpage. No PERL needed.
__________________
The Acolyte
Reply With Quote
  #5  
Old 02-18-2005, 01:25 PM
KingMortenson
Fire Beetle
 
Join Date: Apr 2004
Posts: 25
Default

I remember that Acolyte , didn't you write that for my server ? hehe
Reply With Quote
  #6  
Old 03-14-2005, 10:45 PM
farce
Hill Giant
 
Join Date: Feb 2003
Posts: 126
Default

Use PHP to open a socket to the telnet port on your world server. Send in the commands to get the list, read out the data into an array then format and display.

pseudo code:

Code:
<?php

$fp = fsockopen('localhost',21, $errno, $errstr,30); // PHP server and world are on the same machine
if(!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fgets($fp, 128); // then keep getting data until an input prompt
    fwrite($fp, "who\n"); // input command
    while(!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
something to that effect =)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:49 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3