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

[ANY] Player Analytics


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Plugin ID:
3984
Plugin Version:
1.3.1
Plugin Category:
Statistical
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    81 
    Plugin Description:
    Logs detailed statistics for all connecting players
    Old 12-02-2013 , 21:33   [ANY] Player Analytics
    Reply With Quote #1

    [ANY] Player Analytics

    v1.3.1

    Description:
    This plugin logs detailed statistics of all connecting players to a MySQL table. Stats that are logged include:
    • Server IP
    • Player name
    • Steam ID
    • Time of connection (as Unix timestamp)
    • Date of connection
    • Connection method (on games that support cl_connectmethod)
    • Number of players in-game at time of connection
    • Current map at time of connection
    • Duration of play session
    • User admin flags
    • User IP
    • Player's city, region, 2-letter country code, and 3-letter country code (requires GeoIPCity)
    • Player's country
    • Player's F2P/Premium status (TF2 only, requires SteamTools)
    • Player's HTML MOTD preference (enabled/disabled)
    • Player's operating system

    There will be a web interface later with which you can view the stats. In the meantime, you'll have to use something like phpMyAdmin to see the raw logs.

    Cvars:
    • player_analytics_version - plugin version
    • player_analytics_auto_update - enables automatic updating (has no effect if Updater is not installed)

    Developers:
    Player Analytics has an API with which you can get player connection IDs. See the include file.

    Requirements:
    Both of these extensions are optional dependencies. That is, they are not required for the plugin to operate.
    • GeoIPCity - Required to look up players' cities, regions, and country codes
    • SteamTools - Required to detect the server's public IP behind a NAT and to look up Premium/F2P status on TF2

    Installation:
    This plugin requires a MySQL database. It will first look for a configuration named "player_analytics", and will fall back to "default" if one is not found. Example:

    Code:
        "player_analytics"
        {
            "driver"            "mysql"
            "host"                "example.com"
            "database"            "example_database"
            "user"                "exampleuser"
            "pass"                "examplepassword"
            //"timeout"            "0"
            "port"                "3306"
        }
    This should go in databases.cfg.

    Install any optional extension dependencies that you want, and then put player_analytics.smx into /addons/sourcemod/plugins and os_detect.games.txt into /addons/sourcemod/gamedata and reboot your server or type "sm plugins load player_analytics" into your console or rcon.

    Auto Update:
    Install Updater. The plugin will be auto-updated according to your Updater settings. It'll work without Updater.

    Changelog:
    • v1.3.0 (4/3/15)
      • Plugin now uses utf8 queries
    • v1.2.0 (3/31/15)
      • Added plugin API
    • v1.1.0 (12/7/13)
      • Updated OS detection
    • v1.0.0 (12/2/13)
      • Initial release

    Download Plugin (player_analytics.zip)

    .zip file includes plugin, gamedata, source, and include file

    Requires updater.inc and mckayupdater.sp to compile.
    ______________________________

    I have attached a development preview of the web panel. It's still in development so there are a lot of broken links and placeholder items. Simply set your variables in config_example.php and rename it to config.php

    Web panel is by rannmann.
    Attached Files
    File Type: zip rannmann-player-analytics-preview1.zip (325.4 KB, 3737 views)
    __________________

    Last edited by Dr. McKay; 07-14-2020 at 05:05.
    Dr. McKay is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 12-02-2013 , 21:34   Re: [ANY] Player Analytics
    Reply With Quote #2

    The development web panel is very limited, and a community member has taken it on themselves to build on it. You may want to use it:

    https://forums.alliedmods.net/showpo...8&postcount=69
    __________________

    Last edited by Dr. McKay; 03-21-2014 at 21:31.
    Dr. McKay is offline
    ocwoody
    AlliedModders Donor
    Join Date: Nov 2010
    Location: huh
    Old 12-02-2013 , 23:18   Re: [ANY] Player Analytics
    Reply With Quote #3

    Awesome! Thanks for releasing this!
    ocwoody is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 12-03-2013 , 00:25   Re: [ANY] Player Analytics
    Reply With Quote #4

    I've attached a development preview of the web panel to the main post.
    __________________
    Dr. McKay is offline
    Mirandor
    Senior Member
    Join Date: Jun 2006
    Location: Ile de France
    Old 12-03-2013 , 13:08   Re: [ANY] Player Analytics
    Reply With Quote #5

    hi,
    does or will it store multiple player names?
    Mirandor is offline
    nomy
    Senior Member
    Join Date: Dec 2009
    Location: United Kingdom
    Old 12-03-2013 , 13:18   Re: [ANY] Player Analytics
    Reply With Quote #6

    Very useful! Thanks Dr. McKay!
    nomy is offline
    Impact123
    Veteran Member
    Join Date: Oct 2011
    Location: Germany
    Old 12-03-2013 , 13:28   Re: [ANY] Player Analytics
    Reply With Quote #7

    Is there a reason why you connect non-threaded to the database?
    In some countries it's not permitted (or atleast it's a grey area) to store dynamic ip's, you might want to add an option to anonymize it.
    Some of the columns are a little bit too big (auth and ip for example), sure it makes no big difference, but it sums up for long-term data like this.
    __________________

    Last edited by Impact123; 12-03-2013 at 13:56.
    Impact123 is offline
    matrixmark
    Senior Member
    Join Date: Jun 2010
    Old 12-03-2013 , 13:36   Re: [ANY] Player Analytics
    Reply With Quote #8

    This looks awesome.

    Will be giving it a try tonight
    __________________

    matrixmark is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 12-03-2013 , 13:49   Re: [ANY] Player Analytics
    Reply With Quote #9

    Quote:
    Originally Posted by Impact123 View Post
    Is there a reason why you connect non-threaded to the database?
    In some countries it's not permitted (or atleast it's a grey area) to store dynamic ip's, you might want to add an option to anonymize it.
    Some of the columns are a little bit too big (auth and ip for example), sure it makes no big difference, but it sums up for long-term data like this.
    SQL_TQuery doesn't support the persistent parameter, and I like to conserve connections. Since it only connects on plugin startup, it won't block the server since realistically plugin startup will only be on server startup.

    I find it somewhat questionable that it wouldn't be legal to store the IP address associated with a connection. If that were the case, then SRCDS itself would be in question due to its logs, which are stored indefinitely. If you can provide me a source, I might be able to add an option to not log IPs.
    __________________
    Dr. McKay is offline
    Impact123
    Veteran Member
    Join Date: Oct 2011
    Location: Germany
    Old 12-03-2013 , 14:07   Re: [ANY] Player Analytics
    Reply With Quote #10

    An threaded connection handle stays valid until you close it, persistant connections are kinda default for it.
    __________________

    Last edited by Impact123; 12-03-2013 at 14:20.
    Impact123 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 07:37.


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