Skip to content

Commit

Permalink
Compatibility fixes for eco 10.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MonzUn committed Apr 8, 2024
1 parent 91fbcb2 commit 1531a8e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions DiscordLink/Source/Utilities/MessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
using Eco.Gameplay.Property;
using Eco.Gameplay.Settlements;
using Eco.Gameplay.Skills;
using Eco.Gameplay.Systems;
using Eco.Gameplay.Systems.Balance;
using Eco.Gameplay.Systems.Exhaustion;
using Eco.Gameplay.Components.Store;
using Eco.Plugins.DiscordLink.Extensions;
using Eco.Plugins.Networking;
Expand Down Expand Up @@ -735,7 +737,7 @@ public static DiscordLinkEmbed GetServerInfo(ServerInfoComponentFlag flag)
}
}

if (BalancePlugin.Obj.Config.IsLimitingHours && (flag.HasFlag(ServerInfoComponentFlag.ExhaustionResetTimeLeft) || flag.HasFlag(ServerInfoComponentFlag.ExhaustedPlayerCount)))
if (FeatureConfig.Obj.ExhaustionTimeEnabled && (flag.HasFlag(ServerInfoComponentFlag.ExhaustionResetTimeLeft) || flag.HasFlag(ServerInfoComponentFlag.ExhaustedPlayerCount)))
{
int fieldsAdded = 0;
if (flag.HasFlag(ServerInfoComponentFlag.ExhaustionResetTimeLeft))
Expand Down Expand Up @@ -772,7 +774,7 @@ public static DiscordLinkEmbed GetServerInfo(ServerInfoComponentFlag flag)
embed.AddAlignmentField();
}

if (flag.HasFlag(ServerInfoComponentFlag.PlayerListExhaustionTime) && BalancePlugin.Obj.Config.IsLimitingHours)
if (flag.HasFlag(ServerInfoComponentFlag.PlayerListExhaustionTime) && FeatureConfig.Obj.ExhaustionTimeEnabled)
{
string exhaustTimeList = Shared.GetPlayerExhaustionTimeList();
if (!string.IsNullOrWhiteSpace(exhaustTimeList))
Expand Down Expand Up @@ -871,7 +873,7 @@ public static async Task<DiscordLinkEmbed> GetPlayerReport(User user, PlayerRepo
}

// Exhaustion
if (flag.HasFlag(PlayerReportComponentFlag.Exhaustion) && BalancePlugin.Obj.Config.IsLimitingHours)
if (flag.HasFlag(PlayerReportComponentFlag.Exhaustion) && FeatureConfig.Obj.ExhaustionTimeEnabled)
{
report.AddField("Exhaustion Countdown", (user.ExhaustionMonitor?.IsExhausted ?? false) ? "Exhausted" : Shared.GetTimeDescription(user.GetSecondsLeftUntilExhaustion(), includeZeroValues: Shared.TimespanStringComponent.Hour | Shared.TimespanStringComponent.Minute | Shared.TimespanStringComponent.Second), inline: true);
report.AddAlignmentField();
Expand Down

0 comments on commit 1531a8e

Please sign in to comment.