AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Item Logger (With Web Panel) (https://forums.alliedmods.net/showthread.php?t=139492)

Geit 10-01-2010 18:51

[TF2] Item Logger (With Web Panel)
 
3 Attachment(s)
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 :3
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;


aRcTiC 10-01-2010 23:57

Re: [TF2] Item Logger (With Web Panel)
 
nice work
drinking_hat.png can't download and you should add pagination to the page

Geit 10-02-2010 03:44

Re: [TF2] Item Logger (With Web Panel)
 
Quote:

Originally Posted by aRcTiC (Post 1313522)
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.

aRcTiC 10-02-2010 04:10

Re: [TF2] Item Logger (With Web Panel)
 
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

Geit 10-02-2010 04:24

Re: [TF2] Item Logger (With Web Panel)
 
Quote:

Originally Posted by aRcTiC (Post 1313606)
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 10-02-2010 16:33

Re: [TF2] Item Logger (With Web Panel)
 
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

aRcTiC 10-02-2010 19:44

Re: [TF2] Item Logger (With Web Panel)
 
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?

bouncer 10-02-2010 20:20

Re: [TF2] Item Logger (With Web Panel)
 
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

Geit 10-03-2010 02:27

Re: [TF2] Item Logger (With Web Panel)
 
Quote:

Originally Posted by aRcTiC (Post 1314183)
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. :3

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

asherkin 10-03-2010 05:11

Re: [TF2] Item Logger (With Web Panel)
 
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.


All times are GMT -4. The time now is 01:59.

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