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"; ?> |
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. |
Quote:
hmmm i was hoping perl could do something like that , I will have to research that this weekend. |
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. |
I remember that Acolyte , didn't you write that for my server ? hehe
|
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 |
PHP script.
I don't think the server supports telnet as I can not even telnet into it
localy. when I do telnet to the server it echos and just says invalid username and password. I was thinking a perl script might work but I dont know enuff to get it going properly. Im getting this error. 500 'WHO': command not understood. |
http://heightenedreality.com/cgi-bin/whoson.pl
Code is sort of ugly, I'll post it later when I get time. |
[QUOTE=knightz
Code is sort of ugly, I'll post it later when I get time.[/QUOTE] ok with some modification it could be usefull but without the code it's useless. |
Sorry it took so long....
Code:
#!/usr/bin/perl |
Thanks Buri, its nice PHP script :)
btw, i seen on KMRA you fixed govtcheese magelo profile for latest EQEmu version, is there any plan to make it public ? :p |
Don't know perl,
But i have a error : Global symbol "$li" requires explicit package name at D:/Apache2/cgi-bin/whoson.pl line 41. Ps: perl is'nt install with telnet features you need to open Mcpan and install module :) no more error 500 :) |
Quote:
|
non computer GURU's INSTALL telnet under Perl.
Go to DOS and type .
perl -MCPAN -e shell; then at the command lilne type install Net::Telnet::Cisco you will see about 500 lines then ask you to do some things just keep hitting enter for default. then you will have telnet installed under perl. |
No PERL... PHP is the way to go.
I don't use PERL, so can someone port this to PHP? I will if I have to but if someone has already done it, please share. :)
|
php
Yeah PHP would be nice ;)
|
Quote:
|
telnet
Quote:
it may still be in the source somewhere tho <shrug>.. |
Quote:
|
World.exe
Quote:
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. |
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)
|
yup
Quote:
.. 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. |
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 |
telnet in world does work, for sure.
I have had some trouble in the past with puTTY, don't know why. |
y
Quote:
|
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 |
hmmm
Quote:
error msg says .. xx.xx.xx.xxx - - [23/Aug/2005:20:32:47 -0400] "GET /who.php HTTP/1.1" 200 - |
Change this line :
Code:
$output = str_replace($user">", "", $output); Code:
$output = str_replace("your_user>", "", $output); Mag |
hmm
Quote:
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... |
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 |
.net equivilent
I have ben searching high and low to develop a .net equivlent to the .php scripts floating around the boards... has anyone had any luck getting a vb.net or c#.net app telneting to world.exe?
|
It's not VB or C#, but for what it's worth, I have a minimal world Java client if you want to look at that.
executable jar: http://home.comcast.net/~moofn/eqadmin.jar source: http://home.comcast.net/~moofn/eqadminsrc.zip |
?
Quote:
|
All times are GMT -4. The time now is 07:13 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.