Server reporting and data mining

From PSwiki
Jump to navigation Jump to search

Static view on the database

Provided by webconsole with the following statistics:

  • Hardware
  • New Accounts
  • New Accounts (with at least one login)
  • New Characters
  • New Characters (with time>0)
  • Retention time
  • Char Stats: Strength
  • Char Stats: Endurance
  • Char Stats: Agility
  • Char Stats: Intelligence
  • Char Stats: Will
  • Char Stats: Charisma
  • Skill: Sword
  • Skill: Light Armor
  • Skill: Medium Armor
  • Skill: Heavy Armor
  • Skill: Crystal Way
  • Skill: Melee
  • Char Money
  • Completed Quests (* !!)
  • Pending Quests(* !!)

To operate it needs apache running, with proper webdirectory example:

 Alias /webconsole "F:\Luca\Crystal Space\planeshift\www\webconsole-new"
 <Directory "F:\Luca\Crystal Space\planeshift\www\webconsole-new">
   AllowOverride All
   Options Indexes FollowSymLinks
   Require all granted
 </Directory>

The config is in ../secure/db_config.php

Dynamic view generated by the server at runtime

In the main server dir we have report.xml which contains the following data, generate by ServerStatus class in planeshift\trunk\src\server\serverstatus.h:

First section, global data:

 <server_report time="Sun Feb 21 17:27:01 2021" now="1613928421" number="576358" client_count="13" mob_births="4810" mob_deaths="4810" player_deaths="49" sold_items="11400" sold_value="5994348" totalMoneyIn="6215083" totalMoneyOut="693285">

Second section, one line for each player connected:

 <player name="Sedilo" characterID="9520875" guild="" title="" security="0" kills="3" deaths="0" suicides="0" pos_x="-586.10" pos_y="49.93" pos_z="-14.94" sector="bdgug02" />

Third section, with NPC data and realtime position:

 <npc name="Aleena Arlavin" characterID="31" kills="0" deaths="0" suicides="0" pos_x="-131.30" pos_y="33.89" pos_z="-86.00" sector="hydlaa_plaza" />


Static view generated by rrdtool

rrdtool is a standard package, you can get it with apt-get rrdtool in Ubuntu

For accounts and characters created, rrdtool is executing every x minutes:

 SELECT Count(*) from accounts;
 SELECT Count(*) from characters;

This populates pscharacters.rrd and psaccounts.rrd

Then is reading report.xml and extracting:

psonline.rrd (Player online)
psmobs.rrd (NPC birth and deaths)
psplayers.rrd (Player deaths)
psecon.rrd (Economy)

My Plane dynamic view

Generated by /home/planeshift/myplane/cronjob.php , it takes report.xml present in the main server dir and reads characterid and sector and putting this info in the myplane database

 INSERT INTO `active_characters` (`characterid`,`sector`) VALUES ( :id, :sector )');

This is then read by MyPlane when showing the online or offline status of the character

Wish list

Described in the Analysis_package done for GSoC. Never implemented.