feat: New Jail System (#2215)

New Jail System for MUO
----------------------------

Commands:
[jail [player] [reason] - Jail with time escalation per offense (5 to 120 minutes, GM only)
[unjail [player] - Manual release from jail regardless of time (GM only)
[jailinfo [player] - Check jail status and history (GM only)
[jailrecord - Checks their own jail record stats (player access)

Jail/Unjail can be found in the client view of a player in Admin Gump
![Screenshot 2025-06-12 030226](https://github.com/user-attachments/assets/a9f1a736-0316-464c-8958-c589ea0a1dcb)

Jail record gump, invoked with [jailrecord (30 second cooldown)
![Screenshot 2025-06-12 030320](https://github.com/user-attachments/assets/c19b3e76-3042-48ae-a00d-c70ef564bc84)
This commit is contained in:
Bohica 2025-07-16 20:41:21 -07:00 • committed by GitHub
parent c2c486c06e
commit 5f0561b7fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 669 additions and 4 deletions

View file

@ -1479,4 +1479,49 @@ public static partial class Utility
return DateTime.SpecifyKind(local - tz.GetUtcOffset(local), DateTimeKind.Utc);
}
public static string FormatTimeCompact(this TimeSpan ts, bool showSeconds = false)
{
using var sb = ValueStringBuilder.Create();
if (ts.Days >= 1)
{
sb.Append($"{ts.Days}d");
}
if (sb.Length > 0)
{
sb.Append($" {ts.Hours}h");
}
else if (ts.Hours >= 1)
{
sb.Append($"{ts.Hours}h");
}
if (sb.Length > 0)
{
sb.Append($" {ts.Minutes}m");
}
else if (ts.Minutes >= 1)
{
sb.Append($"{ts.Minutes}m");
}
if (showSeconds)
{
if (sb.Length > 0)
{
sb.Append($" {ts.Seconds}s");
}
else if (ts.Seconds >= 1)
{
sb.Append($"{ts.Seconds}s");
}
}
else if (sb.Length == 0)
{
sb.Append("0m");
}
return sb.ToString();
}
}