1. A note to new members who are making their first purchase

    Once you have made your first purchase you will be unable to instantly download. Due to the recent influx of fraudulent purchases we now need to verify your account before we can grant access to download.
    To verify your account/purchase please email admin@chaoscode.io from the email address your PayPal account is registered to and state your ChaosCode username and the name of the plugin you have purchased.
    Once this is done access to your download your purchase will be granted.

    Please be aware that the verification process may take up to 24 hours!

    We apologise for any inconvenience this may cause
    Dismiss Notice

SQLStats 1.0.2

Logs various statistics about ingame stuff to MySQL database.

  1. SQLStats

    Visagalis
    Required Dependencies:
    MySQL Database (accessible from wherever RustDedicated is hosted)
    Optional Dependencies:
    https://www.chaoscode.io/resources/sqlstatistics.116/
    https://www.chaoscode.io/resources/sqlranks.115/
    Example of what could be done with data fetched from this plugin with some PHP and MySQL code:
    http://rust.sangreal.lt/stats/
    Not all functionality is covered in website above.

    Data plugin records is:
    1. Players who connects/disconnects to the server and their last ip and how much time they have spent on a server (this wipe and overall)
    2. Animals players has killed (Animal name, date and time of kill, distance and weapon used to kill).
    3. [1] Items players has crafted (Item name, date, amount of crafted items)
    4. Players deaths (Cause, date and time, position x, y and grid location)
    5. Players destroyed buildings (Building name, date and time, building tier, weapon used, grid location)
    6. Players destroyed containers (Container name, date and time, weapon used, position x, y and grid location)
    7. Players destroyed doors/gates/fences (Building name, date and time, weapon, x, y and grid location)
    8. [1] Players bullets shot (Bullet name, weapon used, date, count)
    9. [1] Players resources gathered (Resource name, count, date)
    10. [1] Players kill (Killer, victim, link to combat log, weapon used, last bodypart hit, date and time, distance and points[2])
    11. [3] Combat log (same data as provided in console when you type combatlog) from both perspectives (killer and victim)
    12. [1] Players placed buildings (Building name, date, count)
    13. [1] Players placed deployables (Deployable name, date, count)
    [1] - Aggregated per day
    [2] - Points are calculated depending on victim's gear, the more geared he is, more points are given for a kill, perfect solution for leaderboards without causing killing on sights to be number one in leaderboard.
    [3] - Combat log generates lots of data on PvP intense servers, so enable with caution
    ALL DATA EXCEPT PLAYER STATS (1.) IS WIPED ON MAP CHANGE, THIS CAN BE EASILY CHANGED IN A FUTURE, IF SOMEONE WOULD LIKE TO HAVE SUCH FEATURE.

    Default config:
    Code (Text):
    {
      "Config": {
        "SaveCombatLog": "0"
      },
      "MySQL": {
        "Database": "rust",
        "Host": "127.0.0.1",
        "Password": "password",
        "Port": 3306,
        "Username": "username"
      }
    }
    * - SaveCombatLog might be resource intense, but having it enabled will save every combat log to database on PvP Kill so you could find hackers easier!

    The following script will drop database named rust if it exists and then creates it from scratch with all required empty tables:
    Code (Text):
    -- --------------------------------------------------------
    -- Server version:               5.7.16-log - MySQL Community Server (GPL)
    -- Server OS:                    Win64
    -- --------------------------------------------------------

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET NAMES utf8 */;
    /*!50503 SET NAMES utf8mb4 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


    -- Dumping database structure for rust
    DROP DATABASE IF EXISTS `rust`;
    CREATE DATABASE IF NOT EXISTS `rust` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
    USE `rust`;

    -- Dumping structure for table rust.stats_player
    DROP TABLE IF EXISTS `stats_player`;
    CREATE TABLE IF NOT EXISTS `stats_player` (
      `id` bigint(20) NOT NULL,
      `name` text NOT NULL,
      `online_seconds` bigint(20) DEFAULT '0',
      `ip` varchar(50) NOT NULL,
      `online` bit(1) NOT NULL DEFAULT b'0',
      `lastconnection` datetime DEFAULT CURRENT_TIMESTAMP,
      `online_seconds_lastwipe` bigint(20) DEFAULT '0',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_animal_kill
    DROP TABLE IF EXISTS `stats_player_animal_kill`;
    CREATE TABLE IF NOT EXISTS `stats_player_animal_kill` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `animal` varchar(32) NOT NULL,
      `date` datetime NOT NULL,
      `distance` int(11) DEFAULT NULL,
      `weapon` varchar(128) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_craft_item
    DROP TABLE IF EXISTS `stats_player_craft_item`;
    CREATE TABLE IF NOT EXISTS `stats_player_craft_item` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `item` varchar(32) NOT NULL,
      `date` date NOT NULL,
      `count` int(11) NOT NULL DEFAULT '1',
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerItemDate` (`player`,`item`,`date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_death
    DROP TABLE IF EXISTS `stats_player_death`;
    CREATE TABLE IF NOT EXISTS `stats_player_death` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `cause` varchar(32) NOT NULL,
      `date` datetime NOT NULL,
      `count` int(11) NOT NULL DEFAULT '1',
      `x` int(11) DEFAULT NULL,
      `z` int(11) DEFAULT NULL,
      `grid` varchar(5) DEFAULT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerCauseDate` (`player`,`cause`,`date`,`x`,`z`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_destroy_building
    DROP TABLE IF EXISTS `stats_player_destroy_building`;
    CREATE TABLE IF NOT EXISTS `stats_player_destroy_building` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `owner` bigint(20) DEFAULT NULL,
      `building` varchar(128) NOT NULL,
      `date` datetime NOT NULL,
      `tier` varchar(20) DEFAULT NULL,
      `weapon` varchar(128) DEFAULT NULL,
      `grid` varchar(5) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_destroy_container
    DROP TABLE IF EXISTS `stats_player_destroy_container`;
    CREATE TABLE IF NOT EXISTS `stats_player_destroy_container` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `owner` bigint(20) DEFAULT NULL,
      `title` varchar(128) NOT NULL,
      `date` datetime NOT NULL,
      `weapon` varchar(128) DEFAULT NULL,
      `x` int(11) DEFAULT NULL,
      `z` int(11) DEFAULT NULL,
      `grid` varchar(5) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_fire_bullet
    DROP TABLE IF EXISTS `stats_player_fire_bullet`;
    CREATE TABLE IF NOT EXISTS `stats_player_fire_bullet` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `bullet` varchar(32) NOT NULL,
      `weapon` varchar(128) NOT NULL,
      `date` date NOT NULL,
      `count` int(11) NOT NULL DEFAULT '1',
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerBulletWeaponDate` (`player`,`bullet`,`weapon`,`date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_gather_resource
    DROP TABLE IF EXISTS `stats_player_gather_resource`;
    CREATE TABLE IF NOT EXISTS `stats_player_gather_resource` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `resource` varchar(32) NOT NULL,
      `count` bigint(20) NOT NULL,
      `date` date NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerResourceCountDate` (`player`,`resource`,`date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_kill
    DROP TABLE IF EXISTS `stats_player_kill`;
    CREATE TABLE IF NOT EXISTS `stats_player_kill` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `killid` char(36) NOT NULL DEFAULT '0',
      `killer` bigint(20) NOT NULL,
      `victim` bigint(20) NOT NULL,
      `weapon` varchar(128) NOT NULL,
      `bodypart` varchar(2000) NOT NULL DEFAULT '',
      `date` datetime NOT NULL,
      `distance` int(11) DEFAULT NULL,
      `points` int(11) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_kill_combatlog
    DROP TABLE IF EXISTS `stats_player_kill_combatlog`;
    CREATE TABLE IF NOT EXISTS `stats_player_kill_combatlog` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `killid` char(36) NOT NULL DEFAULT '0',
      `time` char(64) NOT NULL DEFAULT '0',
      `attacker` char(128) NOT NULL DEFAULT '0',
      `attacker_id` int(11) NOT NULL DEFAULT '0',
      `target` char(128) NOT NULL DEFAULT '0',
      `target_id` int(11) NOT NULL DEFAULT '0',
      `weapon` char(128) NOT NULL DEFAULT '0',
      `ammo` char(128) NOT NULL DEFAULT '0',
      `area` char(64) NOT NULL DEFAULT '0',
      `distance` char(32) NOT NULL DEFAULT '0',
      `old_hp` decimal(10,2) NOT NULL DEFAULT '0.00',
      `new_hp` decimal(10,2) NOT NULL DEFAULT '0.00',
      `info` char(128) NOT NULL DEFAULT '0',
      `dataFrom` char(32) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_place_building
    DROP TABLE IF EXISTS `stats_player_place_building`;
    CREATE TABLE IF NOT EXISTS `stats_player_place_building` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `building` varchar(128) NOT NULL,
      `date` date NOT NULL,
      `count` int(11) NOT NULL DEFAULT '1',
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerBuildingDate` (`player`,`building`,`date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_place_deployable
    DROP TABLE IF EXISTS `stats_player_place_deployable`;
    CREATE TABLE IF NOT EXISTS `stats_player_place_deployable` (
      `id` bigint(20) NOT NULL AUTO_INCREMENT,
      `player` bigint(20) NOT NULL,
      `deployable` varchar(128) NOT NULL,
      `date` date NOT NULL,
      `count` int(11) NOT NULL DEFAULT '1',
      PRIMARY KEY (`id`),
      UNIQUE KEY `PlayerDeployableDate` (`player`,`deployable`,`date`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    -- Dumping structure for table rust.stats_player_destroy_door
    DROP TABLE IF EXISTS `stats_player_destroy_door`;
    CREATE TABLE IF NOT EXISTS `stats_player_destroy_door` (
       `id` bigint(20) NOT NULL AUTO_INCREMENT,
       `player` bigint(20) NOT NULL,
       `owner` bigint(20) DEFAULT NULL,
       `title` varchar(128) NOT NULL,
       `date` datetime NOT NULL,
       `weapon` varchar(128) DEFAULT NULL,
       `x` int(11) DEFAULT NULL,
       `z` int(11) DEFAULT NULL,
       `grid` varchar(5) DEFAULT NULL,
       PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    -- Data exporting was unselected.
    /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
    /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

Recent Updates

  1. 1.0.2
  2. 1.0.1

Recent Reviews

  1. Capone
    Capone
    5/5,
    Version: 1.0.2
  2. raidgrounds
    raidgrounds
    5/5,
    Version: 1.0.2
  3. uregginz
    uregginz
    5/5,
    Version: 1.0.2
    Absolutely amazing plugin! This plugin will take sometime to setup depending on your skills but it is defiantly worth it and is a must for a PVP server. It is great for finding hackers and players love being able to check their stats!

    Here is another example of what can be done with this plugin.
    https://urusty.com/stats.html
  4. rusteaze
    rusteaze
    5/5,
    Version: 1.0.1
    This plugin definitely takes some time to get to work. More than worth it however. If you have knowledge of datatables, mysql and php you'll be able to get there. I've been able to weed out hackers just by looking at the info as well! Players are reassured and like being able to look at the stats.
  5. Ryan
    Ryan
    5/5,
    Version: 1.0.0
    Great plugin, perfect for creating an external web page containing player statistics.

    Also extremely useful for admins to checkup on player hit, kill and damage history. Opens up the doors to many developments to improve a lot of backend features.

    A page I have made with this plugin: https://rustoria.co/leaderboards