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:
Astra 2026-10-05 13:13:58 +01:00
commit c414e8a770
12 changed files with 1547 additions and 0 deletions

50
Config.cs Normal file
View file

@ -0,0 +1,50 @@
using System.Text.Json.Serialization;
using CounterStrikeSharp.API.Core;
namespace Whisper;
public sealed class WhisperConfig : BasePluginConfig
{
// Keep each message (sender, recipient, both teams and alive/dead, map, time) in wh_messages.
// css_whisper_history on|off changes it and saves this file.
[JsonPropertyName("History")]
public bool History { get; set; } = true;
// How the line is drawn: Open, then the sender's rank prefix and name, Arrow, the recipient
// (Me on the recipient's own line), Close, then the message. Colour tags like {Default}.
[JsonPropertyName("Open")]
public string Open { get; set; } = "{Default}>[";
[JsonPropertyName("Arrow")]
public string Arrow { get; set; } = "{Default}→";
[JsonPropertyName("Me")]
public string Me { get; set; } = "{Default}me";
[JsonPropertyName("Close")]
public string Close { get; set; } = "{Default}]";
// CS2-Tags' file, read for each player's rank prefix and colours.
[JsonPropertyName("TagsFile")]
public string TagsFile { get; set; } = "configs/plugins/CS2-Tags/tags.json";
[JsonPropertyName("CooldownSeconds")]
public double CooldownSeconds { get; set; } = 1;
[JsonPropertyName("MaxMessageLength")]
public int MaxMessageLength { get; set; } = 200;
[JsonPropertyName("MaxBlocks")]
public int MaxBlocks { get; set; } = 100;
// Who gets through blocks and can find admins hidden with css_hide.
[JsonPropertyName("StaffPermission")]
public string StaffPermission { get; set; } = "@css/generic";
// Writes kept on disk while the database is down.
[JsonPropertyName("SpoolMaxEntries")]
public int SpoolMaxEntries { get; set; } = 20000;
[JsonPropertyName("ConfigVersion")]
public override int Version { get; set; } = 1;
}