Setup your XLRstats plugin

Setting up your plugin is done by modifying the configuration file: b3/extplugins/conf/plugin_xlrstats.ini

Below is the basic configuration file for the XLRstats plugin that comes with the B3 distribution. You can add several advanced settings to the config for tailor made setups.


The basic configuration file that comes with the B3 distribution:

plugin_xlrstats.ini
[settings]
# the minimum amount of players to start collecting stats - to prevent stat manipulation (padding/harvesting)
minplayers: 3
 
# Level a player must have to have it's stats collected.
minlevel: 0
 
# penalty percentage to reduce skill on suicide
suicide_penalty_percent: 0.05
# penalty percentage to reduce skill on teamkill
tk_penalty_percent: 0.1
 
# If you run a server serving one map only, this may be set to true for better map/round counting
onemaponly: no
 
# provisional ranking means that the first Kswitch_confrontations are used only to determine the new players base skill
# the opponents skill will not be changed during this period
# when minlevel = 0 this is highly recommended!
provisional_ranking: yes
 
# automatically purge players from xlrstats after a year of inactivity? (cannot be undone!)
auto_purge: no
 
# hide_bots : exclude the bots from the web frontend - allowed value: yes or no
hide_bots: yes
 
# exclude_bots: do not count kills and damages to and from bots - allowed value: yes or no
exclude_bots: yes
 
# silent: silence the enabled/disabled message on map/round start - allowed value: yes or no
silent: no
 
# The next settings enable the plugin to retrieve certain config settings from your webfront install
# This will make topstats return the same results as the web front.
# You'll need at least web frontend version 2.2 for this to work.
webfrontversion: 2
 
# webfronturl: The address of your XLRstats website. Example, http://www.yoursite.com/xlrstats
webfronturl:
 
# servernumber: This is the server number in your web frontend configuration.
# If you use XLRstats v2 and only one server, then set this value to 0 !
#
# For XLRstats v3 refer to the value of the server URL.
# Example, for http://xlrstats.com/1 is the value 1
servernumber: 0
 
# *** assist bonus settings ***
# Call of Duty passes damage amount info to the logs. Therefore we can award assists based on damage.
# So in the CoD series we award an assist if the amount of damage is 50 points or more and they must occur
# within 10 seconds before the victim dies. In other games we shorten the timespan because we don't have
# the amount of damage available, we have to award all assists, even the very tiny ones. The shorter time
# compensates for that.
#
# damage_assist_release: timespan the assist must have taken place before the victim dies ( Call of Duty )
# damage_assist_release: 10
#
# assist_timespan: timespan the assist must have taken place before the victim dies ( Other than Call of Duty )
# assist_timespan: 2
 
[commands]
# This section defines the level required to use the commands
# 0 : guest
# 1 : user
# 2 : regular
# 20 : mod (moderator)
# 40 : admin
# 60 : fulladmin
# 80 : senioradmin
# 100 : superadmin
#
# Also, you can define command aliases by adding it after the command name, separating them with '-'.
# For example if you want to use !xtats instead of !xlrstats, use the name "xlrstats-xtats" when defining the command level below.
xlrstats: user
xlrtopstats: reg
xlrhide: fulladmin
xlrid: guest
 
[messages]
# cmd_xlrstats: Configure the message when someone use !xlrstats
# Available variables:
#                       $name       - the player name
#                       $kills      - kills made by the player
#                       $deaths     - player deaths
#                       $teamkills  - teamkills made by the player
#                       $ratio      - kill/death ratio
#                       $skill      - player skill
cmd_xlrstats: ^3XLR Stats: ^7$name ^7: K ^2$kills ^7D ^3$deaths ^7TK ^1$teamkills ^7Ratio ^5$ratio ^7Skill ^3$skill
 
# cmd_xlrstats: Configure the message when someone use !xlrtopstats
# Available variables:
#                       $number     - player number
#                       $name       - the player name
#                       $kills      - kills made by the player
#                       $ratio      - kill/death ratio
#                       $skill      - player skill
cmd_xlrtopstats: ^3# $number: ^7$name ^7: Skill ^3$skill ^7Ratio ^5$ratio ^7Kills: ^2$kills
 
[weapons]
# This section contains the configuration for weapons multipliers.
# Insert your weapon multipliers here, as they appear in the game log.
# See example below
bar_mp: 1.00
 
[actions]
# This section contains the configuration for action bonus.
# Insert your action bonus here, as they appear in the game log. See example below. default is a bonus of 3 points
hq_defend: 3.0
 
[replacements]
# Collecting MOD_*** instead of weapons.
# Good if you want to have bashes/melees collected instead of the weapon used to bash/melee the victim with
MOD_MELEE: mod_melee
MOD_FALLING: mod_falling
 
# Teamswitch Penalty supported by PowerAdmin for Urban Terror only! Harmless if left inhere.
Team_Switch_Penalty: Team_Switch_Penalty

Sharing B3 data, not Stats data: using alternate table names

When you are using one B3 database for multiple servers (eg. running 2 cod4 servers sharing B3 clients data) you can setup XLRstats so that each running instance of B3 (each server) stores its own XLRstats data. In other words, you share the clients between the different servers, but you keep different stats for the servers.

The default table names

When using a default setup you don't need to explicitly add the tables section to the plugin_xlrstats.ini file. It will use these names by default. But you can add a section if you need to change the table names for some reason.

The default section with default table names would look like this:

[tables]
# default table names
playerstats_table: xlr_playerstats
weaponstats_table: xlr_weaponstats
weaponusage_table: xlr_weaponusage
bodyparts_table: xlr_bodyparts
playerbody_table: xlr_playerbody
opponents_table: xlr_opponents
mapstats_table: xlr_mapstats
playermaps_table: xlr_playermaps
actionstats_table: xlr_actionstats
playeractions_table: xlr_playeractions
clients_table: clients
penalties_table: penalties
# default tablenames for the history subplugin
history_monthly_table: xlr_history_monthly
history_weekly_table: xlr_history_weekly
# default table name for the ctime subplugin
ctime_table: ctime

Adding a second set of tablenames

Above are the default tables names and like I mentioned you don't need to specify them for the first server.

But if you need to add a second server for separated stats, you will have to add another set of tables to the database yourself (or copy the default tables) 1) and tell the XLRstats plugin their names, so XLRstats knows where to store the data for the second server.

Assuming you add a trailing _2 to the tablenames for the second server you need to add a block like this to the plugin_xlrstats.ini:

[tables]
# table names for server 2
playerstats_table: xlr_playerstats_2
weaponstats_table: xlr_weaponstats_2
weaponusage_table: xlr_weaponusage_2
bodyparts_table: xlr_bodyparts_2
playerbody_table: xlr_playerbody_2
opponents_table: xlr_opponents_2
mapstats_table: xlr_mapstats_2
playermaps_table: xlr_playermaps_2
actionstats_table: xlr_actionstats_2
playeractions_table: xlr_playeractions_2
 
# tablenames for the history subplugin for server 2
history_monthly_table: xlr_history_monthly_2
history_weekly_table: xlr_history_weekly_2
 
# table name for the ctime subplugin for server 2
ctime_table: ctime_2
When using non-default tablenames you also need to tell the XLRstats webfront what these names are. Open the XLRstats website Dashboard, go to the Server Options for the specific server and click the tab Database Tables. Update the table names there.
Remember that you might also want other plugins to use a separate table to store data, like chatlog plugin or the status plugin. Consult the documentation of those plugins to see how you can achieve that.
1)
To add a new set of tables to the database you can best use a tool like phpMyAdmin and directly copy the required tables