PalacePal/Pal.Client/DependencyInjection/RepoVerification.cs

26 lines
917 B
C#
Raw Normal View History

2023-02-15 22:17:19 +00:00
using System;
using Dalamud.Game.Gui;
using Dalamud.Logging;
using Dalamud.Plugin;
using Pal.Client.Extensions;
using Pal.Client.Properties;
namespace Pal.Client.DependencyInjection
{
public class RepoVerification
{
public RepoVerification(DalamudPluginInterface pluginInterface, ChatGui chatGui)
{
PluginLog.Information($"Install source: {pluginInterface.SourceRepository}");
if (!pluginInterface.IsDev
&& !pluginInterface.SourceRepository.StartsWith("https://raw.githubusercontent.com/carvelli/")
&& !pluginInterface.SourceRepository.StartsWith("https://github.com/carvelli/"))
{
chatGui.PalError(string.Format(Localization.Error_WrongRepository,
"https://github.com/carvelli/Dalamud-Plugins"));
throw new InvalidOperationException();
}
}
}
}