Fix server exception at raid end when client sends bantype data (#257)

This commit is contained in:
hulkhan22
2025-05-18 20:38:13 +02:00
committed by GitHub
parent e783f26815
commit 21382a1e06
4 changed files with 11 additions and 11 deletions
@@ -608,7 +608,7 @@ public class ProfileHelper(
public bool PlayerIsFleaBanned(PmcData pmcProfile)
{
var currentTimestamp = _timeUtil.GetTimeStamp();
return pmcProfile?.Info?.Bans?.Any(b => b.BanType == BanType.RAGFAIR && currentTimestamp < b.DateTime) ?? false;
return pmcProfile?.Info?.Bans?.Any(b => b.BanType == BanType.RagFair && currentTimestamp < b.DateTime) ?? false;
}
public bool HasAccessToRepeatableFreeRefreshSystem(PmcData pmcProfile)
@@ -183,7 +183,7 @@ public class TraderHelper(
if ((rawProfileTemplate.FleaBlockedDays ?? 0) > 0)
{
var newBanDateTime = _timeUtil.GetTimeStampFromNowDays(rawProfileTemplate.FleaBlockedDays ?? 0);
var existingBan = pmcData.Info.Bans.FirstOrDefault(ban => ban.BanType == BanType.RAGFAIR);
var existingBan = pmcData.Info.Bans.FirstOrDefault(ban => ban.BanType == BanType.RagFair);
if (existingBan is not null)
{
existingBan.DateTime = newBanDateTime;
@@ -193,7 +193,7 @@ public class TraderHelper(
pmcData.Info.Bans.Add(
new Ban
{
BanType = BanType.RAGFAIR,
BanType = BanType.RagFair,
DateTime = newBanDateTime
}
);
@@ -618,13 +618,13 @@ public record Ban
public enum BanType
{
CHAT = 0,
RAGFAIR = 1,
VOIP = 2,
TRADING = 3,
ONLINE = 4,
FRIENDS = 5,
CHANGE_NICKNAME = 6
Chat,
RagFair,
Voip,
Trading,
Online,
Friends,
ChangeNickname,
}
public record Customization
@@ -55,7 +55,7 @@ public class JsonUtil
new EftEnumConverter<EquipmentSlots>(),
new EftEnumConverter<BuffType>(),
new EftEnumConverter<BodyPartColliderType>(),
new EftEnumConverter<BanType>(),
new EftEnumConverter<LogLevel>(),
new EftEnumConverter<LogTextColor>(),
new EftEnumConverter<LogBackgroundColor>(),