Inactive [INFO] Statistician v2.0 - Detailed stats tracking [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Crimsonfox, Oct 15, 2011.

  1. Offline

    Crimsonfox

    Statistician v2.0 - Detailed stats tracking

    This is a continuation of ChaseHQ's original Statistician project which has unfortunately become inactive now. We hope to keep it going and bring you some brand new features! Check out the change log at the bottom for what we've done so far.

    Features
    • Tracks a number of different stats (list coming soon)
    • Comes with Web Portal to show off your stats to everyone!
    Downloads
    There are separate downloads for the web portal and plugin file. They can be found on our BukkitDev page:

    http://dev.bukkit.org/server-mods/statisticianv2/files/

    Installation (Plugin)
    1. Drop JAR file into plugin directory
    2. Run Bukkit once, it will make a config folder
    3. Create MySQL Database
    4. Create a user for that Database and grant it a ALL Privliges on that database
    5. Edit the config file with your database settings
    6. Start bukkit up again, it should connect and auto create the database
    Installation (Web Portal)
    1. Drop the web portal folder into a web served folder
    2. Open the config.php file in the Statistician folder
    3. Edit the database connection settings
    4. There is also a table in the Database called 'config' with some settings that are self explanatory
    Help
    Need some help? If you have any questions of comments then either leave it here on this thread or on our BukkitDev forum.
    Alternatively if you want to submit a problem then you can submit that to our Bukkit Dev ticket section.

    Source Code
    The project is open source and we encourage people to help us out. You can find the source for both the plugin and the web portal on our Git pages:

    https://github.com/Crimsonfoxy/Statistician
    https://github.com/Crimsonfoxy/Statistician_Web

    Changelog (plugin)
    • Version 2.02 (#1337) - 21/10/11
      • Fixed a bug when a Citizens NPC killed something
      • Updaed to #1337
      • Remove: Permission Statistician.ignoreOverride.
      • Fix: ClassCastException when a skeleton kills another creature. (Ticket #1)
      • Add: Minecraft 1.8 blocks and items to the database.
    • Version 2.0 (#1317) "Initial Release" - 15/10/11
      • Updated for latest RB
      • Updated for latest MC versio
      • Optimised parts of the plugin
    Changelog (web portal)
    • Version 2.01 (#1317) (Statistician JAR 2.02) - 16/10/11
      • Removed PHP error notices
    • Version 2.0 (#1317) (Statistician JAR 2.0) - 15/10/11
      • Faster queries (up to 10 times faster in some cases!
      • Some database optimisation

    Credits
    • Original Author: ChaseHQ
    • Current developers: Crimsonfox, Dazzel, Coryf88
     
    Tormus, M1sT3rM4n and Pimpen104 like this.
  2. Offline

    Afotai

    tdrive: There are more people who have this issue, theres a ticket on the tracker, and a post on the forums, yet there is no reply for quite some time already.
     
  3. Offline

    tdrive

    It is very strange because I have found this very day the answer.))

    mysql-> my.cnf ->

    thread_stack = 128K
    To replace
    thread_stack =256K
    Or it is more.

    It has helped me.

    And still there there can be errors from for codings of tables.
     
  4. Offline

    Dazzel

    We are aware of this issue but we do not have an idea why this error occures :( Also we do not have much time and we are only two effective devs...
     
  5. Offline

    Bench

    Thought should share what we've been working on utilizing Statistician v2.0
    We've utilized a similar premise to the original player list layout, we've added in our player ranking system into the mix:

    http://whopperohyeah.com/index.php?page=playerlist

    We've then built our own player management system for our community and tied it into our forums system, Statistician, and iConomy. The result is a achievement and awards system.
    http://whopperohyeah.com/index.php?page=player&uuid=b2ac621f-d241-4b67-80e1-e9f8915cdc27
    Players earn achievements by either playing on the server, where Statistician does all the grunt work, or through the forums/site. Tying it into iConomy means we can also reward players for achievements. Our own custom systems mean we can continue to add new types of achievements as necessary, as well as for special things.

    Only issue we've ran into is being able to force an update on our own systems at the same time Statistician does a database update. Perhaps something we can look into in the future for time-specific achievements so we can push what we're doing with Statistician even further.
     
  6. Offline

    Dazzel

    Looks realy nice though! :) As you noticed the development is slow at the moment, we would be happy to see more people to help us!
     
  7. Offline

    Afotai

    Could you tell us if you tested this version and if it worked? If so on what versions of mysql and php? It might be due to that
     
  8. Offline

    tdrive

    not use mysql functions
     
  9. Offline

    Dazzel

    I have tested it with php 5.3 and mysql 5.5
     
  10. Offline

    Afotai

    same versions as mine :(

    At first i did everything by the mysql terminal, then tried to make the database and user through phpmyadmin, and I get the same error each time

    Though I noticed that:

    There are a few corrupt tables when i try to use REPAIR from phpmyadmin, and this database is fresh

    see http://dl.dropbox.com/u/12046434/Naamloos.png
     
  11. Offline

    Bench

    One issue worth noting is that I had to run all our database queries prior to and require_once( on the statistician files.

    would be good if the connection Statistician made to mysql had the new_link parameter set to true, but it means then that every query needs to reference the connection object, i.e. mysql_query("SELECT * FROM players",$statisticanDB);

    This will definitely improve its connection with additional databases.
     
  12. Offline

    Dazzel

    This were also my first thought. If the server crashes while data is written to the DB you will get corrupt tables. Though the new querys will mostly fail..
    Yeah, right. But the problem is not the webinterface ;)
     
  13. Offline

    fjutte

    does this work with bukkit for 1.1?
     
  14. Offline

    Coryf88

    v2.0.6 should work with Minecraft 1.1. An update specifically for 1.1 will be released in a day or so though.
     
  15. Offline

    simphax

    Hey, how is it going with the new web portal?
     
  16. Offline

    Dazzel

  17. Offline

    Tormus

    Hi, SQL error when i want see players' list and statistics.
    Look : http://minefarm.olympe-network.com/stats/?view=playerList

    Code:
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in code overridden on append 96 on line 1
     
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in code overridden on append 96 on line 1
    or

    Code:
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in code overridden on append 96 on line 1
     
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in code overridden on append 96 on line 1
     
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in code overridden on append 96 on line 1
     
    Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in code overridden on append 96 on line 1
    I have Statistician 2.0.6 and Web Portal 2.0.2a, incompatible ?

    Sorry for my English (I'm French), please help me. Thank you !
     
  18. Offline

    Dazzel

    I would say your mysql server does not accept so much connections. So the server refuses the querys after a while.
     
  19. Offline

    Crayder

    Really amazing plugin, but can someone address this for me:
    Code:
    2012-02-23 16:53:51 [SEVERE] Exception in thread "pool-2-thread-2" 
    2012-02-23 16:53:51 [SEVERE] java.lang.NumberFormatException: null
    2012-02-23 16:53:51 [SEVERE]at java.lang.Long.parseLong(Unknown Source)
    2012-02-23 16:53:51 [SEVERE]at java.lang.Long.parseLong(Unknown Source)
    2012-02-23 16:53:51 [SEVERE]at com.ChaseHQ.Statistician.EventDataHandlers.EDHPlayer$1.run(EDHPlayer.java:41)
    2012-02-23 16:53:51 [SEVERE]at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    2012-02-23 16:53:51 [SEVERE]at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    2012-02-23 16:53:51 [SEVERE]at java.lang.Thread.run(Unknown Source)
     
  20. Offline

    miner345

    I have a problem: some players don't appear on the stats (sry for my bad english)
    Is ist maybe, because they didn't bought Minecraft???
    // Edit: No, this can't be true. Just found somebody with cracked MineCraft on the stats!
    But I need still help!
    // Fixed: Now I don't need help anymore!!!
    The problem was: I had all permissions with '*' so I had also the permission 'Statistician.ignore'
    I removed it and now I'm also on the Stats XD
    -----------------------------------------------------------------------------------------------------------------
    Great Plugin!!! I long searched for something like this!!!
     
  21. Offline

    rmkilc

    How are UUIDs generated? I am still having the problem with the UUID for a player switching, so then the player has two sets of stats as they are basically in the database twice. I wrote some simple scripts to combine the stats for the affected player to their new UUID, but it is painful.

    Sent from my Atrix using Tapatalk 2 Beta-6
     
  22. Offline

    Coryf88

  23. Offline

    rmkilc

    Ok, that makes sense. Does anyone have any SQL code to fix the affected players in one shot, rather than manually fixing parts of it?
     
  24. Offline

    rmkilc

    I threw this together as a tool to fix my database when a player's UUID changes. It works great for me, so I thought I would share it. Of course, I accept no responsibility if it messes things up for you (always make backups!!), starts your house on fire, or formats your hard drive. :eek:

    PHP:
    <?php
    mysql_connect
    ('localhost''USERNAME''PASSWORD') or die;//Username and Password here
    mysql_select_db('DATABASE') or die;//Database name here
     
        
    if (isset($_GET['player'])) {
            
    $name $_GET['player'];
     
            
    $res mysql_query("SELECT COUNT(player_name) AS player_name FROM players WHERE player_name='{$name}'");
                
    $row mysql_fetch_array($res);
                
    $count $row['player_name'];
     
                if (
    $count == '2') {
     
                    
    //get old uuid
                    
    $res mysql_query("SELECT uuid, last_logout FROM players WHERE player_name='{$name}' GROUP BY last_logout ASC LIMIT 1");
                        while (
    $else mysql_fetch_array($res))
                        {
                            
    $olduuid $else['uuid'];
                        }
                    
    //get new uuid
                    
    $res mysql_query("SELECT uuid, last_logout FROM players WHERE player_name='{$name}' GROUP BY last_logout DESC LIMIT 1");
                        while (
    $else mysql_fetch_array($res))
                        {
                            
    $newuuid $else['uuid'];
                        }
     
                    
    //fix blocks
                    
    $res mysql_query("SELECT block_ID, SUM(num_destroyed) AS num_destroyed, SUM(num_placed) AS num_placed FROM blocks WHERE UUID='{$olduuid}' OR UUID='{$newuuid}' GROUP BY block_ID");
                        while (
    $else mysql_fetch_array($res))
                        {
                            
    mysql_query("DELETE FROM blocks WHERE (UUID='{$olduuid}' OR UUID='{$newuuid}') AND block_ID='".$else['block_ID']."'");
                            
    mysql_query("INSERT INTO blocks (uuid, block_ID, num_destroyed, num_placed)
                                        VALUES ('
    {$newuuid}', '".$else['block_ID']."', '".$else['num_destroyed']."', '".$else['num_placed']."')");
                        }
     
                    
    //fix pickup_drop
                    
    $res mysql_query("SELECT item, SUM(num_pickedup) AS num_pickedup, SUM(num_dropped) AS num_dropped FROM pickup_drop WHERE UUID='{$olduuid}' OR UUID='{$newuuid}' GROUP BY item");
                        while (
    $else mysql_fetch_array($res))
                        {
                            
    mysql_query("DELETE FROM pickup_drop WHERE (UUID='{$olduuid}' OR UUID='{$newuuid}') AND item='".$else['item']."'");
                            
    mysql_query("INSERT INTO pickup_drop (uuid, item, num_pickedup, num_dropped)
                                        VALUES ('
    {$newuuid}', '".$else['item']."', '".$else['num_pickedup']."', '".$else['num_dropped']."')");
                        }
     
                    
    //fix kills
                    
    mysql_query("UPDATE kills SET killed_by_uuid = replace(killed_by_uuid, '{$olduuid}', '{$newuuid}')");
                    
    mysql_query("UPDATE kills SET killed_uuid = replace(killed_uuid, '{$olduuid}', '{$newuuid}')");
     
                    
    //fix player
                    
    $res mysql_query("SELECT player_name, MIN(firstever_login) AS firstever_login, SUM(num_logins) AS num_logins, SUM(num_secs_loggedon) AS num_secs_loggedon, SUM(distance_traveled) AS distance_traveled, SUM(distance_traveled_in_minecart) AS distance_traveled_in_minecart, SUM(distance_traveled_in_boat) AS distance_traveled_in_boat, SUM(distance_traveled_on_pig) AS distance_traveled_on_pig FROM players WHERE UUID='{$olduuid}' OR UUID='{$newuuid}' GROUP BY player_name");
                        while (
    $else mysql_fetch_array($res))
                        {
                            
    mysql_query("UPDATE players SET firstever_login='".$else['firstever_login']."', num_logins='".$else['num_logins']."', num_secs_loggedon='".$else['num_secs_loggedon']."', distance_traveled='".$else['distance_traveled']."', distance_traveled_in_minecart='".$else['distance_traveled_in_minecart']."', distance_traveled_in_boat='".$else['distance_traveled_in_boat']."', distance_traveled_on_pig='".$else['distance_traveled_on_pig']."' WHERE UUID='{$newuuid}'");
                            
    mysql_query("DELETE FROM players WHERE UUID='{$olduuid}'");
                        }
     
                    echo 
    $name.' was in the database twice.<BR/>Cleanup was performed.';
     
                } else if (
    $count == '1') {
     
                    echo 
    $name.' is in the database only once, so no cleanup is needed!';
     
                } else if (
    $count == '0') {
     
                    echo 
    $name.' is not in the database!';
     
                } else {
     
                    echo 
    $name.' is in the database more than twice, so you got problems bigger than the scope of this script!';
     
                }
     
            echo 
    '<BR/><BR/><a href="'.$_SERVER['PHP_SELF'].'">back</a>';
     
        } else {
     
            
    $res mysql_query("SELECT COUNT(*) AS Rows, player_name FROM players GROUP BY player_name ORDER BY Rows DESC");
                while (
    $else mysql_fetch_array($res))
                {
                    echo 
    $else['Rows'];
                    echo 
    ' ';
                    echo 
    '<a href="?player='.$else['player_name'].'">'.$else['player_name'].'</a>';
                    echo 
    '<BR/>';
                }
     
        }
     
    mysql_close();
    ?>
     
  25. Offline

    8_year_old

    I know this may sound like a very dumb question but I have my server hosted over at beastnode.com
    We have a mysql database set up and it's used primarily for logblock
    I have downloaded and placed the statistician.jar file into my plugins folder, and set up the config file correctly.
    I booted up the server and watched as statistician launched successfully.

    Now it's down to the web portal. I'm not sure if I'm doing this right, so I'll explain what I've done:

    I took the statistician.zip file and unzipped it. I then went inside and found the config file and set it up just as I did with the plugin config file. Okay.

    Then I took that folder and figured it'd time to put it somewhere. But I don't know where.

    Normally when I access the files on my beastnode server, I use an FTP program called Filezilla. I opened Filezilla and took the usual route I take to add/drop plugins into the server. I went up a couple of layers until I was in the same directory where our world folders are located. Then I placed the statician folder inside of there.

    Now I don't know how to access our stats page (or if I even did it right in the first place). Please help :)
     
  26. Offline

    rmkilc

    You need a webserver for the web portal. The files are then served by the webserver.
     
  27. Offline

    Yogi33

    Hi,
    I could ask for help? I am a novice, I've done everything according to instructions andgives me
    "Statistician Web Interface could not acquire connection to Database"

    My config:

    <?php
    // This file should be updated with your Database Configuration
    // as well as other optional data

    define('DB_SERVER' , 'mysql.csrv.pl');
    define('DB_USER' , 'csrv_20421');
    define('DB_PASSWORD', '******');
    define('DB_NAME' , 'csrv_20421');
    define('DB_PORT' , 3306);

    define('SERVER_NAME', 'Minecraft Statystyki');
    define('CLOCK24', true); // true = 24 hours; false = 12 hours

    define('USE_MEGAMETERS', true);
    define('USE_SKINVIEWER', false);

    // Set your localization (language)
    define('LOCALE', 'en');

    // Set your timezone.
    // If you leave this empty the systems timezone will be loaded
    // http://www.php.net/manual/en/timezones.php
    // This needs PHP 5.1.0 or higher!
    define('TIMEZONE', '');
    ?>
     
  28. Offline

    SPKuja

    For some reason it only picks up users in the default group? I am using essential groups
     

Share This Page