Raised This Month: $51 Target: $400
 12% 

[TF2] Item Logger (With Web Panel)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Geit
Senior Member
Join Date: Oct 2009
Location: Home
Plugin ID:
1979
Plugin Version:
2.04
Plugin Category:
Statistical
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Logs item interactions to database
    Old 10-01-2010 , 18:51   [TF2] Item Logger (With Web Panel)
    Reply With Quote #1

    Logs item interactions (finds, crafts, trades, purchases, unboxings, giftings, earnings and refunds) to database for statistical analysis.

    Working Examples:
    http://items.degree-gaming.com/
    http://www.bigbanggamers.com/drops/

    Updating to 2.02 from 1.11:
    1. Upload the web panel files
    2. Fill out system/includes/config.php
    3. Run update.php
    4. Run convert.php
    5. Delete update.php and convert.php
    6. Rename the "feedback" database config to "itemlogger2"
    7. Upload a new copy of the plugin
    8. Restart server.

    Changelog:

    2.04:
    • (Plugin) Made sure FetchRow is called successfully before attempting to retrieve values.
    • (Web) Updated Item Methods
    • (Web) Fixed updater script - thanks PolyQuad!
    2.03:
    • (Plugin) Will now attempt to reconnect to the database server if the handle becomes invalid.
    • (Plugin) Removed the use of GetInsertID in favor of just doing another threaded query: as it does not appear to function correctly on local result sets in some cases.
    2.02:
    • (Web) Added Pagination
    • (Web) Fixed (X)HTML non-compliance
    • (Web) Escaping output now (Critical)
    • (Web) Updated Jquery to 1.6.4
    • (Plugin) Fixed sourcemod errors on player/server inserts
    • (Plugin) Fixed a required server restart for plugin updates/reloads - still recommended though!
    2.01:
    • Rewrote the web panel with numerous improvements
      • Less barebones, comes with dedicated style.
      • Improved Speed
      • Improved update.php
    • Redesigned the database schema to be more efficient
    • Rewrote the plugin from scratch around Valve changes.
    • Changed the database config from "feedback" to "itemlogger2"
    • Probably some other stuff I don't remember.
    1.11
    • Added a check to prevent the plugin from logging two sets of item notifications when using my Fast Item Hook plugin
    1.1
    • Fixed a UTF-8 Issue with the plugin
    • Numerous web panel fixes
    Cvars:
    • sm_item_logger_version - Version
    Plugin Installation
    1. Create a configuration named "itemlogger2" in your databases.cfg like so:
      Code:
      "itemlogger2"
          {
              "driver"            "mysql"
              "host"                "localhost"
              "database"            "sourcemod"
              "user"                "user"
              "pass"                "password"
          }
    2. Drop the compiled plugin into your plugins dir
    Web Panel Installation
    1. Fill in the variables in system/includes/config.php - You can get an API key from here: http://steamcommunity.com/dev/apikey
    2. Navigate to update.php in your browser, wait for it finish loading (can take up to 2 minutes)
    3. Delete update.php and convert.php
    4. Index.php should now be working.
    5. (When the game is updated with new items, simply rerunning update.php will update your panel with the new items)
    Credits
    rack_gothroach - Massive amount of help with the web panel
    Darkimmortal - Daemon and Original Web code
    Geit - Updated Plugin/Web code
    Nineaxis - Web panel design for >2.0

    Troubleshooting:

    If you get a table does not exist error upon visiting the web panel, ensure that your database details in config.php match those you set for the plugin then use this query:

    Code:
    CREATE TABLE IF NOT EXISTS `itemlogger2_finds` (`id` int(11) unsigned NOT NULL AUTO_INCREMENT,`player_id` int(11) unsigned NOT NULL DEFAULT '0',`server_id` int(11) unsigned NOT NULL DEFAULT '0',`player_count` tinyint(3) unsigned NOT NULL DEFAULT '0',`item_index` int(11) NOT NULL DEFAULT '0' COMMENT 'signed int, 32 bit',`method` tinyint(2) NOT NULL DEFAULT '0',`quality` tinyint(2) NOT NULL DEFAULT '0',`time` int(11) unsigned NOT NULL DEFAULT '0',PRIMARY KEY (`id`),KEY `actual_time` (`time`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
    CREATE TABLE IF NOT EXISTS `itemlogger2_items` (`id` int(11) unsigned NOT NULL DEFAULT '0',`item_name` tinytext,`proper_name` tinyint(1) DEFAULT NULL,`item_slot` varchar(16) DEFAULT NULL,`image_url` tinytext,`material_type` varchar(16) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `itemlogger2_players` (`id` int(11) unsigned NOT NULL AUTO_INCREMENT,`steam_id` varchar(25) NOT NULL DEFAULT '',`name` varchar(32) DEFAULT NULL,`avatar` tinytext,`avatar_last_updated` int(11) DEFAULT NULL,PRIMARY KEY (`id`),UNIQUE KEY `steam_id` (`steam_id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `itemlogger2_qualities` (`id` tinyint(3) unsigned NOT NULL,`name` varchar(32) DEFAULT '0',`raw_name` varchar(32) DEFAULT '0',PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    CREATE TABLE IF NOT EXISTS `itemlogger2_servers` (`id` int(11) unsigned NOT NULL AUTO_INCREMENT,`ip` varchar(16) DEFAULT '127.0.0.1',`port` smallint(5) unsigned DEFAULT '27015',`name` tinytext,PRIMARY KEY (`id`),UNIQUE KEY `ip_port` (`ip`,`port`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    Attached Files
    File Type: zip release.zip (220.0 KB, 734 views)
    File Type: sp Get Plugin or Get Source (itemlogger.sp - 1467 views - 8.6 KB)

    Last edited by Geit; 02-13-2015 at 09:36.
    Geit is offline
    aRcTiC
    SourceMod Donor
    Join Date: Apr 2010
    Old 10-01-2010 , 23:57   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #2

    nice work
    drinking_hat.png can't download and you should add pagination to the page
    aRcTiC is offline
    Geit
    Senior Member
    Join Date: Oct 2009
    Location: Home
    Old 10-02-2010 , 03:44   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #3

    Quote:
    Originally Posted by aRcTiC View Post
    nice work
    drinking_hat.png can't download and you should add pagination to the page
    If anything can't be gotten from the TF2 WebAPI it should be reported here: http://wiki.teamfortress.com/wiki/Talk:WebAPI - I've added it myself now, although there is no mention of the Rimmed Raincatcher on the wiki, and I'll also add pagination & add the "Powered By Steam" text to the footer when I get home.

    Last edited by Geit; 10-02-2010 at 03:58.
    Geit is offline
    aRcTiC
    SourceMod Donor
    Join Date: Apr 2010
    Old 10-02-2010 , 04:10   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #4

    Quote:
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in avatars_cron.php on line 10
    get that when trying to get profile avatars and also unknown server

    Last edited by aRcTiC; 10-02-2010 at 04:17.
    aRcTiC is offline
    Geit
    Senior Member
    Join Date: Oct 2009
    Location: Home
    Old 10-02-2010 , 04:24   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #5

    Quote:
    Originally Posted by aRcTiC View Post
    get that when trying to get profile avatars and also unknown server
    Have you filled out the variables at the top of the cron and filled out the servers array correctly (at the top of index.php)?
    Geit is offline
    Geit
    Senior Member
    Join Date: Oct 2009
    Location: Home
    Old 10-02-2010 , 16:33   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #6

    Updated the web panel:
    • Added "Powered by Steam" text
    • Added pagination, the PERPAGE define at the top of index.php controls how many rows are shown per page
    • Added Search
    • Fixed the cron script reporting invalid resource
    Geit is offline
    aRcTiC
    SourceMod Donor
    Join Date: Apr 2010
    Old 10-02-2010 , 19:44   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #7

    you forgot teh function again
    Quote:
    Fatal error: Call to undefined function steam2friend() in drops\avatars_cron.php on line 12
    also i deleted the extra drop in 'drop/index.php' in 3 places i saw in index.php because that produces drop/drop/index.php which didnt work for me

    i did add my servers ip address but still unknown server, i check the database and it says the right ports but all localhost:27015(6)(7), i am hosting web, mysql and tf2 on the same pc, maybe i have to use my external ip in database.cfg?

    edit:
    possible to just view avatars directly from steam instead of downloading them first?

    Last edited by aRcTiC; 10-02-2010 at 19:52.
    aRcTiC is offline
    bouncer
    Veteran Member
    Join Date: Apr 2009
    Old 10-02-2010 , 20:20   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #8

    I can't see anywhere in first post where is the MYSQL Query that needs to be run in order to create the tables/columns??

    Also when I go to http://www.brotherhoodofgamers.com/tf2itemlogger/
    I get the error: Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/brother6/public_html/tf2itemlogger/index.php on line 45
    __________________


    bouncer is offline
    Geit
    Senior Member
    Join Date: Oct 2009
    Location: Home
    Old 10-03-2010 , 02:27   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #9

    Quote:
    Originally Posted by aRcTiC View Post
    you forgot teh function again
    also i deleted the extra drop in 'drop/index.php' in 3 places i saw in index.php because that produces drop/drop/index.php which didnt work for me

    i did add my servers ip address but still unknown server, i check the database and it says the right ports but all localhost:27015(6)(7), i am hosting web, mysql and tf2 on the same pc, maybe i have to use my external ip in database.cfg?

    edit:
    possible to just view avatars directly from steam instead of downloading them first?
    Cheers for pointing that out, The way I'm updating this is a that I'm updating our own version of the web panel which hooks into vB, so i end up adding extra stuff that I forget to remove, sorry.

    What are the Ip's being logged as on your mysql? - The array should match the ones specified there. If it does, can you post up/PM the full array at the top of index.php

    It is possible to get steam avatars without first downloading them, but it requires the use of Javascript (or a very long load time), which the in-game browser doesn't support.

    @Bouncer: The Tables are created by the plugin when it successfully connects to your database

    Anyway, Reuploaded the web panel, sorry for the mistakes
    Geit is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 10-03-2010 , 05:11   Re: [TF2] Item Logger (With Web Panel)
    Reply With Quote #10

    Great system, found a few issues though.

    Line 189 of index.php needs the / in the beginning of the string removed.

    In avatars_cron.php there are a few issues:
    $path_to_avatars should have "avatars/" added on directly in the variable.
    The first time $xml is set should be removed, as it's switched to use the web api below it.
    Then the correct way to get the avatar would be $profile->players->player->avatarmedium.
    __________________

    Last edited by asherkin; 10-03-2010 at 05:14.
    asherkin is offline
    Reply



    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 16:12.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode