Nov 22, 2009

How To Set Up Vsp Stats

free web hosting
Open Discussion > MODERATED AREA > Tutorials

How To Set Up Vsp Stats

lairz
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:

QUOTE
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://www.5th-gradient.com/vsp/ )

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 Trap17.com smile.gif

Setting up VSP:

- Download VSP core files from the main website http://www.5th-gradient.com/vsp/vsp-core.zip
- Download Media files from the main website. This will allow to display weapon, map, and award pictures from your game. http://www.5th-gradient.com/vsp/
- 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:

CODE
    
    $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.

CODE

    $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
CODE
$vsp['password']="YourPassword";


Parsing the log file:

The easiest way parse your log file is to navigate to http://yourdomain/com/vsp/vsp.php 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:
CODE
-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 "ftp://yourftp.com/log.log"

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://131rb.trap17.com/stats/pub/themes/bismarck/index.php

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. biggrin.gif

 

 

 


Comment/Reply (w/o sign-up)

Luk4ward
i set up how u said all and got fatal error:

CODE

Fatal error: Call to undefined function: ftp_connect() in ***/stats/vsp.php on line 312


any ideas?

Comment/Reply (w/o sign-up)

shadowx
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.

Comment/Reply (w/o sign-up)

dk619animal
Thanks.

Comment/Reply (w/o sign-up)

DaEmOnFiRe
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 tongue.gif)

Comment/Reply (w/o sign-up)

Shining
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

Comment/Reply (w/o sign-up)

LDALucifer
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

Comment/Reply (w/o sign-up)

(G)

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


Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


Searching Video's for set, vsp, stats
See Also,
advertisement


How To Set Up Vsp Stats

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com