ASECO plugin: ServerStats with graph output

This forum is dedicated to the Aseco/Rasp 2 server records and control script by Flo and Assembler Maniac. Announcements and issues can be discussed in this forum.

Moderators: Flo, f*ckfish, Assembler Maniac, TM-Patrol

User avatar
BLaHiTiS
lord of the roads
lord of the roads
Posts: 3331
Joined: 12 Aug 2005 15:46
Owned TM-games: tmu tmo tms tmn
Manialink(s): muxitis
Location: Hasselt, Limburg, Belgium
Contact:

Re: ASECO plugin: ServerStats with graph output

Post by BLaHiTiS » 20 Jul 2008 08:54

there's still this bug i want to remind you of. Namely the shiftin in 12 hour graphic stat. :)
Image

  • MB:Asus P8 H61
  • CPU:Intel i5 2400
  • RAM:8 Gb
  • GFX:Asus GTX-580 (1500mb DDR5) - Forceware 75.33
  • DirectX: June 2011
  • SND:Realtek HD on mobo
  • OS:Windows 7 SP1- Home Premium
[/size]

Ouwe
happy cruiser
happy cruiser
Posts: 152
Joined: 07 Sep 2007 15:01
Owned TM-games: TMUF, Canyon
Location: The Netherlands

Re: ASECO plugin: ServerStats with graph output

Post by Ouwe » 17 Aug 2008 10:22

Last try...

Can anyone please make this for XAseco?
Many thanks in advance.

Ouwe
happy cruiser
happy cruiser
Posts: 152
Joined: 07 Sep 2007 15:01
Owned TM-games: TMUF, Canyon
Location: The Netherlands

Re: ASECO plugin: ServerStats with graph output

Post by Ouwe » 18 Aug 2008 20:19

Ouwe wrote:Last try...

Can anyone please make this for XAseco?
Many thanks in advance.
Never mind my post above.
I made this on my forum, Link.
Not a graphic thing but I can see how many players are connected and wich track they are playing.

easyrider
pedestrian
pedestrian
Posts: 7
Joined: 27 May 2008 20:06
Owned TM-games: TMS

Re: ASECO plugin: ServerStats with graph output

Post by easyrider » 06 Nov 2008 13:58

hi Ouwe

I made one for 5-6 month ago. Give me a pm that I can mail the information to you. It's based on Flyvehest PhP file with some additions such as Graphic Rank on a server.

Ouwe
happy cruiser
happy cruiser
Posts: 152
Joined: 07 Sep 2007 15:01
Owned TM-games: TMUF, Canyon
Location: The Netherlands

Re: ASECO plugin: ServerStats with graph output

Post by Ouwe » 06 Nov 2008 21:42

Great news easyrider, I sended you a pm.
Thanks in advance

User avatar
blooper
happy cruiser
happy cruiser
Posts: 144
Joined: 11 Oct 2007 23:47
Owned TM-games: TMUF
Location: Minnesota, USA

Re: ASECO plugin: ServerStats with graph output

Post by blooper » 07 Dec 2008 02:18

easyrider wrote:hi Ouwe

I made one for 5-6 month ago. Give me a pm that I can mail the information to you. It's based on Flyvehest PhP file with some additions such as Graphic Rank on a server.
Would you mind posting it here (or creating a new topic)? Then anyone can use it without having to bug you.

dor396
road tourist
road tourist
Posts: 80
Joined: 02 Mar 2009 13:20
Owned TM-games: TMNF

Re: ASECO plugin: ServerStats with graph output

Post by dor396 » 06 May 2009 16:44

this is my serverstats.php:

Code: Select all

<?php
/*
   Requires: SimpleXML library
   
   PHP inspired by FufiWidgets and RASP
   */

Aseco::registerEvent('onStartup', 'initServerStats');   
Aseco::registerEvent('onPlayerConnect', 'logServerStats');
Aseco::registerEvent('onPlayerDisconnect', 'cleanupStats');
  
  // Initializes the plugin
   function initServerStats()
   {
      // Load settings
    print('[ServerStats] Initializing..');
    $Settings = array();
    $settingsXML = simplexml_load_file('serverstats.xml');

    $Settings["EntriesPrHour"] = intval($settingsXML->entriesprhour);
    $Settings["RetentionTime"] = intval($settingsXML->retentiontime);
    $Settings["VerboseLogging"] = intval($settingsXML->verboselogging);

    // Sanitycheck, no values below 0 and no more than 60 entries pr. hour
    if ($Settings["EntriesPrHour"] <= 0) { $Settings["EntriesPrHour"] = 1; }
    if ($Settings["EntriesPrHour"] > 60) { $Settings["EntriesPrHour"] = 60; }    
    
    // Calculate how often we need to log a datapoint
    $Settings["LoggingInterval"] = (round(60 / $Settings["EntriesPrHour"]) * 60);
      if ($Settings["VerboseLogging"] = 1) { print('[ServerStats] Logging every '.$Settings["LoggingInterval"].' seconds');}
      
      // Checks MySQL for existance of our logging table
    if ($Settings["VerboseLogging"] = 1) { print('[ServerStats] Checking MySQL'); }
    $sql = "CREATE TABLE IF NOT EXISTS `serverstats` (
                                                                                `EntryTime` datetime NOT NULL,
                                                                                `PlayerCount` smallint(6) NOT NULL default '0',
                                                                                PRIMARY KEY (`EntryTime`)
                                                                               ) ENGINE=MyISAM";
    $sqlresult = mysql_query($sql);
    
    // We will force an update the very first time the mainloop is run
    $Settings["LastUpdateTime"] = 1;
   }

  // Logs a new entry in the stats table
   function logServerStats()
   {
     // Check if its time to update
     if (($Settings["LastUpdateTime"] + $Settings["LoggingInterval"]) < time())
     {
        // It is time to update the stats
       if ($Settings["VerboseLogging"] == 1) { print('[ServerStats] Writing datapoint'); }
       
       // Perform the logging SQL
       $sql = "INSERT INTO `serverstats` (`EntryTime`, `PlayerCount`) VALUES (DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:00'), ".count($aseco->server->player->playerlist);
      $sql = "INSERT INTO `serverstats` (`EntryTime`, `PlayerCount`) VALUES (DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:00'), " & "6" ;
      $sqlresult = mysql_query($sql);
       
       // Set the last updated time
       $Settings["LastUpdateTime"] = time();
     }
   }
   
   // Cleans up old records in the stats
   function cleanupStats()
   {
         if ($Settings["VerboseLogging"] = 1) { print('[ServerStats] Cleaning out old datapoints'); }
      
       // Perform the cleanup SQL
       $sql = "DELETE FROM `serverstats` WHERE EntryTime < DATE_SUB(NOW(), INTERVAL ".$Settings ." HOUR)";;
       $sqlresult = mysql_query($sql);      
   }
?>


i use xaseco...
where the picture create ?
Israeli Community Mannager.
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ASECO plugin: ServerStats with graph output

Post by w1lla » 06 May 2009 16:57

post in xaseco what does the .xml file say.

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

dor396
road tourist
road tourist
Posts: 80
Joined: 02 Mar 2009 13:20
Owned TM-games: TMNF

Re: ASECO plugin: ServerStats with graph output

Post by dor396 » 06 May 2009 17:20

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
	<entriesprhour>12</entriesprhour> <!-- Number of log entries per hour, must be larger than 0, and less than or equal to 60 (one entry/minute) -->
	<retentiontime>24</retentiontime> <!-- Maximum age of stats, in hours -->
	<extendedinfo>1</extendedinfo> <!-- If 1, will also update the serverstats_extended table with further stats -->
	<verboselogging>1</verboselogging> <!-- If 1, will output more info in the ASECO logfile -->
	<graph>
		<enabled>1</enabled> <!-- If 1, graph output is enabled -->
		<graphdirectory>/stats/</graphdirectory> <!-- Path to the graph output, must be writeable by user running ASECO. REMEMBER! trailing / or \ -->
		<graphfilename>tmstats.png</graphfilename> <!-- Filename of graph (Plugin outputs a PNG, so should end with .png) -->
		<graphwidth>590</graphwidth> <!-- Width of the graph, in pixels -->
		<graphheight>120</graphheight> <!-- Width of the graph, in pixels -->
		<graphservername>Leage</graphservername> <!-- Text to appear top-left in the graph -->
	</graph>
</settings>
Israeli Community Mannager.
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ASECO plugin: ServerStats with graph output

Post by w1lla » 06 May 2009 17:26

try something like this:

<graphdirectory>D:\tmn\servertmnf\xaseco</graphdirectory> <!-- Path to the graph output, must be writeable by user running ASECO. REMEMBER! trailing / or \ -->

but then for your own file....

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

dor396
road tourist
road tourist
Posts: 80
Joined: 02 Mar 2009 13:20
Owned TM-games: TMNF

Re: ASECO plugin: ServerStats with graph output

Post by dor396 » 06 May 2009 17:55

not work..

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
	<entriesprhour>12</entriesprhour> <!-- Number of log entries per hour, must be larger than 0, and less than or equal to 60 (one entry/minute) -->
	<retentiontime>24</retentiontime> <!-- Maximum age of stats, in hours -->
	<extendedinfo>1</extendedinfo> <!-- If 1, will also update the serverstats_extended table with further stats -->
	<verboselogging>0</verboselogging> <!-- If 1, will output more info in the ASECO logfile -->
	<graph>
		<enabled>0</enabled> <!-- If 1, graph output is enabled -->
		<graphdirectory>/home/tmn/server5/xaseco/</graphdirectory> <!-- Path to the graph output, must be writeable by user running ASECO. REMEMBER! trailing / or \ -->
		<graphfilename>tmstats.png</graphfilename> <!-- Filename of graph (Plugin outputs a PNG, so should end with .png) -->
		<graphwidth>590</graphwidth> <!-- Width of the graph, in pixels -->
		<graphheight>120</graphheight> <!-- Width of the graph, in pixels -->
		<graphservername>Leage</graphservername> <!-- Text to appear top-left in the graph -->
	</graph>
</settings>
Israeli Community Mannager.
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ASECO plugin: ServerStats with graph output

Post by w1lla » 06 May 2009 17:59

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
	<entriesprhour>60</entriesprhour> <!-- Number of log entries per hour, must be larger than 0, and less than or equal to 60 (one entry/minute) -->
	<retentiontime>24</retentiontime> <!-- Maximum age of stats, in hours -->
	<extendedinfo>1</extendedinfo> <!-- If 1, will also update the serverstats_extended table with further stats -->
	<verboselogging>1</verboselogging> <!-- If 1, will output more info in the ASECO logfile -->
	<graph>
		<enabled>1</enabled> <!-- If 1, graph output is enabled -->
		<graphdirectory>D:\tmn\servertmnf\xaseco</graphdirectory> <!-- Path to the graph output, must be writeable by user running ASECO. REMEMBER! trailing / or \ -->
		<graphfilename>tmstats.png</graphfilename> <!-- Filename of graph (Plugin outputs a PNG, so should end with .png) -->
		<graphwidth>590</graphwidth> <!-- Width of the graph, in pixels -->
		<graphheight>120</graphheight> <!-- Width of the graph, in pixels -->
		<graphservername>blabla</graphservername> <!-- Text to appear top-left in the graph -->
	</graph>
</settings>

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

dor396
road tourist
road tourist
Posts: 80
Joined: 02 Mar 2009 13:20
Owned TM-games: TMNF

Re: ASECO plugin: ServerStats with graph output

Post by dor396 » 06 May 2009 18:09

i have linux so..

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
   <entriesprhour>60</entriesprhour> <!-- Number of log entries per hour, must be larger than 0, and less than or equal to 60 (one entry/minute) -->
   <retentiontime>24</retentiontime> <!-- Maximum age of stats, in hours -->
   <extendedinfo>1</extendedinfo> <!-- If 1, will also update the serverstats_extended table with further stats -->
   <verboselogging>1</verboselogging> <!-- If 1, will output more info in the ASECO logfile -->
   <graph>
      <enabled>1</enabled> <!-- If 1, graph output is enabled -->
      <graphdirectory>/home/tmn/server5/xaseco/</graphdirectory> <!-- Path to the graph output, must be writeable by user running ASECO. REMEMBER! trailing / or \ -->
      <graphfilename>tmstats.png</graphfilename> <!-- Filename of graph (Plugin outputs a PNG, so should end with .png) -->
      <graphwidth>590</graphwidth> <!-- Width of the graph, in pixels -->
      <graphheight>120</graphheight> <!-- Width of the graph, in pixels -->
      <graphservername>Leage</graphservername> <!-- Text to appear top-left in the graph -->
   </graph>
</settings>
Last edited by dor396 on 06 May 2009 18:28, edited 1 time in total.
Israeli Community Mannager.
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ASECO plugin: ServerStats with graph output

Post by w1lla » 06 May 2009 18:16

well it works

try to look near the other files if the .png is there

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

dor396
road tourist
road tourist
Posts: 80
Joined: 02 Mar 2009 13:20
Owned TM-games: TMNF

Re: ASECO plugin: ServerStats with graph output

Post by dor396 » 06 May 2009 18:27

this is my problem..
there is not any png file..
Israeli Community Mannager.
Image

Post Reply