Skip to content

Commit

Permalink
remove livemap.admin privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Apr 2, 2024
1 parent b2dd1d1 commit c1e343e
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/Common/Command/CommandHandler.cs
Expand Up @@ -13,7 +13,7 @@ public abstract class CommandHandler {
mod.Api.ChatCommands
.Create("livemap")
.WithDescription(Lang.Get("command.livemap.description"))
.RequiresPrivilege("livemap.admin")
.RequiresPrivilege("root")
.WithArgs(new WordArgParser("command", false, _commands.Keys.ToArray()))
.HandleWith(VanillaExecute);

Expand Down
2 changes: 1 addition & 1 deletion src/Server/Command/ServerCommandHandler.cs
Expand Up @@ -11,7 +11,7 @@ public sealed class ServerCommandHandler : CommandHandler {
public ServerCommandHandler(LiveMapServer server) : base(server) {
Server = server;

Server.Api.Permissions.RegisterPrivilege("livemap.admin", Lang.Get("command.livemap.description"), false);
Server.Api.Permissions.RegisterPrivilege("root", Lang.Get("command.livemap.description"), false);
}

protected override void RegisterSubCommands() {
Expand Down
7 changes: 0 additions & 7 deletions src/Server/LiveMapServer.cs
Expand Up @@ -4,7 +4,6 @@
using LiveMap.Server.Configuration;
using LiveMap.Server.Httpd;
using LiveMap.Server.Network;
using LiveMap.Server.Patches;
using LiveMap.Server.Render;
using LiveMap.Server.Util;
using Vintagestory.API.Common;
Expand All @@ -20,7 +19,6 @@ public sealed class LiveMapServer : Common.LiveMap {
public override ServerNetworkHandler NetworkHandler { get; }
public WebServer WebServer { get; }

private readonly ServerHarmonyPatches _patches;
public readonly RenderTask RenderTask;
private readonly long _gameTickTaskId;

Expand All @@ -35,9 +33,6 @@ public sealed class LiveMapServer : Common.LiveMap {

FileUtil.ExtractWebFiles(Api);

_patches = new ServerHarmonyPatches();
_patches.Init();

CommandHandler = new ServerCommandHandler(this);
NetworkHandler = new ServerNetworkHandler(this);

Expand Down Expand Up @@ -95,7 +90,5 @@ public sealed class LiveMapServer : Common.LiveMap {
Colormap.Dispose();

Config.Dispose();

_patches.Dispose();
}
}
2 changes: 1 addition & 1 deletion src/Server/Network/ServerNetworkHandler.cs
Expand Up @@ -22,7 +22,7 @@ public sealed class ServerNetworkHandler : NetworkHandler {
}

private void ServerReceivePacket(IServerPlayer player, ColormapPacket packet) {
if (!player.Privileges.Contains("livemap.admin")) {
if (!player.Privileges.Contains("root")) {
Logger.Warn(Lang.Get("logger.warning.packet-from-non-admin", player.PlayerName));
return;
}
Expand Down
28 changes: 0 additions & 28 deletions src/Server/Patches/PrivilegePatches.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Server/Patches/ServerHarmonyPatches.cs

This file was deleted.

0 comments on commit c1e343e

Please sign in to comment.