AlliedModders
XFactor Servers

[TF2 Stats] With Web Ranking and Item Logger [v6.6.4/6.7.0]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Donor
Join Date: Mar 2009
Plugin ID:
1274
Plugin Version:
6.6.4
Plugin Category:
Statistical
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Approver:
    Plugin Description:
    TF2 Stats: Easy installation, optional online multi-server database and web interface!
    Servers with this Plugin:
    135 
    Old 11-12-2009 , 04:38   [TF2 Stats] With Web Ranking and Item Logger [v6.6.4/6.7.0]
    Reply With Quote #1

    [TF2] Ranking and Item Logger
    Plugin Version 6.6.4
    Web Interface Version 6.7.0
    See next post for update info.
    Adaptation/Repost/Re-support of This Ranking Plugin.
    All credit for original plugin goes to it's
    original authors.




    Description:
    This is a TF2 ranking plugin with support for a web interface mysql, and multiple servers.
    It can operate in one of two modes:
    "Simple" which requires very little setup work.
    "Web" which requires more work but is well worth it. Supports multiple servers and a web interface if so desired.

    Demo:
    Main Page
    Items
    Note 'found items' section.
    Better demo page soon.

    Requirements:
    • 'Simple' mode:
      • One server (you can run more then one server like this but they will not share stats)
    • Multi-server / web interface mode
      • One or more servers.
      • Web server with MySql and php support.
      • Ability to allow remote access to MySql databases. (see below).
    Other Notes:
    I was reworking my copy of the web interface then decided to post it. After asking where I should post my upgrade, berni suggested I repost and support the entire plugin which is what I have done here.

    I plan to adopt this plugin and support/update it in the future.

    Chat Commands:
    "rank" to display your rank to the server.
    "top10" to view the top 10 ranked players.
    "players" to view a list of ingame players.
    "webrank" to get your webrank
    "webtop" to get the webtop
    "session" to get information about your session
    "hidepoints" to hide the points you get
    "unhidepoints" to show the points you get

    Cvars:
    sm_tf2_stats_version - shows the plugin version
    See tf2-stats.cfg for complete list
    Install Instructions:
    • Simple:
      1. Upload the .smx file to your /sourcemod/plugins/ folder
      2. Set point settings in tf2-stats.cfg and upload to your /tf/cfg/ folder.
    • Web Interface:
      1. Edit settings.php (in the "inc" folder).
      2. Upload web interface to desired location.
      3. 'Stop' or shutdown your game server.
      4. Install plugin as above.
      5. Add the following to your game server's database.cfg file located in /addons/sourcemod/configs.

    Detailed instructions

    (Thanks eraserhead!!)



    Database.cfg:
    Code:
    "tf2stats"
        {
            "driver"            "mysql"
            "host"                "127.0.0.1"
            "database"            "tf2_stats"
            "user"                "tf2st_usr"
            "pass"                "dbpassword"
            //"timeout"            "0"
            "port"            "3306"
        }
    Note:
    The server needs to be restarted for the database.cfg to be reloaded


    Notes:
    Make sure you allow your game server mysql access to your web server.

    ToDo:
    Add Steam avatar section for profile
    Add item stats page
    Add fancy javascript mouseover info for found items
    Add player name history
    Make changes to the player has connected from text.
    Track map statistics better.
    This.
    Add kills/deaths per class
    Fix player counting
    robot_arm_combo_kill

    Credits:
    Plugin, and original web interface to their respective authors.
    Me, for general updates, bug fixes and improvements to the web interface and any future updates.
    I accept no credit whatsoever for the work done by R_Hehl (aka R5053), Smokestormx, or anyone else.

    Web Version History:
    • Pre V6.0.0
    • V6.0.0
      • Added item support for hats (including spiffy icons!)
      • Fixed player names with non-standard characters displaying incorrectly.
      • Fixed various layout/graphical bugs/inconsistencies.
      • Added code to display "last played" time in 12 hour format instead of 24 hour.
      • Added the ability to set a dynamic website title.
    • V6.0.1
      • Fixed minor bug with nonexistent include file.
    • V6.5.1
      • Added steam community calculation and various related links.
    • V6.5.2
      • Hopefully fixed bug with php header (awaiting feedback)
    • V6.5.5
      • Fixed a SQL injection exploit. (Thanks to michaelh).
      • Fixed steam community id calculations for some people that were having bugs (Thanks Sobuno).
    • V6.6.0
      • Added support for new weapon kill statistics.
      • Better, more accurate naming of items.
    • V6.7.0
      • Remade all kill icons
      • Added new founditem icons for new weapons/hats, etc
      • Updated founditems list
    Plugin Version History:
    • V5.0
      • Same as posted here (No changes)
    • V6.0
      • Added new weapons from the soldier/demo update:
        rocketlauncher_directhit, pickaxe, taunt_soldier, sticky_resistance, sword, demoshield, taunt_demoman.
      • Added excluded weapons:
        deflect_flare, telefrag.
      • Fixed headshot tracking. (Thanks Sobuno)
    • V6.1
      • Hopefully fixed sqlite errors with the new weapons. (Thanks Sobuno)
    • V6.3
      • Added rank_ignorebots cvar to allow for blocking/unblocking bots from getting points
      • Changed plugin file name from n1g-tf2-stats.smx to TF2_Stats.smx
    • V6.4
      • Fixed bots getting points for killing buildings and capping points (rank_ignorebots).
      • Added kill tracking for "tribalkukri" (Tribalman's shiv).
      • Added kill tracking for "battleaxe" (Scotsman's skullcutter).
      • Added kill tracking for "ball" (Sandman baseball).
      • Added kill tracking for "paintrain" (Pain Train).
      • Added kill tracking for "sledgehammer" (Homewrecker).
      • Added kill tracking for "unique_pickaxe" (The Equalizer when player has less then 25 health).
      • Added kill tracking for "tf_pumpkin_bomb" (Pumpkin Bombs).
      • Added check to prevent running an old version alongside a new version (file check).
    • V6.5
      • Not released: Changes rolled into V6.6.
    • V6.6
      • Added kill tracking for:
        • Goomba Stomp (Mod)
        • The Lugermorph
        • The Big Kill
        • The Frontier Justice
        • The Wrangler
        • The Gunslinger
        • The Southern Hospitality
        • The Blender Taunt (Gunslinger Taunt)
        • The Guitar Taunt (Frontier Justice Taunt)
      • Fixed bots getting points for killing buildings (hopefully)
      • Now logs players' last used IPs
      • Changed all cvar descriptions (ingame) for easier reading
      • Reorganized handles and cvars in code (nothing you will notice).
      • Added some more mysql/php/html filters to player names.
      • Fixed incorrect building IDs
    • V6.6.1
      • Fixed kills with sentries not being tracked (bug introduced V6.5).
      • Now the plugin tracks kills per sentry level, as well as total sentry kills.
    • V6.6.2
      • Fixed issue an caused by a query buffer being too small and preventing players from being added to sqlite databases. Thanks InflatableSoulmate|BoC !!
    • V6.6.3
      • Added missing reflect_flare cvar
      • Fixed an apparent issue with mysql and UTF8 (Special-char names are now stored correctly).
    • V6.6.4
      • Corrected typo with reflect_flare cvar [Now: rank_deflect_flarepoints].
      • Tweaked the kill code related to bots.
      • Slightly changed the connect text. (Now "[Rank X out of X]" vs "[Rank X of X]" before).
    See next post for update instructions.

    Once again, all credit for this plugin and web interface goes to their original authors.
    I accept credit only for the changes I have made.

    Total lines of code: 4209
    Downloads since 6/10/10: 430



    SQLite users: Please give feedback on latest version!
    Attached Files
    File Type: zip TF2 Ranking Web Interface v6.7.0.zip (1.36 MB, 546 views)
    File Type: zip TF2 Stats Plugin V6.6.4.zip (71.1 KB, 262 views)
    __________________

    Last edited by DarthNinja; 08-27-2010 at 14:54.
    DarthNinja is offline
    DarthNinja
    SourceMod Donor
    Join Date: Mar 2009
    Old 11-12-2009 , 04:38   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #2

    Update Notes:

    • V6.5
      • Not released: Changes rolled into V6.6.
    • V6.6
      • Added kill tracking for:
        • Goomba Stomp (Mod)
        • The Lugermorph
        • The Big Kill
        • The Frontier Justice
        • The Wrangler
        • The Gunslinger
        • The Southern Hospitality
        • The Blender Taunt (Gunslinger Taunt)
        • The Guitar Taunt (Frontier Justice Taunt)
      • Fixed bots getting points for killing buildings (hopefully)
      • Now logs players' last used IPs
      • Changed all cvar descriptions (ingame) for easier reading
      • Reorganized handles and cvars in code (nothing you will notice).
      • Added some more mysql/php/html filters to player names.

    Updating:
    1. Make a backup of your ranking data (optional; recommended)
    2. Download TF2 Stats Plugin V6.6.zip
    3. Upload the new TF2_Stats.smx and other files to your servers plugins folder.
    4. Update your config file.
    5. Type [rcon] sm plugins reload TF2_Stats in console, or just restart the server.
    The plugin will auto-update your database when run.

    New cvars:
    Code:
    rank_maxgunpoints                            "3" //Sam and Max Pistol (The Lugermorph)
    rank_samrevolverpoints                        "3" //Sam and Max Revolver (The Big Kill)
    rank_goombastomp                            "6" //Goomba stomp (Goomba Stomp Mod)
    rank_frontier_justicepoints                    "3" //Frontier Justice
    rank_wrangler_points                        "4" //Wrangler (Manual sentry, any level)
    rank_robot_armpoints                        "5" //Gunslinger
    rank_southern_hospitalitypoints                "6" //Southern Hospitality
    rank_robot_arm_blender_points                "10" //Gunslinger Taunt
    rank_taunt_guitar_points                    "10" //Guitar Taunt (Frontier Justice)
    rank_logips                                    "1" //Log player's IP addresses (recommended)
    Note:
    The plugin now logs players' last used IP addresses by default, they are for administration use (not displayed publicly). I recommend you leave this on.

    Ether add them to your cfg, or upload the included copy which already has the cvars.

    Reset bots' ranking in database:
    1. Open your database in phpMyAdmin (Or with This App if you use SQLite) (Example)
    2. Browse to "Players" and search for "BOT" under the field SteamID (Example)
    3. Delete the record for Bot (Example)
    4. Done!

    Last edited by DarthNinja; 07-24-2010 at 01:28.
    DarthNinja is offline
    Ghost Killer
    Member
    Join Date: Aug 2009
    Old 11-12-2009 , 12:43   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #3

    The only thing you changed was the item found on webpage right? The database was already getting the hats? I thought in doing this same thing, since it would be very easy, but someone posted a ver better stats page and plugin (in beta phase), and I'd rather waiting for that...
    Ghost Killer is offline
    Evil-Dragon
    Junior Member
    Join Date: Oct 2009
    Old 11-13-2009 , 16:31   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #4

    Only problem i have is
    Code:
    Warning:  include(inc/names.inc.php) [function.include]: failed to open stream: No such file or directory in /home/fhlinux209/e/evil-dragon.co.uk/user/htdocs/tf2server/top10.php on line 3
    
    Warning:  include(inc/names.inc.php) [function.include]: failed to open stream: No such file or directory in /home/fhlinux209/e/evil-dragon.co.uk/user/htdocs/tf2server/top10.php on line 3
    
    Warning:  include() [function.include]: Failed opening 'inc/names.inc.php' for inclusion (include_path='.:/usr/share/pear/') in /home/fhlinux209/e/evil-dragon.co.uk/user/htdocs/tf2server/top10.php on line 3
    
    __________________
    Evil-Dragon is offline
    DarthNinja
    SourceMod Donor
    Join Date: Mar 2009
    Old 11-13-2009 , 16:46   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #5

    @Evil-Dragon
    Thanks for catching that, I fixed it in V6.0.1
    You can also create a blank text file in /inc/ called "names.inc.php" that will fix it.
    __________________
    DarthNinja is offline
    Evil-Dragon
    Junior Member
    Join Date: Oct 2009
    Old 11-13-2009 , 16:46   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #6

    Thanks, i figured it out to add a blank file in the end.

    Suggestion: Also add a tf2items backpack link to the userpage under Steam Community?

    Format is http://www.tf2items.com/profiles/xxxxxxxxxxxxxx (where xxxxxxx is the steam userid)
    __________________
    Evil-Dragon is offline
    DarthNinja
    SourceMod Donor
    Join Date: Mar 2009
    Old 11-13-2009 , 16:52   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #7

    Yea I'm planning to add that once I figure out how to calculate profile ids from steam ids.
    -Added to todo list
    __________________
    DarthNinja is offline
    Evil-Dragon
    Junior Member
    Join Date: Oct 2009
    Old 11-13-2009 , 16:57   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #8

    Will this help?

    Code:
    <?php function steam2friend($steam_id){
        $steam_id=strtolower($steam_id);
        if (substr($steam_id,0,7)=='steam_0') {
            $tmp=explode(':',$steam_id);
            if ((count($tmp)==3) && is_numeric($tmp[1]) && is_numeric($tmp[2])){
                return bcadd((($tmp[2]*2)+$tmp[1]),'76561197960265728');
            }else return false;
            }else{
                return false;
            }
        }  
    ?>
    I used that in a bit of backend coding i found to translate steam_id's to community id's. You can see it in use here: http://www.evil-dragon.co.uk/itemlog/

    It took me a while to get it working with my limited knowledge of php.

    Also there appears to be a problem with the statistic "Intel Captured" it is recording one for every player on red/blu whenever someone else captures the intel.
    __________________

    Last edited by Evil-Dragon; 11-13-2009 at 17:24.
    Evil-Dragon is offline
    Ginxeng
    Member
    Join Date: Nov 2009
    Location: Timber Doodle
    Old 11-16-2009 , 19:02   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #9

    I starting using this last night and it seems to works, it logs the stats and everything but the only thing I'm having problems with is that I get this at the top of the page.

    Code:
    Warning: include(inc/names.inc.php) [function.include]: failed to open stream: No such file or directory in /home/assas651/public_html/TF2 Ranking/index.php on line 3
     
    Warning: include() [function.include]: Failed opening 'inc/names.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/assas651/public_html/TF2 Ranking/index.php on line 3
    Here is the page if you want to look at it.http://www.assassinsunknown.com/TF2%20Ranking/

    Last edited by Ginxeng; 11-16-2009 at 19:07.
    Ginxeng is offline
    Send a message via AIM to Ginxeng Send a message via MSN to Ginxeng
    DarthNinja
    SourceMod Donor
    Join Date: Mar 2009
    Old 11-16-2009 , 22:14   Re: TF2 Stats With Web Ranking and Item Logger
    Reply With Quote #10

    Quote:
    Originally Posted by Ginxeng View Post
    I starting using this last night and it seems to works, it logs the stats and everything but the only thing I'm having problems with is that I get this at the top of the page.
    Thanks, I'd fixed that but stupid 7-Zip (more my fault, but I'd rather blame the program) didn't replace the files when I updated them.

    It's fixed now, grab a new copy
    __________________
    DarthNinja is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 13:18.


    Powered by vBulletin® Version 3.8.1
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
    Theme made by Freecode Sponsored by Layered Technologies