- Required Dependencies
- MySQL server (version: 5.7.x) (accessible from wherever RustDedicated is hosted)
To have less fustration setting up MySQL, please use MySQL version no higher than `5.7.x` (can use `5.7.41` for example.)
If for some reason you are using MySQL 8 and above, using Legacy Authentication Method (manual here). This limitation comes from Oxide, not from the plugin itself.
Data plugin records is:
[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:
* - 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:
If for some reason you are using MySQL 8 and above, using Legacy Authentication Method (manual here). This limitation comes from Oxide, not from the plugin itself.
Data plugin records is:
- 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)
- Animals players has killed (Animal name, date and time of kill, distance and weapon used to kill).
- [1] Items players has crafted (Item name, date, amount of crafted items)
- Players deaths (Cause, date and time, position x, y and grid location)
- Players destroyed buildings (Building name, date and time, building tier, weapon used, grid location)
- Players destroyed containers (Container name, date and time, weapon used, position x, y and grid location)
- Players destroyed doors/gates/fences (Building name, date and time, weapon, x, y and grid location)
- [1] Players bullets shot (Bullet name, weapon used, date, count)
- [1] Players resources gathered (Resource name, count, date)
- [1] Players kill (Killer, victim, link to combat log, weapon used, last bodypart hit, date and time, distance and points[2])
- [3] Combat log (same data as provided in console when you type combatlog) from both perspectives (killer and victim)
- [1] Players placed buildings (Building name, date, count)
- [1] Players placed deployables (Deployable name, date, count)
[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:
{
"Config": {
"SaveCombatLog": "0",
"WipeStatsOnMapChange": "1",
"PreservePlayersTable": "1",
},
"MySQL": {
"Database": "rust",
"Host": "127.0.0.1",
"Password": "password",
"Port": 3306,
"Username": "username"
}
}
The following script will drop database named rust if it exists and then creates it from scratch with all required empty tables:
Code:
-- --------------------------------------------------------
-- 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 */;