0.2.0: keep all chat, @ staff chat and SimpleAdmin's say commands too
wh_messages now holds every message with a channel (all, team, pm, staff, to_staff, css_say/asay/psay/csay/hsay/cssay) and NULL sender columns for the console. Seen by a catch-all listener added in Load, which CSS runs before CS2-SimpleAdmin's (added in OnAllPluginsLoaded), so gagged lines and @ chat are kept before SimpleAdmin stops or rewrites them. Replaces 001_CreateTables in place: drop wh_messages and wh_migrations first.
This commit is contained in:
parent
c414e8a770
commit
06823c2d47
5 changed files with 146 additions and 29 deletions
21
Ops.cs
21
Ops.cs
|
|
@ -11,20 +11,35 @@ namespace Whisper;
|
|||
[JsonDerivedType(typeof(BlockRemove), "block_remove")]
|
||||
public abstract record Op;
|
||||
|
||||
public sealed record PlayerState(ulong SteamId, string Name, int Team, bool Alive);
|
||||
// A player as they were when the message was sent. Console: SteamId 0, no team.
|
||||
public sealed record PlayerState(ulong SteamId, string Name, int? Team, bool? Alive)
|
||||
{
|
||||
public static readonly PlayerState Console = new(0, "Console", null, null);
|
||||
}
|
||||
|
||||
public sealed record MessageRecord(
|
||||
string Key, DateTime At, int? ServerId, string Map, PlayerState Sender, PlayerState? Recipient,
|
||||
string Target, string Message, string Result) : Op;
|
||||
string Key, DateTime At, int? ServerId, string Map, string Channel, PlayerState Sender, PlayerState? Recipient,
|
||||
string? Target, string Message, string Result) : Op;
|
||||
|
||||
public sealed record BlockAdd(ulong Blocker, ulong Blocked, string BlockedName, DateTime At) : Op;
|
||||
|
||||
public sealed record BlockRemove(ulong Blocker, ulong Blocked) : Op;
|
||||
|
||||
// Where a message went (wh_messages.channel). SimpleAdmin's commands are logged by their own name.
|
||||
public static class ChatChannel
|
||||
{
|
||||
public const string All = "all";
|
||||
public const string Team = "team";
|
||||
public const string Pm = "pm";
|
||||
public const string Staff = "staff";
|
||||
public const string ToStaff = "to_staff";
|
||||
}
|
||||
|
||||
// What the message log calls each outcome (wh_messages.result).
|
||||
public static class Result
|
||||
{
|
||||
public const string Sent = "sent";
|
||||
public const string Command = "command";
|
||||
public const string Blocked = "blocked";
|
||||
public const string Gagged = "gagged";
|
||||
public const string Cooldown = "cooldown";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue