add unban and get banned endpoints
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using EmbedIO;
|
||||
using EmbedIO.Routing;
|
||||
using EmbedIO.WebApi;
|
||||
using Sandbox;
|
||||
using Sandbox.Engine.Multiplayer;
|
||||
using Sandbox.Game.Multiplayer;
|
||||
using TorchRemote.Models.Responses;
|
||||
@@ -33,6 +34,18 @@ public class PlayersController : WebApiController
|
||||
Statics.MultiplayerManager!.BanPlayer(id);
|
||||
}
|
||||
|
||||
[Route(HttpVerbs.Post, $"{RootPath}/{{id}}/unban")]
|
||||
public void UnBan(ulong id)
|
||||
{
|
||||
Statics.MultiplayerManager!.BanPlayer(id, false);
|
||||
}
|
||||
|
||||
[Route(HttpVerbs.Get, $"{RootPath}/{{id}}/banned")]
|
||||
public IEnumerable<ulong> Banned()
|
||||
{
|
||||
return MySandboxGame.ConfigDedicated.Banned;
|
||||
}
|
||||
|
||||
[Route(HttpVerbs.Post, $"{RootPath}/{{id}}/disconnect")]
|
||||
public Task Disconnect(ulong id)
|
||||
{
|
||||
|
@@ -2,5 +2,5 @@
|
||||
<PluginManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Name>Torch Remote</Name>
|
||||
<Guid>284017F3-9682-4841-A544-EB04DB8CB9BA</Guid>
|
||||
<Version>v1.0.9</Version>
|
||||
<Version>v1.0.10</Version>
|
||||
</PluginManifest>
|
Reference in New Issue
Block a user