Jump to content
xisto Community
Sign in to follow this  
lairz

How To Set Up Vsp Stats

Recommended Posts

Ok first of all, what is VSP Stats. Basically it's a php script that allows game admins to parse their logs and create detailed player and game statistics. VSP supports various FPS games such as:

 

Quake 3 Arena (q3a), Halflife 1, 2, Counter Strike Source (hl), Wolfenstein: Enemy Territory (wet), Return to Castle Wolfenstein (rtcw), Call Of Duty/Call of Duty 2, COD: United Offensive (cod), Medal of Honor Allied Assault, MOHAA: Spearhead, MOHAA: BreakThrough (moh), Soldier of Fortune 2 (sof2), etc

(a quote from the developer's website http://forums.xisto.com/no_longer_exists/ )

 

You can follow the Readme file instead but it can be confusing to some people.

 

What you need in order to set up VSP:

 

Apache Web-Server 1.3-2.x

PHP 4/5

MySQL 4 (mysql 5 is not yet supported)

Access to your game's log file though ftp

A web service that allows external php ftp connections like Xisto.com :angry:

 

Setting up VSP:

 

- Download VSP core files from the main website http://forums.xisto.com/no_longer_exists/

- Download Media files from the main website. This will allow to display weapon, map, and award pictures from your game. http://forums.xisto.com/no_longer_exists/

- Create a MySQL database specifically for VSP stats.

- Upload the VSP core and media files to your web host.

- Change the VSP config corresponding with your MySQL setup. VSP config can be found in /vsp/pub/configs/cfg-default.php folder. Find the following code and change it:

 

	$cfg['db']['hostname'] = "Address of MySQL Database";	$cfg['db']['dbname']   = "MySQL Database Name";	$cfg['db']['username'] = "MySQL Username";	$cfg['db']['password'] = "Username Password";
You also need to configure the username and password for ftp access. To do this find the following code and change it.

 

	$cfg['ftp']['logs_path']= " Full path to  /vsp/ftplogs/  on your web server";	$cfg['ftp']['username'] = "FTP Username";	$cfg['ftp']['password'] = "FTP Username Password";	$cfg['ftp']['pasv'] = 1;			 //enable or disable passive mode	$cfg['ftp']['overwrite'] = 0;	  //value of 0 resumes the log file from the last location
If you scroll down you'll find a bunch of other options you might want to change. Like default player tracking by IP or GUID. GUID is a prefered option however it might not work for some games.

Upload the modified cfg-default.php file to your webserver. If you've done everything correctly so far you should now be able to access http://yourdomain.com/vsp/pub/themes/bismarck/index.php without any errors. If you do get errors, verify your MySQL configuration.

 

- Change vsp password needed to parse log files. The file is called password.inc.php and is found in the \vsp\ folder. Set the password by changing this vallue

$vsp['password']="YourPassword";
Parsing the log file:

 

The easiest way parse your log file is to navigate to http://forums.xisto.com/no_longer_exists/ where you'll find two input feilds. You'll see instructions at the bottom of how to parse your log. The way I do it is:

-l cod -p savestate 1 "ftp://bccp.sytes.net/MYLOG.log"
. The password is the one you specified in the password.inc.php file

 

Note that I specified -l cod to tell VSP that I have a COD/COD2 log file. Also -p savestate 1 tells VSP to remember the end position of log file so that it will not start parsing your log file from the begining which can create major issues. Make sure you input your ftp address in quotes "http://forums.xisto.com/no_longer_exists/;

 

If you are getting errors downloading the log file CHMOD your /vsp/ftplogs/ and /vsp/logdata/ to 777 using your favorite FTP client.

 

Once you are finished you will see player names and their stats if you navigate to http://yourdomain.com/vsp/pub/themes/bismarck/index.php. Here is an example of vsp stats in action: http://forums.xisto.com/no_longer_exists/

 

If you want to change the user arrangement from default skill based to kill based, you can find this option in \vsp\pub\themes\bismarck\settings.php

 

Good luck and have fun setting up VSP stats for your clan. :angry:

Share this post


Link to post
Share on other sites

The error could be related to the version of php you are using. This function is only supported by php 3 and above. I havent tried setting it up myself but that error usually means that php doesnt know what to do because it doesnt know what that function is and thats usually because php is utdated and needs to be updated.

Share this post


Link to post
Share on other sites

To Luk4ward, as shadowx previously stated, you recieved a fatal error because the function used is not supported by your current php version. I suggest you update your php or read the documentation for your current version.And to lairz, the creator of this tutorial, thanks, this method of showing FPS game statistics on a webpage is useful. I have also submitted another method, using psychostats, which is pretty similar to VSP stats. For more info, see my 'How to set up psychostats' thread (i think there are 2 because i accidentally resubmitted it :lol:)

Share this post


Link to post
Share on other sites

Oh cool! Nice worded/written tutorial! Don't find a use for this, but I enjoyed reading it. Nothing much else to say on this.Have a great day!-Tom

Share this post


Link to post
Share on other sites

high everything seems to work ok in terms of connecting to ftp etc. but this is what happens to us then nothing.Attempting to connect to FTP server 212.187.247.120:... - Connection/Login successful. - not using FTP passive mode (disabled in config) - Preparing to download the remote file "/359872/cod2/LDA/games_mp.log" - Attempting to download "/359872/cod2/LDA/games_mp.log" from FTP server to "./ftplogs/games_mp.log"...It just sits there !Please help

Share this post


Link to post
Share on other sites

You should try enabling FTP passive mode in cfg-default.Php

$cfg['ftp']['pasv'] = 1;

The reason of it is the way FTP works.It uses 2 well known ports, 21 fort requests and 20 for data transmission. In active mode, the ftp server try to connect to your box to transmit the file. In passive mode your box connect to the ftp server. When you're behind a NAT router and using active ftp your box open a port, listening for the ftp server to connect, but as your router don't know about this the ftp server's request is rejected and the transfer never begin. When  using passive mode, your NAT router doesn't have to know what appen, your box is talking to outside as usual.Hope that will help someone one day :P

Share this post


Link to post
Share on other sites

Well I am trying to setup vsp for cod2 but no luck.When I tray to parse log file I have this error:

max_execution_time is 0[command-line options]: Array(	[parser-options] => Array		(			[savestate] => 1		)	[prompt] => 1	[log-gamecode] => cod	[log-gametype] =>	[logfile] => ftp://cod2bih.info/counter/ftplogs/gamelog.log	[config] => pub/configs/cfg-default.php)Attempting to connect to FTP server cod2bih.info:...- Connection/Login successful.- FTP passive mode enabled- Preparing to download the remote file "/counter/ftplogs/gamelog.log"- Attempting to download "/counter/ftplogs/gamelog.log" from FTP server to "./ftplogs/gamelog.log"...Remote file is the same size as Local file. Skipped Download../ftplogs/gamelog.logError: The variable $cfg['game']['name'] is not set properly in config file.Edit your config file (pub/configs/cfg-default.php)Read the comments beside that variable and set that variable properly.
But the variable game name is set to "cod",so what am I doing wrong?
Here is my default cfg setup:
<?php//==============================================================================// Anything following double slashes // are comments.// You can use // to disable certain settings.// Remove the // infront of a variable if you want to enable it.//==============================================================================global $cfg;//================================================// PHP configurations  	error_reporting(E_ALL ^ E_NOTICE ^ (defined('E_DEPRECATED') ? E_DEPRECATED : 0)); // For Debugging. Recommended when you set up vsp for the first time.	//error_reporting(E_ALL ^ E_NOTICE ^ (defined('E_DEPRECATED') ? E_DEPRECATED : 0) ^ E_WARNING); // Recommended for regular use after ensuring proper run of vsp.	//error_reporting(E_ALL ^ (defined('E_DEPRECATED') ? E_DEPRECATED : 0));						// For Debugging. Enable this if you are having a hard time to get vsp going.	ini_set("default_charset", "UTF-8");			 // default charset	setlocale(LC_NUMERIC, 'C');					  // numeric locale (dont set a locale that uses commas for separating float numbers)  //================================================// Database settings  	//$cfg['db']['adodb_path']= "C:/php/lib/adodb/"; // Uncomment/Enable this only if you have and want to use your own adodb libraries.													 // Must specify it as an absolute path! ie:- "../../adodb" etc. are *NOT ALLOWED*  	$cfg['db']['adodb_driver']= 'mysql';  	$cfg['db']['table_prefix'] = "vsp_";		   // use only lower case to minimize windows/linux portability problems  	$cfg['db']['hostname'] = "localhost";	$cfg['db']['dbname']   = "xxxxxx";	  // use only lower case to minimize windows/linux portability problems	$cfg['db']['username'] = "xxxxxx";	$cfg['db']['password'] = "xxxxxx";//================================================// Ip2Country table	$cfg['ip2country']['source'] = 'ip-to-country.csv';   // cvs source file from which the ip2country table gets populated,														  // file will be searched in sql directory or as an absolute path														  // when it's absent	$cfg['ip2country']['countries_only'] = 1;			 // if enabled(1) the ip2country table will only load the information														  // of countries and nothing more														  // enable when the country code information is already contained														  // in the log file (as with xp log files) to optimize space and														  // lookup speed	$cfg['ip2country']['columns']['ip_from'] = 0;		 // column that holds the ip from field (0-indexed)	$cfg['ip2country']['columns']['ip_to'] = 1;		   // column that holds the ip to field (0-indexed)	$cfg['ip2country']['columns']['country_code2'] = 2;   // column that holds the country code (0-indexed)	$cfg['ip2country']['columns']['country_name'] = 4;	// column that holds de country name (0-indexed)//================================================// Game settings	$cfg['game']['name']='cod'; /*** make sure this is set correctly! Read below! ***/													 /*----------------------------------------													 In order to find out what values are													 acceptable for this variable, look in the													 /pub/games/ folder in vsp. Any sub													 directory in this folder is valid.													 ex:-														  'cod'	 for Call of Duty and all its expansions/mods														  'hl'	  for Half Life and all its mods														  'moh'	 for Medal of Honor and all its expansions/mods														  'q3a'	 for Quake 3 Arena and all its expansions/mods														  'rtcw'	for Return to Castle Wolfenstein and all its mods														  'sof2'	for Soldier of Fortune 2														  'wet'	 for Wolfenstein Enemy Territory and all its mods														  'default' for games that are not listed in pub/games/														 etc.													 ----------------------------------------*/// Themes *may* use the following variables to do special processing for a particular game,mod,type	$cfg['game']['mod']='xp';  // not used currently	$cfg['game']['type']='default'; // not used currently// The theme author decides how to use these variables.// Check the documentation for the theme that you are using//================================================// Remote downloading of logs	$cfg['ftp']['logs_path']= "./ftplogs/";		// Files downloaded from ftp server will go into this directory on local server.	$cfg['ftp']['username'] = "xxxxxxx";	$cfg['ftp']['password'] = "xxxxxxx";	$cfg['ftp']['pasv'] = 1;					   // Enable(1)/Disable(0) Passive mode. Some FTP servers may require this to be ON	$cfg['ftp']['overwrite'] = 0;				  // Enable(1)/Disable(0) overwriting of file(s). A value of 0 resumes the log.//================================================// Parser Options  	$cfg['parser']['use_original_playerID'] = 1;				   // Check http://forums.xisto.com/no_longer_exists/	$cfg['parser']['use_most_used_playerName'] = 1;				// use the most used playerName (set to 1) OR newest playerName (set to 0) as primary playerName	$cfg['parser']['use_most_used_playerIP'] = 1;				  // use the most used playerIP (set to 1) OR newest playerIP (set to 0) as primary playerIP	$cfg['parser']['check_unique_gameID'] = 1;					 // check uniqueness of game start date																   // disable if log doesn't have server date information      	// You can track players by guid and ip if the game/mod supports it.	// Tracking by guid is always the best option if its available. If it doesn't work track by playername  	//----- ***USE ONLY ONE OF THESE AT A TIME*** -----  	//$cfg['parser']['trackID'] = 'playerName';					  // Default method for tracking, works with all games/mods. If unsure, use this.  	//$cfg['parser']['trackID'] = 'ip=/(\d+\\.\d+\\.\d+\\.\d+)/';  // Track by ip AAA.BBB.CCC.DDD (NOT RECOMMENDED - the full ip of the player will be viewable by anyone)	//$cfg['parser']['trackID'] = 'ip=/(\d+\\.\d+\\.\d+\\.)/U';	// Track by ip AAA.BBB.CCC.*   (recommended tracking format for ips)	//$cfg['parser']['trackID'] = 'ip=/(\d+\\.\d+\\.\d)/U';		// Track by ip AAA.BBB.C*.*	//$cfg['parser']['trackID'] = 'ip=/(\d+\\.)/U';				// Track by ip AAA.*.*.*  	$cfg['parser']['trackID'] = 'playerName';						  // Recommended method of tracking, if available for that game/mod  	//----- ***USE ONLY ONE OF THESE AT A TIME*** -----//================================================// Other settings	$cfg['awardset']='default';	$cfg['skillset']='default';	$cfg['roleset']='default';	$cfg['iconset']='default';	$cfg['mapset']='default';	$cfg['weaponset']='default';	$cfg['player_ban_list']='default';	$cfg['player_exclude_list']='default';	$cfg['games_limit'] = 1000;				 // limit of detailed game stats that will be stored												// on the database//================================================// Display settings  	$cfg['display']['record_limit']=50;	$cfg['display']['days_inactivity']=30;	  // number of days after which players are excluded												// for rank and awards (0 means never)//================================================// Server info	$cfg['display']['server_title']='HERE GOES YOUR SERVER TITLE';	$cfg['display']['server_image']="../../images/server.gif";  	$cfg['display']['server_info']=<<<END_OF_SERVER_INFO	<table style="border-width: 10;">	<TR>	  <TD style="border-width: 0; text-align: right">Server:</TD>	  <TD style="border-width: 0; text-align: left" ><font color="LimeGreen">Your Server Name and IP goes here</font></TD>	</TR>	<TR>	  <TD style="border-width: 0; text-align: right">Game:</TD>	  <TD style="border-width: 0; text-align: left" >Your Game and Mod type goes here</TD>	</TR>	<TR>	  <TD style="border-width: 0; text-align: right">Admins:</TD>	  <TD style="border-width: 0; text-align: left" ><b><font color="DarkGoldenrod">List your admin(s) here</font></b></TD>	</TR>	<TR>	  <TD style="border-width: 0; text-align: right">E-Mail/MSN:</TD>	  <TD style="border-width: 0; text-align: left" >List your E-Mail and/or IM account here</TD>	</TR>	<TR>	  <TD style="border-width: 0; text-align: right">Web Site:</TD>	  <TD style="border-width: 0; text-align: left" ><a href="http://My.web_site_goes_here.com" target="_blank">My web site name goes here</a></TD>	</TR>	<TR>	  <TD style="border-width: 0; text-align: right">Quote:</TD>	  <TD style="border-width: 0; text-align: left" ><b>My quote goes here</b></TD>	</TR>	</table>END_OF_SERVER_INFO;//================================================// Data Filters// format :- $cfg['data_filter']['events']['eventCategory'] = REGEXP// $cfg['data_filter']['events']['eventCategory'] = "/^R/";	 means exclude the events in the category eventCategory where eventName begins with R// $cfg['data_filter']['events'][''] = "/.*/";				  means exclude all events in category eventCategory where eventName matches anything  $cfg['data_filter']['events']['weapon']="/.*/"; // excluded all weapon events  $cfg['data_filter']['events']['ammo']="/.*/"; // excluded all ammo events  //$cfg['data_filter']['events']['items']="/.*/"; // uncomment this line to exclude all item pickup events (mainly health, armor and powerups)  $cfg['data_filter']['events']['']="/^(team_CTF_blueflag|team_CTF_redflag|team_CTF_neutralflag)/"; // innacurate  //$cfg['data_filter']['gamedata']['']="/^(sv_|g_|p_)/";  $cfg['data_filter']['gamedata']['']="/.*/";//================================================//==============================================================================?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.