mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Prevent automatic plugin updates during Duties (#1759)
This commit is contained in:
parent
532781308d
commit
5275d62dd5
1 changed files with 9 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
using CheapLoc;
|
using CheapLoc;
|
||||||
using Dalamud.Configuration.Internal;
|
using Dalamud.Configuration.Internal;
|
||||||
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.Gui;
|
using Dalamud.Game.Gui;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
|
@ -290,13 +291,20 @@ internal class ChatHandlers : IServiceType
|
||||||
var chatGui = Service<ChatGui>.GetNullable();
|
var chatGui = Service<ChatGui>.GetNullable();
|
||||||
var pluginManager = Service<PluginManager>.GetNullable();
|
var pluginManager = Service<PluginManager>.GetNullable();
|
||||||
var notifications = Service<NotificationManager>.GetNullable();
|
var notifications = Service<NotificationManager>.GetNullable();
|
||||||
|
var condition = Service<Condition>.GetNullable();
|
||||||
|
|
||||||
if (chatGui == null || pluginManager == null || notifications == null)
|
if (chatGui == null || pluginManager == null || notifications == null || condition == null)
|
||||||
{
|
{
|
||||||
Log.Warning("Aborting auto-update because a required service was not loaded.");
|
Log.Warning("Aborting auto-update because a required service was not loaded.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (condition.Any(ConditionFlag.BoundByDuty, ConditionFlag.BoundByDuty56, ConditionFlag.BoundByDuty95))
|
||||||
|
{
|
||||||
|
Log.Warning("Aborting auto-update because the player is in a duty.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pluginManager.ReposReady || !pluginManager.InstalledPlugins.Any() || !pluginManager.AvailablePlugins.Any())
|
if (!pluginManager.ReposReady || !pluginManager.InstalledPlugins.Any() || !pluginManager.AvailablePlugins.Any())
|
||||||
{
|
{
|
||||||
// Plugins aren't ready yet.
|
// Plugins aren't ready yet.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue