Whisper 0.1.0: private messages between players
/pm (/w) with names, #userid, SteamIDs, @me, @aim, @random, @randomt and @randomct, /r to reply, and /block, /blocklist, /unblock. Lines use CS2-Tags' rank prefixes and colours: >[[M] Kalus -> me] message. Gagged players can't send; blocks stop everyone but staff. Messages are kept in CS2-SimpleAdmin's database while History is on (css_whisper_history).
This commit is contained in:
commit
c414e8a770
12 changed files with 1547 additions and 0 deletions
40
Migrations/001_CreateTables.sql
Normal file
40
Migrations/001_CreateTables.sql
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
-- Whisper's tables, in CS2-SimpleAdmin's database. Applied once at load, tracked in wh_migrations.
|
||||
-- All times are UTC.
|
||||
|
||||
-- One row per private message attempt, sent or not (while History is on in Whisper.json).
|
||||
-- result: sent, blocked, gagged, cooldown, no_target, ambiguous, group_target, too_long.
|
||||
-- The recipient columns are NULL when no single player was found. team: 0 none, 1 spectator,
|
||||
-- 2 T, 3 CT. alive: 1 when on T/CT with a living pawn. target is what the sender typed for it.
|
||||
CREATE TABLE IF NOT EXISTS `wh_messages` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`message_key` char(32) NOT NULL,
|
||||
`sent_at` datetime NOT NULL,
|
||||
`server_id` int NULL,
|
||||
`map` varchar(64) NOT NULL,
|
||||
`sender_steamid64` bigint unsigned NOT NULL,
|
||||
`sender_name` varchar(128) NOT NULL,
|
||||
`sender_team` tinyint NOT NULL,
|
||||
`sender_alive` tinyint NOT NULL,
|
||||
`recipient_steamid64` bigint unsigned NULL,
|
||||
`recipient_name` varchar(128) NULL,
|
||||
`recipient_team` tinyint NULL,
|
||||
`recipient_alive` tinyint NULL,
|
||||
`target` varchar(128) NOT NULL,
|
||||
`message` varchar(512) NOT NULL,
|
||||
`result` varchar(16) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uq_message_key` (`message_key`),
|
||||
KEY `ix_sent_at` (`sent_at`),
|
||||
KEY `ix_sender` (`sender_steamid64`, `sent_at`),
|
||||
KEY `ix_recipient` (`recipient_steamid64`, `sent_at`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- Who each player has blocked from messaging them (/block). blocked_name is their name when blocked,
|
||||
-- empty when blocked by SteamID64 while offline.
|
||||
CREATE TABLE IF NOT EXISTS `wh_blocks` (
|
||||
`blocker_steamid64` bigint unsigned NOT NULL,
|
||||
`blocked_steamid64` bigint unsigned NOT NULL,
|
||||
`blocked_name` varchar(128) NOT NULL DEFAULT '',
|
||||
`created_at` datetime NOT NULL,
|
||||
PRIMARY KEY (`blocker_steamid64`, `blocked_steamid64`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
Loading…
Add table
Add a link
Reference in a new issue