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

FlyveHest
cyclist
cyclist
Posts: 39
Joined: 27 Apr 2008 20:40
Owned TM-games: TMU

Re: ASECO plugin: ServerStats (Playercount)

Post by FlyveHest » 05 May 2008 20:30

As promised, I have now released v0.5 of the plugin (First post has been updated as well)

:arrow: Logs extended information about your server (like peak players, avg players, current track)
:arrow: Can output a PNG graph (You need GD for this to work, which should be compiled into PHP)

Graph output is not as nice as I want it, yet, this is the first time i've used GD, so i'm very much just getting my feet wet here. (And also, take care, the graph code SERIOUSLY needs to be cleaned up for easier viewing)

It would be really nice to place the graph function in an external file, so it would be easily replaceable if someone else makes a new design/layout.
Any PHP gurus outthere who could give me a hand getting this done, if so, throw me a PM :)

As always, ideas, suggestions, post here, PM me, or find me on my TM server.

User avatar
J-S
happy cruiser
happy cruiser
Posts: 149
Joined: 24 Apr 2008 18:20
Owned TM-games: TMN,TMUF,TMO,TMS
Manialink(s): shark
Location: Grenoble - France
Contact:

Re: ASECO plugin: ServerStats (Playercount)

Post by J-S » 05 May 2008 20:56

Oh Thanks ! I test the new version tomorrow ! :roll:

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 (Playercount)

Post by w1lla » 06 May 2008 06:51

Code: Select all

<?php
/*
  ServerStats ASECO plugin
  Done in 2008 by [GB]-FlyveHest
    Visit our forums, http://gaming.gladblad.dk
    or drop a mail at gaming @ gladblad.dk
	
	Reedit by w1lla for xaseco.

	Requires: SimpleXML library in your PHP installation
	          GD (If graph output is enabled)
	
	 * Dependencies: used by plugin.localdatabase.php

	Extended Info keys:
    MAX: Peak player amount
    MXT: Time of the latest max player peak
    AVG: Average players over all the observations
    AVH: Average players over the last hour
    TRK: Current track
*/
	 
	

Aseco::registerEvent('onStartup', 'initServerStats');	
Aseco::registerEvent('onMainLoop', 'logServerStats');
Aseco::registerEvent('onNewChallenge', 'newChallenge');
Aseco::registerEvent('onEndRace', '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["ExtendedInfo"] = intval($settingsXML->extendedinfo);
    $settings["GraphOutput"] = intval($settingsXML->graph->enabled);
    $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);
    
    // And of the extended info table
    $sql = "CREATE TABLE IF NOT EXISTS `serverstats_extended` (
																															  `InfoKey` char(3) NOT NULL,
																															  `Value` varchar(20) NOT NULL default '-',
																															  PRIMARY KEY  (`InfoKey`)
																															) ENGINE=MyISAM;";
    $sqlresult = mysql_query($sql);
    
    // Initialize extended info, retrieve what is available from MySQL, for later reference
		$sql = "SELECT `Value` FROM `serverstats_extended` WHERE `InfoKey` = 'MAX'";
		$sqlresult = mysql_query($sql);
		$settings["ExtendedInfo_MAX"] = (mysql_num_rows($sqlresult) == 0 ? 0 : mysql_result($sqlresult, 0));
		
		if ($settings["VerboseLogging"] == 1) { print('[ServerStats] Current peak players: '.$settings["ExtendedInfo_MAX"]); }		
		mysql_free_result($sqlresult);
    
    // Check if graph output is enabled
    if ($settings["GraphOutput"] == 1)
    {
    	// Get graph settings
    	$settings["GraphDirectory"] = strval($settingsXML->graph->graphdirectory);
    	$settings["GraphFilename"] = strval($settingsXML->graph->graphfilename);
    	$settings["GraphWidth"] = intval($settingsXML->graph->graphwidth);
    	$settings["GraphHeight"] = intval($settingsXML->graph->graphheight);
    	$settings["GraphServerName"] = strval($settingsXML->graph->graphservername);
    	
    	// Graph output is enabled, check for directory existance / writeability
    	if (!is_writable($settings["GraphDirectory"]))
    	{
    		// Output directory is not writeable
    		$settings["GraphOutput"] = 0;
    		
    		if ($settings["VerboseLogging"] == 1) { $aseco->console_text('[ServerStats] Graph output directory is not writeable: '.$settings["GraphDirectory"]); }		
    	}
    	else
    	{
    		// Graph output enabled
    		if ($settings["VerboseLogging"] == 1) { print('[ServerStats] Graph output enabled: '.$settings["GraphDirectory"].$settings["GraphFilename"]); }
    	}
    }
    
    // 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 IGNORE INTO `serverstats` (`EntryTime`, `PlayerCount`) VALUES (DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:00'), ".count($aseco->server->players->player_list).")";
	    $sqlresult = mysql_query($sql);
	    
	    // Is extended enabled?
	    if ($settings["ExtendedInfo"] == 1)
	    {
	    	// Extended info is enabled, update
	    	
	    	// Check max players
	    	if (count($aseco->server->players->player_list) >= $settings["ExtendedInfo_MAX"])
	    	{
	    		// We have a new max players time
	    		$settings["ExtendedInfo_MAX"] = $count($aseco->server->players->player_list);
	    		
			    $sql = "INSERT INTO `serverstats_extended` (`InfoKey`, `Value`) VALUES ('MAX', '".$settings["ExtendedInfo_MAX"]."') ON DUPLICATE KEY UPDATE `Value` = '".$settings["ExtendedInfo_MAX"]."'";
			    $sqlresult = mysql_query($sql);

			    $sql = "INSERT INTO `serverstats_extended` (`InfoKey`, `Value`) VALUES ('MXT', NOW()) ON DUPLICATE KEY UPDATE `Value` = NOW()";
			    $sqlresult = mysql_query($sql);
	    	}
	    	
	    	// Log average players
		    $sql = "INSERT INTO `serverstats_extended` (`InfoKey`, `Value`) VALUES ('AVG', (SELECT ROUND(AVG(`PlayerCount`),1) FROM `serverstats`)) ON DUPLICATE KEY UPDATE `Value` = (SELECT ROUND(AVG(`PlayerCount`),1) FROM `serverstats`)";
		    $sqlresult = mysql_query($sql);
		    
		    // Log average players, over the last hour
		    $sql = "INSERT INTO `serverstats_extended` (`InfoKey`, `Value`) VALUES ('AVH', (SELECT ROUND(AVG(`PlayerCount`),1) FROM `serverstats` WHERE `EntryTime` >= DATE_SUB(NOW(), INTERVAL 1 HOUR))) ON DUPLICATE KEY UPDATE `Value` = (SELECT ROUND(AVG(`PlayerCount`),1) FROM `serverstats` WHERE `EntryTime` >= DATE_SUB(NOW(), INTERVAL 1 HOUR))";
		    $sqlresult = mysql_query($sql);		    
	    }
	    
	    // Is graph output enabled?
	    if ($settings["GraphOutput"] == 1)
	    {
	    	// Graph output is enabled
	    	if ($settings["VerboseLogging"] == 1) { $aseco->console_text('[ServerStats] Creating graph'); }
	    	
	    	$outputGraph();
	    }
	    
	    // Set the last updated time
	    $settings["LastUpdateTime"] = time();
	  }
	}
	
	// A new challenge has begun
	function newChallenge()
	{
	    // Is extended enabled
	    if ($settings["ExtendedInfo"] == 1)
	    {
	    	// Extended info is enabled, update
	    
		    // Log current trackname
		    $sql = "INSERT INTO `serverstats_extended` (`InfoKey`, `Value`) VALUES ('TRK', '".mysql_real_escape_string($aseco->server->challenge->name)."') ON DUPLICATE KEY UPDATE `Value` = '".mysql_real_escape_string($aseco->server->challenge->name)."'";
		    $sqlresult = mysql_query($sql);		    
	    }		
	}
	
	// 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 ".$this->settings["RetentionTime"]." HOUR)";
	    $sqlresult = mysql_query($sql);		
	}
	
	/*
	 * Everything below is related to outputting graphs, might be a good idea to look into making this more "pluginnable", for easier access
	 * to different graph outputs.
	 *
	 * Note, this could probably be made much prettier :)
	 */

	function outputGraph()
	{
		// Retrieve data
		$sql = "SELECT MIN(`EntryTime`) AS `FirstRecord`, MAX(`EntryTime`) AS `LastRecord` FROM `serverstats`";
		$sqlresult = mysql_query($sql);	
		$time = mysql_fetch_array($sqlresult, MYSQL_NUM);
		
		$sql = "SELECT GROUP_CONCAT(`PlayerCount` ORDER BY `EntryTime`) FROM `serverstats` WHERE `EntryTime` >= DATE_SUB(NOW(), INTERVAL 24 HOUR);";
		$sqlresult = mysql_query($sql);
		$sqlvalues = explode(",", mysql_result($sqlresult, 0));

		mysql_free_result($sqlresult);
	
		// Set the imageHeight and imageWidth of the final image
	  $imageWidth = $settings["GraphWidth"];
	  $imageHeight = $settings["GraphHeight"];
	
		// Calculate the plotarray, based on the total graph area (-2 for the border)
		$graphWidth = ($imageWidth - (ImageFontWidth(2) * 4)) - 2;	

		// How many datapoints do we have?
		$cntvalues = count($sqlvalues);
		
		// Init the final value-array
		$values = array();

		// Calculated the SQL array "jump"
		$arrjump = $cntvalues / $graphWidth;
	
		// Transfer values from sqlvalues to values
		$arrpos = 0;
		$cntpos = 0;
		
		while ($cntpos < $graphWidth)
		{
			// Check if we are jumping more than 1 position in the sqlvalues
			if (floor($arrpos + $arrjump) - floor($arrpos) > 1)
			{  		
				// We are jumping more than one array position, we need to find max value of the values we are jumping over
				$values[$cntpos] = max(array_slice($sqlvalues, floor($arrpos), floor($arrpos + $arrjump) - floor($arrpos)));  		
			}
			else
			{
				// We are only jumping 1 value, no need to find max value
				$values[$cntpos] = $sqlvalues[floor($arrpos)];
			}
			
			// Advance
			$arrpos += $arrjump;
			$cntpos++;
		}  	
	
		// Get the total number of columns we are going to plot
	  $valueCount = count($values);	
	
		// Find the maximum value, so we can scale accordingly, also calculate average
		$plottedMax = false;
		
	  for ($i = 0; $i < $valueCount; $i++)
	  {
	  	$maxValue = max($values[$i],$maxValue);
	  	$totalValue += $values[$i];
	  }
	  
	  // Average player count
	  $averageValue = $totalValue / $valueCount;
	    
		// Create the GD image
		$im        = ImageCreate($imageWidth,$imageHeight);
		$black     = ImageColorAllocate($im,0x00,0x00,0x00);
		$gray_lite = ImageColorAllocate($im,0xee,0xee,0xee);
		$gray_dark = ImageColorAllocate($im,0x8f,0x8f,0x8f);
		$white     = ImageColorAllocate($im,0xff,0xff,0xff);
		$red       = ImageColorAllocate($im,0xff,0x00,0x00); 
		$green     = ImageColorAllocate($im,0x00,0xff,0x00); 
	    
		// Fill in the background of the image
	  ImageFilledRectangle($im, 0, 0, $imageWidth, $imageHeight, $white);
	
		// Top / Bottom y-axis
		ImageString($im, 2, (ImageFontWidth(2) * 4) - (ImageFontWidth(2) * strlen($maxValue)), -1, $maxValue, $black);
		ImageString($im, 2, (ImageFontWidth(2) * 4) - (ImageFontWidth(2) * strlen(0)), $imageHeight - (ImageFontHeight(2) * 2), 0, $black);
	
		// Left / Right x-axis
		ImageString($im, 2, ImageFontWidth(2) * 4, $imageHeight - ImageFontHeight(2), strftime("%H:%M", strtotime($time[0])), $black);
		ImageString($im, 2, $imageWidth - (ImageFontWidth(2) * 5), $imageHeight - ImageFontHeight(2), strftime("%H:%M", strtotime($time[1])), $black);
	
	  // Calculate the label distribution (Y: Label every 30 pixels, X:Label every 50 pixels)
	  $yLabelCount = floor(($imageHeight - (ImageFontHeight(2) * 2)) / 30);
	  $yLabelDistribution = floor(($imageHeight - ImageFontHeight(2)) / $yLabelCount);
	  $yValueDistribution = $maxValue / $yLabelCount;
	  
	  $xLabelCount = floor(($imageWidth - ImageFontWidth(2) * 4) / 50);
	  $xLabelDistribution = floor(($imageWidth - ImageFontWidth(2) * 4) / $xLabelCount);
	  $xValueDistribution = (strtotime($time[1]) - strtotime($time[0])) / $xLabelCount;
	    
	  // Plot Y axis / horizontal dividers
	  for ($i = 1; $i < $yLabelCount; $i++)
	  {
	  	$yLabelValue = round($maxValue - ($i * $yValueDistribution));
			ImageString($im, 2, (ImageFontWidth(2) * 4) - (ImageFontWidth(2) * strlen($yLabelValue)), ($i * $yLabelDistribution) - (ImageFontHeight(2) * 0.5), $yLabelValue, $black);
			
			ImageLine($im, ImageFontWidth(2) * 4, ($i * $yLabelDistribution), $imageWidth, ($i * $yLabelDistribution), $gray_lite);
	  }
	
	  // Plot X axis / vertical dividers
	  for ($i = 1; $i < $xLabelCount; $i++)
	  {
	  	$xLabelValue = round(strtotime($time[0]) + ($i * $xValueDistribution));
	
			ImageString($im, 2, $i * $xLabelDistribution + (ImageFontWidth(2) * 1.5), $imageHeight - ImageFontHeight(2), strftime("%H:%M", $xLabelValue), $black);
			ImageLine($im, $i * $xLabelDistribution + (ImageFontWidth(2) * 4), 0, $i * $xLabelDistribution + (ImageFontWidth(2) * 4), $imageHeight - ImageFontHeight(2) - 1, $gray_lite);
	  }
	
	  // Insert server-name
	  ImageString($im, 2, (ImageFontWidth(2) * 4) + 2, -1, $this->settings["GraphServerName"], $gray_dark);
	
	  // Plot average line
	  $averagePixelPosition = ($imageHeight - ImageFontHeight(2) - 1) - ((($imageHeight - ImageFontHeight(2) - 1) / $maxValue) * $averageValue);
	  ImageLine($im, ImageFontWidth(2) * 4, $averagePixelPosition, $imageWidth - 1, $averagePixelPosition, $green);
	
		// Plot all values
		$arrpos = 0;
		while ($arrpos < ($valueCount - 1))
		{		
			$x1 = (ImageFontWidth(2) * 4) + $arrpos + 1;
			$y1 = $imageHeight - ImageFontHeight(2) - 1 - ((($imageHeight - ImageFontHeight(2) - 1) / $maxValue) * $values[$arrpos]);
			$x2 = (ImageFontWidth(2) * 4) + $arrpos + 2;
			$y2 = $imageHeight - ImageFontHeight(2) - 1 - ((($imageHeight - ImageFontHeight(2) - 1) / $maxValue) * $values[$arrpos + 1]);
		
		  // Check if we are at the peak value
		  if (!$plottedMax)
		  {
		  	if ($values[$arrpos] == $maxValue)
		  	{
		    	// Plot the max line
		    	ImageLine($im, $x1, 0, $x1, $imageHeight - ImageFontHeight(2) - 1, $red);
		    	
		    	$plottedMax = true;
		    }
		  }
		
			// Plot the normal dataline
		  ImageLine($im, $x1, $y1, $x2, $y2, $gray_dark);  	
			
			// Advance
			$arrpos++;
		}
	  
		// Black border on the whole graph
		ImageRectangle($im, ImageFontWidth(2) * 4, 0, $imageWidth - 1, $imageHeight - ImageFontHeight(2) - 1, $black);
	
		// Output a PNG file
	  ImagePNG($im, $$settings["GraphDirectory"].$settings["GraphFilename"]);	  
	}
?>
hi i tried to get the plugin to work with xaseco. It makes the tables but it doesnt make the GD and the tables are pretty empty it says that it controls every minute but when someone is in the server there is nobody in the tables?

Code: Select all

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

cdrw700
happy cruiser
happy cruiser
Posts: 129
Joined: 03 Dec 2006 09:15
Contact:

Re: ASECO plugin: ServerStats (Playercount)

Post by cdrw700 » 06 May 2008 18:10

Works great !! Thanks a lot !

FlyveHest
cyclist
cyclist
Posts: 39
Joined: 27 Apr 2008 20:40
Owned TM-games: TMU

Re: ASECO plugin: ServerStats (Playercount)

Post by FlyveHest » 07 May 2008 06:38

w1lla wrote:hi i tried to get the plugin to work with xaseco. It makes the tables but it doesnt make the GD and the tables are pretty empty it says that it controls every minute but when someone is in the server there is nobody in the tables?
I don't know how XASECO uses MySQL, but it sounds like it differs from the way ASECO does it. If the graph isn't output, this may be because GD isn't compiled into your PHP, or maybe that the user running XASECO does not have write privileges where you set the file to be written? (Or it may be something completely else)

I have just done setting up a proper development setup, with a local server, etc, so maybe i'll look into XASECO and FAST, unless they already have the capabilities that this plugin does (I'm guessing XASECO doesn't, but don't know about FAST :)

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 (Playercount)

Post by w1lla » 07 May 2008 06:45

how can i compile GD?

Code: Select all

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

FlyveHest
cyclist
cyclist
Posts: 39
Joined: 27 Apr 2008 20:40
Owned TM-games: TMU

Re: ASECO plugin: ServerStats (Playercount)

Post by FlyveHest » 07 May 2008 06:49

w1lla wrote:how can i compile GD?
That very much depends on how and where your ASECO is running, Windows, Linux, Other? Do you own your server, or are you using a hosting provider?

You should probably start by doing a phpinfo() and check if GD is present (my PHP says --with-gd)

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 (Playercount)

Post by w1lla » 07 May 2008 06:56

im running windows xp sp 2. but it still goes weird

Code: Select all

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

Schnipper
highway camper
highway camper
Posts: 2
Joined: 31 Mar 2008 18:46
Owned TM-games: TMU, TMN
Contact:

Re: ASECO plugin: ServerStats with graph output

Post by Schnipper » 24 May 2008 09:49

look into your phpinfo() and you know wheter you the D-Libarie or not, but normaly it's installed, cause it's one of the standard-libaries of PHP or Apache...

MFG Schnipper
Sorry for my bad english, i'm only a normal german pupil :p

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 » 24 May 2008 12:12

hehe, I'm heving a nice little block of graphic already here

It's a cool extra feature, to give an overview on the records that i'm gonna place on that page also.
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]

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 » 26 May 2008 09:10

Hello,

I think the plugin has a little proble: I've configured it to display 48 hours of activity instead of 24 and also a bigger format (790x160 i believe).

The problem is that I remember the maximum of players being reached yesterday evening arond 22h, and 0 to 10 players activity being from 1-8 am. Suddenly the days stats seem inverted, the peak of 45 users were yesterday and is now being reported the night befor and not at the correct hour.

However the graph after midnight of the last day seems to be ok.

you can look it up here: http://stat1.bemaniacs.org , maybe i can also export the database records of that field ?
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]

FlyveHest
cyclist
cyclist
Posts: 39
Joined: 27 Apr 2008 20:40
Owned TM-games: TMU

Re: ASECO plugin: ServerStats with graph output

Post by FlyveHest » 26 May 2008 17:13

BLaHiTiS wrote:you can look it up here: http://stat1.bemaniacs.org , maybe i can also export the database records of that field ?
If you could export the serverstats table to CSV or some other easily parseable format, then I will take a look at it. (If you could export it as an SQL script, that would be the best :))

I only run 24 hours back, and have not tried extending the period further.

User avatar
J-S
happy cruiser
happy cruiser
Posts: 149
Joined: 24 Apr 2008 18:20
Owned TM-games: TMN,TMUF,TMO,TMS
Manialink(s): shark
Location: Grenoble - France
Contact:

Re: ASECO plugin: ServerStats with graph output

Post by J-S » 26 May 2008 17:24

Hi everybody !
i have a problem with the generation of the graph. My graph don't be generate by the plugin

Look my serverstats.xml :

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>1</enabled> <!-- If 1, graph output is enabled -->
		<graphdirectory>/</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># SHARKTEAM #</graphservername> <!-- Text to appear top-left in the graph -->
	</graph>
</settings>
Look my phpinfo() (the GD module is enable) :

Code: Select all

GD Support  enabled  
GD Version  bundled (2.0.34 compatible)  
FreeType Support  enabled  
FreeType Linkage  with freetype  
FreeType Version  2.3.5  
T1Lib Support  enabled  
GIF Read Support  enabled  
GIF Create Support  enabled  
JPG Support  enabled  
PNG Support  enabled  
WBMP Support  enabled  
XBM Support  enabled  
Have you got any ideas for my problem ?
Thanks

Regards :)

User avatar
oliverde8
solid chaser
solid chaser
Posts: 1135
Joined: 07 Oct 2006 07:03
Owned TM-games: TMU
Manialink(s): oliverde8
Location: Turkey
Contact:

Re: ASECO plugin: ServerStats with graph output

Post by oliverde8 » 26 May 2008 17:58

O olso have an error I suppose due to my php.ini
ImageFontWidth is anknow function it tells me :evil:
So which library should I add :roll:

Thanks
ImageImage
Manialink : oliverde8color>
Servers : STATS <> United | VeryShort | Made In Turkey

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO plugin: ServerStats with graph output

Post by Assembler Maniac » 26 May 2008 20:23

oliverde8 wrote:O olso have an error I suppose due to my php.ini
ImageFontWidth is anknow function it tells me :evil:
So which library should I add :roll:

Thanks
It's not ImageFontWidth, it's imagefontwidth. I know php is case sensitive, so it might be looking for a function that it can't find based on case.

edit: I just tried this plugin myself and regardless of case, it can't find the imagefontwidth function. I'm running php 5.2.6 so I know it's pretty current. Anyone else have any idea why it can't be found?

Post Reply