2023-02-15 22:17:19 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Dalamud.Game.Gui;
|
|
|
|
|
using Dalamud.Logging;
|
|
|
|
|
using Dalamud.Plugin;
|
2023-02-16 23:54:23 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2023-02-15 22:17:19 +00:00
|
|
|
|
using Pal.Client.Extensions;
|
|
|
|
|
using Pal.Client.Properties;
|
|
|
|
|
|
|
|
|
|
namespace Pal.Client.DependencyInjection
|
|
|
|
|
{
|
2023-02-16 23:54:23 +00:00
|
|
|
|
internal sealed class RepoVerification
|
2023-02-15 22:17:19 +00:00
|
|
|
|
{
|
2023-02-17 14:51:45 +00:00
|
|
|
|
public RepoVerification(ILogger<RepoVerification> logger, DalamudPluginInterface pluginInterface, Chat chat)
|
2023-02-15 22:17:19 +00:00
|
|
|
|
{
|
2023-02-16 23:54:23 +00:00
|
|
|
|
logger.LogInformation("Install source: {Repo}", pluginInterface.SourceRepository);
|
2023-02-15 22:17:19 +00:00
|
|
|
|
if (!pluginInterface.IsDev
|
|
|
|
|
&& !pluginInterface.SourceRepository.StartsWith("https://raw.githubusercontent.com/carvelli/")
|
|
|
|
|
&& !pluginInterface.SourceRepository.StartsWith("https://github.com/carvelli/"))
|
|
|
|
|
{
|
2023-02-17 14:51:45 +00:00
|
|
|
|
chat.Error(string.Format(Localization.Error_WrongRepository,
|
2023-02-15 22:17:19 +00:00
|
|
|
|
"https://github.com/carvelli/Dalamud-Plugins"));
|
2023-03-08 00:27:10 +00:00
|
|
|
|
throw new RepoVerificationFailedException();
|
2023-02-15 22:17:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-08 00:27:10 +00:00
|
|
|
|
|
|
|
|
|
internal sealed class RepoVerificationFailedException : Exception
|
|
|
|
|
{
|
|
|
|
|
}
|
2023-02-15 22:17:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|