Stats: playtime and PvP statistics
This commit is contained in:
8
Stats/resources/activity_update.sql
Normal file
8
Stats/resources/activity_update.sql
Normal file
@ -0,0 +1,8 @@
|
||||
INSERT INTO `{prefix}activity`
|
||||
(`uuid`, `date`, `kills`, `deaths`, `playtime`) VALUES
|
||||
(?, ?, ?, ?, ?)
|
||||
ON DUPLICATE KEY
|
||||
UPDATE
|
||||
`kills` = `kills` + VALUES(`kills`),
|
||||
`deaths` = `deaths` + VALUES(`deaths`),
|
||||
`playtime` = `playtime` + VALUES(`playtime`);
|
@ -1,9 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS `{prefix}players` (
|
||||
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uuid` binary(16) NOT NULL,
|
||||
`serverNick` varchar(32) NOT NULL,
|
||||
`voteCount` int UNSIGNED DEFAULT 0,
|
||||
PRIMARY KEY `id` (`id`),
|
||||
UNIQUE KEY `uuid` (`uuid`)
|
||||
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{prefix}activity` (
|
||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uuid` binary(16) NOT NULL,
|
||||
`date` DATE NOT NULL,
|
||||
`kills` int DEFAULT 0,
|
||||
`deaths` int UNSIGNED DEFAULT 0,
|
||||
`voteCount` int UNSIGNED DEFAULT 0,
|
||||
PRIMARY KEY `id` (`id`)
|
||||
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`playtime` mediumint UNSIGNED DEFAULT 0,
|
||||
PRIMARY KEY `id` (`id`),
|
||||
UNIQUE KEY `date_player` (`uuid`, `date`)
|
||||
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
7
Stats/resources/players_update.sql
Normal file
7
Stats/resources/players_update.sql
Normal file
@ -0,0 +1,7 @@
|
||||
INSERT INTO `{prefix}players`
|
||||
(`uuid`, `serverNick`) VALUES
|
||||
(?, ?)
|
||||
ON DUPLICATE KEY
|
||||
UPDATE
|
||||
`serverNick` = VALUES(`serverNick`),
|
||||
`voteCount` = `voteCount` + VALUES(`voteCount`);
|
Reference in New Issue
Block a user