mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
enhancement for issue #63
This commit is contained in:
@ -19,5 +19,6 @@ namespace SharedLibraryCore.Dtos
|
||||
public string Type { get; set; }
|
||||
public string TimePunished { get; set; }
|
||||
public string TimeRemaining { get; set; }
|
||||
public bool Expired { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Services
|
||||
@ -33,6 +32,7 @@ namespace SharedLibraryCore.Services
|
||||
};
|
||||
break;
|
||||
case GameEvent.EventType.Command:
|
||||
// this prevents passwords/tokens being logged into the database in plain text
|
||||
if (e.Extra is Command cmd)
|
||||
{
|
||||
if (cmd.Name == "login" || cmd.Name == "setpassword")
|
||||
|
@ -197,7 +197,8 @@ namespace SharedLibraryCore.Services
|
||||
Offense = penalty.Offense,
|
||||
Type = penalty.Type.ToString(),
|
||||
TimeRemaining = penalty.Expires.HasValue ? (now > penalty.Expires ? "" : penalty.Expires.ToString()) : DateTime.MaxValue.ToString(),
|
||||
AutomatedOffense = penalty.AutomatedOffense
|
||||
AutomatedOffense = penalty.AutomatedOffense,
|
||||
Expired = penalty.Expires.HasValue && penalty.Expires <= DateTime.UtcNow
|
||||
},
|
||||
When = penalty.When,
|
||||
Sensitive = penalty.Type == Penalty.PenaltyType.Flag
|
||||
@ -216,6 +217,11 @@ namespace SharedLibraryCore.Services
|
||||
if (pi.TimeRemaining?.Length > 0)
|
||||
{
|
||||
pi.TimeRemaining = (DateTime.Parse(((PenaltyInfo)p.Value).TimeRemaining) - now).TimeSpanText();
|
||||
|
||||
if (!pi.Expired)
|
||||
{
|
||||
pi.TimeRemaining = $"{pi.TimeRemaining} {Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]}";
|
||||
}
|
||||
}
|
||||
});
|
||||
return list;
|
||||
|
Reference in New Issue
Block a user