HLStatsX

From cAn's Crew

Jump to: navigation, search

HLStatsX does not have any software to run on the game server; it operates entirely by remote rcon commands. When a user types kpd, for example, this is broadcast to a remote server via the game logs. The server running the hlstatsx perl script then responds by sending some remote rcon commands that cause a menu to appear for the player running the kpd command.

It works similarly when it is time for team balancing; the remote server notices that the round is over (because that event is logged), runs code to balance the teams, and then issues remote rcon commands to swap the appropriate players.

Contents

[edit] Documentation

[edit] Known Issues

  • server location is shown in kansas; I think this is a bug in hlxcommunity
  • no nationality flags for ins [for some reason, every player's lastAddress is unset in the DB]

[edit] General

To restart the hlstatsx daemon, log onto cans-crew.com via ssh, then do

cd private/hlstatsx_community
./run_hlstats restart

In general, this should not be necessary, as there is a cron job run frequently that will restart this if needed.

[edit] Insurgency

[edit] Reference

[edit] Basic HLStatsX Setup

This is my server setup in hlstats.conf:

Servers[0] = ("AddressPort"                    => "8.9.30.107:27015",
             "MinPlayers"                     => "4",
             "AdminContact"                   => "yourmail@goes.here",
             "HLStatsURL"                     => "http://www.cans-crew.com/stats",
             "RawSocketSupport"               => "0",
             "RawSocketHelpNotice"            => "0",
             "DisplayResultsInBrowser"        => "1",
             "MasterServerData"               => "7",
             "MasterServerInterval"           => "200",
             "BroadCastEvents"                => "0",
             "BroadCastPlayerActions"         => "0",
             "BroadCastEventsCommand"         => "hlx_psay",
             "BroadCastEventsCommandSteamid"  => "1",
             "BroadCastEventsCommandAnnounce" => "hlx_csay",
             "PlayerEvents"                   => "1",
             "PlayerEventsCommand"            => "hlx_psay",
             "PlayerEventsCommandSteamid"     => "1",
             "PlayerEventsCommandOSD"         => "hlx_msay",
             "PlayerEventsAdminCommand"       => "",
             "ShowStats"                      => "1",
             "TKPenalty"                      => "50",
             "SuicidePenalty"                 => "5",
             "AutoTeamBalance"                => "1",
             "AutoBanRetry"                   => "0",
             "TrackServerLoad"                => "1",
             "MinimumPlayersRank"             => "0",
             "Admins"                         => "",
             "SwitchAdmins"                   => "0",
             "IgnoreBots"                     => "1",
             "SkillMode"                      => "0",
             "GameType"                       => "0",
             "Mod"                            => "BEETLE")

[edit] BeetlesMod HLStatsX Additions

This needs to be added to beetlesmod defaults.cfg to enable the player stats commands:

// Join 'Information Menu' Strings
addsaytrigger "rank" "admin_psay hlx" "2"
addsaytrigger "statsme" "admin_psay hlx" "2"
addsaytrigger "/rank" "admin_psay hlx" "2"
addsaytrigger "session" "admin_psay hlx" "2"
addsaytrigger "kpd" "admin_psay hlx" "2"
addsaytrigger "top10" "admin_psay hlx" "2"
addsaytrigger "next" "admin_psay hlx" "2"

[edit] Weapon Icons

For correct icons, download tob.zip from here (in this thread, there is a tob.zip file contributed by R3M). Unzip this file somewhere, and copy the corresponding .gifs and .bmps out of it to the corresponding location in your hlstatsx install. NOTE that I used "insurgency" as the game code in my HLStatsX web setup. If you use a different keyword (like "ins"), then it should be used below instead of the word "insurgency".

www/stats/hlstatsimg/game-insurgency.gif
www/stats/hlstatsimg/games/game-insurgency.bmp
www/stats/hlstatsimg/weapons/insurgency/*.gif

Weapons had to be inserted manually via the hlstatsx web configuration; the weapon codes are

weapon_m9       9 mm Beretta Pistol
weapon_makarov    Soviet Makarov Combat Pistol
weapon_ak47     AK-47 Awtomat Kalaschnikowa
weapon_aks74u    AKS-74U Awtomat Kalaschnikowa Ukorochennyj
weapon_fnfal    FN FAL Automatic Rifle
weapon_kabar    KA-BAR 12-inch Fighting Knife
weapon_bayonet        Last-Resort Advanced Combat Knife
weapon_l42a1    Enfield L42A1 Military Sniper Rifle
weapon_m4med    M4 Medium Range Rifle
weapon_m1014    M1014 Service Combat Shotgun
weapon_m14    Colt M14 Carbine
weapon_m16a4    M16A4 Infantry Rifle
weapon_m16m203    M16 carbine M203 Grenade Launcher
weapon_m18    M18 Rifle
weapon_m249    M249 SAW (Squad Automatic Weapon)
weapon_m4    M4 Carbine Rifle
weapon_m67    M67 Recoilless Rifle
weapon_rpk    RPK Ruchnoy Pulemyot Kalashnikova
weapon_sks    Simonov SKS carbine
weapon_svd    Dragunov Sniper Rifle
weapon_toz    TOZ Rifle
world        RPG or Granade

To insert/change entries manually (this is an example) (I used this to updated the kill counts on each one of these weapons, because the weapon names were input a few days after the beginning of stats taking).

mysql -hlocalhost -ucanopen_can -p###### 
use canopen_stats;
show tables;
select * from hlstats_Weapons;
describe hlstats_Weapons;
update hlstats_Weapons set kills=65 where code="weapon_m9";
quit;
Personal tools