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  Jail record gump, invoked with [jailrecord (30 second cooldown) 
This commit is contained in:
parent
c2c486c06e
commit
5f0561b7fc
8 changed files with 669 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue