1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

more work on skill based team balance.

added on player disconnect to custom callbacks
This commit is contained in:
RaidMax
2018-10-25 08:14:39 -05:00
parent d84de353ff
commit fd087c5506
19 changed files with 315 additions and 110 deletions

View File

@ -145,7 +145,7 @@ namespace SharedLibraryCore.Services
PunisherId = penalty.PunisherId,
Offense = penalty.Offense,
Type = penalty.Type.ToString(),
TimeRemaining = now > penalty.Expires ? "" : penalty.Expires.ToString(),
TimeRemaining = penalty.Expires.HasValue ? (now > penalty.Expires ? "" : penalty.Expires.ToString()) : DateTime.MaxValue.ToString(),
AutomatedOffense = penalty.AutomatedOffense
},
When = penalty.When,
@ -160,7 +160,7 @@ namespace SharedLibraryCore.Services
((PenaltyInfo)p.Value).Type = ((Penalty.PenaltyType)Convert.ToInt32(((PenaltyInfo)p.Value).Type)).ToString();
var pi = ((PenaltyInfo)p.Value);
if (pi.TimeRemaining.Length > 0)
if (pi.TimeRemaining?.Length > 0)
pi.TimeRemaining = (DateTime.Parse(((PenaltyInfo)p.Value).TimeRemaining) - now).TimeSpanText();
});