more api
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>LuckPerms.Torch.Api</id>
|
||||
<version>5.4</version>
|
||||
<version>5.4.1</version>
|
||||
<authors>LuckPerms.Torch.Api</authors>
|
||||
<description>Package Description</description>
|
||||
<dependencies>
|
||||
<group targetFramework=".NETFramework4.8">
|
||||
<dependency id="Torch.Loader" version="1.0.0" />
|
||||
<dependency id="LuckPerms.Torch.Utils" version="1.0.0" />
|
||||
<dependency id="LuckPerms.Torch.Utils" version="1.0.1" />
|
||||
<dependency id="IKVM.Maven.Sdk" version="1.6.1" />
|
||||
</group>
|
||||
</dependencies>
|
||||
|
14
LuckPerms.Torch.Utils/Api/ILpPlayerModel.cs
Normal file
14
LuckPerms.Torch.Utils/Api/ILpPlayerModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using net.luckperms.api.query;
|
||||
using net.luckperms.api.util;
|
||||
using Torch.API;
|
||||
|
||||
namespace LuckPerms.Torch.Api;
|
||||
|
||||
public interface ILpPlayerModel : IPlayer
|
||||
{
|
||||
Tristate HasPermission(string permission);
|
||||
Tristate HasPermission(string permission, QueryOptions queryOptions);
|
||||
|
||||
string? GetOption(string key);
|
||||
string? GetOption(string key, QueryOptions queryOptions);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
using Torch.API.Managers;
|
||||
|
||||
namespace LuckPerms.Torch.Api.Managers;
|
||||
|
||||
public interface ILuckPermsPlatformManager : IManager
|
||||
{
|
||||
net.luckperms.api.LuckPerms Api { get; }
|
||||
}
|
@@ -2,10 +2,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<RootNamespace>LuckPerms.Torch</RootNamespace>
|
||||
<LangVersion>12</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
@@ -21,7 +22,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IKVM" Version="8.7.1" />
|
||||
<PackageReference Include="IKVM" Version="8.7.1" />
|
||||
<PackageReference Include="torch.server.referenceassemblies" Version="1.3.1.260-master" PrivateAssets="all" IncludeAssets="compile" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -4,6 +4,8 @@ using System.Linq;
|
||||
using ikvm.extensions;
|
||||
using ikvm.runtime;
|
||||
using java.lang;
|
||||
using LuckPerms.Torch.Api;
|
||||
using LuckPerms.Torch.Api.Managers;
|
||||
using LuckPerms.Torch.Extensions;
|
||||
using LuckPerms.Torch.Utils.Extensions;
|
||||
using Torch.API;
|
||||
@@ -22,7 +24,7 @@ public class ModApiManager : IManager
|
||||
MyScriptCompiler.Static.AddReferencedAssemblies(
|
||||
typeof(net.luckperms.api.LuckPerms).Assembly.Location, // net.luckperms.api.dll
|
||||
typeof(java.lang.Boolean).Assembly.Location, // IKVM.Java.dll
|
||||
typeof(ModApiManager).Assembly.Location, // LuckPerms.Torch.dll
|
||||
typeof(ILuckPermsPlatformManager).Assembly.Location, // LuckPerms.Torch.Utils.dll
|
||||
typeof(ITorchBase).Assembly.Location // Torch.API.dll
|
||||
);
|
||||
|
||||
@@ -48,7 +50,7 @@ public class ModApiManager : IManager
|
||||
whitelist.AllowNamespaceOfTypes(MyWhitelistTarget.ModApi, typeof(UuidExtensions));
|
||||
whitelist.AllowTypes(MyWhitelistTarget.ModApi, typeof(TorchApi), typeof(IDependencyProvider), typeof(IManager),
|
||||
typeof(DependencyProviderExtensions), typeof(IMultiplayerManagerServer), typeof(IMultiplayerManagerBase),
|
||||
typeof(IPlayer), typeof(ConnectionState));
|
||||
typeof(IPlayer), typeof(ConnectionState), typeof(ILpPlayerModel));
|
||||
}
|
||||
|
||||
public void Detach()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using LuckPerms.Torch.Impl;
|
||||
using LuckPerms.Torch.Api;
|
||||
using LuckPerms.Torch.Impl;
|
||||
using me.lucko.luckperms.common.context.manager;
|
||||
using me.lucko.luckperms.common.model;
|
||||
using me.lucko.luckperms.common.verbose.@event;
|
||||
@@ -8,7 +9,7 @@ using Torch.ViewModels;
|
||||
|
||||
namespace LuckPerms.Torch.PlatformApi;
|
||||
|
||||
public class LpPlayerModel(ulong steamId, string? name = null) : PlayerViewModel(steamId, name)
|
||||
public class LpPlayerModel(ulong steamId, string? name = null) : PlayerViewModel(steamId, name), ILpPlayerModel
|
||||
{
|
||||
public QueryOptionsCache? QueryOptionsCache { get; private set; }
|
||||
public User? LpUser { get; private set; }
|
||||
|
@@ -1,19 +1,22 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using java.lang;
|
||||
using LuckPerms.Torch.Api.Managers;
|
||||
using LuckPerms.Torch.Impl;
|
||||
using NLog;
|
||||
using Torch;
|
||||
using Torch.API;
|
||||
using Torch.API.Managers;
|
||||
using Exception = System.Exception;
|
||||
|
||||
namespace LuckPerms.Torch.PlatformApi;
|
||||
|
||||
public class LuckPermsPlatformManager : IManager
|
||||
public class LuckPermsPlatformManager : ILuckPermsPlatformManager
|
||||
{
|
||||
private readonly ILogger _log = LogManager.GetCurrentClassLogger();
|
||||
private readonly LpTorchBootstrap _bootstrap;
|
||||
|
||||
public net.luckperms.api.LuckPerms Api => _bootstrap.EnableLatch.getCount() == 0 ? _bootstrap.Plugin.getApiProvider() : throw new InvalidOperationException("Api is not initialized");
|
||||
|
||||
public LuckPermsPlatformManager(TorchPluginBase plugin, ITorchServer server, ILogger log)
|
||||
{
|
||||
_bootstrap = new(server, plugin, log, Path.Combine(plugin.StoragePath, "luckperms"));
|
||||
|
@@ -2,5 +2,5 @@
|
||||
<PluginManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Name>LuckPerms.Torch</Name>
|
||||
<Guid>7E4B3CC8-64FA-416E-8910-AACDF2DA5E2C</Guid>
|
||||
<Version>v5.4.106.5</Version>
|
||||
<Version>v5.4.106.6</Version>
|
||||
</PluginManifest>
|
Reference in New Issue
Block a user