Adding Stats table to EQEmuLS For display on a webpage
first prepare the database
Code:
CREATE TABLE IF NOT EXISTS `LSStats` ( Code:
void EQEmuDatabase::AddWorldServerStatus(uint32 serverId, std::string longName) Code:
void AddWorldServerStatus(uint32 serverId, string longName); around line 340 After Code:
NewServer.Status.num_zones = 0; Code:
_db->RemoveWorldServerStatus(NewServer.WorldServerReg->GetServerID()); Code:
(*Iterator).Status.num_zones = Status->num_zones; Code:
_db->UpdateWorldServerStatus((*Iterator).WorldServerReg->GetServerID(), (*Iterator).Status.num_players, (*Iterator).Status.num_zones, (*Iterator).WorldServerReg->GetServerListTypeID()); Code:
RemoveServerEntry((*Iterator)->GetrIP()); Code:
Iterator = EQServers.erase(Iterator); Code:
_db->RemoveWorldServerStatus((*Iterator).WorldServerReg->GetServerID()); What this will do is allow you to pull the information for all connected world servers (worldstatus field is the list id in the serverlisttype table so you can easily show prefered legends or standard server on your web page) the number of players logged in to the world playing currently and how many zones are loaded on the world server. It automaticly updates so it only shows the worlds currently online ( It should atleast i havent really tested that part to make sure its removing the entry for disconnected worlds from the db) Enjoy! |
NOTE Special thanks go to sesmar for helping me with this ( he did most of the work)
|
Below is a simple stats script for your site ( I used a dbi i already had written hence the class for it)
Code:
<head> |
All times are GMT -4. The time now is 01:33 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.