PDA

View Full Version : PHP Interface


_OZZY_
01-16-2004, 08:32 AM
A long time ago a guy named Stormgod had a PHP interface to EQEmu that'd tell players, stats, etc. Has anyone picked up on this project or developed something similar? If not, does anyone have any sorta idea as to the best way to approach doing something like this?

Thanks!

var1ety
01-18-2004, 10:44 AM
Edit: This post concerns player statistics (strength, constitution, etc), bank account, worn equipment, etc. This, however, does not report players online, or anything like that - if that's what you wanted, then disregard.

I'm not aware of any public projects. However, this is easily accomplished in PHP - I was writing a simple parser last night for fun at the same time another friend was. The following link is a compilation of some basic scripts I wrote last night, they could be easily modified to display character information in any way you chose. They are just proof of concept kind of stuff, you could mix and match lines from them to get the data, and in turn display them in any fashion you wished.

These were made referencing Shawn319's CVS from January 12, 2004, but may work with previous versions.

http://cobblering.kicks-ass.net/~timothy/eq/eqphp.tar.gz

Files:
eqphp/profile.php
eqphp/pp.sed
eqphp/pp.awk
eqphp/equip.php
eqphp/db.inc.php

Details:

================================================== ============

eqphp/profile.php

Generated using common/eq_packet_structs.h in conjunction with pp.sed and pp.awk. To re-generate:

awk -f pp.awk ~/devel/eqemu/cur/src/common/eq_packet_structs.h | sed -f pp.sed > profile.php

Note: There are errors in the listed offset in that file - last_name begins around byte 70, not byte 68. Gold begins at offset 2924, not 2922. These are correct in my local copy, and in profile.php

================================================== ============

eqphp/pp.sed

sed script that turns the lines in the PlayerProfile_Struct into a php script to read in and display them.

================================================== ============

eqphp/pp.awk

awk script that extracts the PlayerProfile_Struct from common/eq_packet_structs.h

================================================== ============

eqphp/equip.php

PHP script that parses the inventory table, real basic - displays slot, item name that is equipped in the slot, and charges.

================================================== ============

eqphp/db.inc.php

Loaded in the other PHP scripts included - this file contains database login
information, and initiates the connection to the specified MySQL database.