diff --git a/NwPluginAPI/Core/Server.cs b/NwPluginAPI/Core/Server.cs index 751cb2c..5804585 100644 --- a/NwPluginAPI/Core/Server.cs +++ b/NwPluginAPI/Core/Server.cs @@ -248,7 +248,7 @@ public static void Shutdown(ushort redirectPort) /// /// The command name. /// The running the command. - public static void RunCommand(string command, CommandSender sender = null) => GameCore.Console.singleton.TypeCommand(command, sender); + public static string RunCommand(string command, CommandSender sender = null) => ServerConsole.EnterCommand(command, sender); /// /// Shows a broadcast to the player. diff --git a/NwPluginAPI/Core/Zones/Light/Rooms/LczScp914.cs b/NwPluginAPI/Core/Zones/Light/Rooms/LczScp914.cs index 6bf1e0a..132264c 100644 --- a/NwPluginAPI/Core/Zones/Light/Rooms/LczScp914.cs +++ b/NwPluginAPI/Core/Zones/Light/Rooms/LczScp914.cs @@ -10,13 +10,13 @@ namespace PluginAPI.Core.Zones.Light.Rooms public class LczScp914 : LczRoom { - internal static LczScp914 Instance; + /*internal static LczScp914 Instance; public static RoomLight RoomLights => Instance.Lights; public static RoomIdentifier RoomIdentifier => Instance.Identifier; - public static PryableDoor Gate => null; + public static PryableDoor Gate => null;*/ /// /// Gets the intake chamber . diff --git a/NwPluginAPI/Core/Zones/UnknownZone.cs b/NwPluginAPI/Core/Zones/UnknownZone.cs index e3cec74..731b54c 100644 --- a/NwPluginAPI/Core/Zones/UnknownZone.cs +++ b/NwPluginAPI/Core/Zones/UnknownZone.cs @@ -5,9 +5,9 @@ namespace PluginAPI.Core.Zones /// public class UnknownZone : FacilityZone { - internal static UnknownZone Instance; + /*internal static UnknownZone Instance; /// - public override MapGeneration.FacilityZone ZoneType { get; } = MapGeneration.FacilityZone.Other; + public override MapGeneration.FacilityZone ZoneType { get; } = MapGeneration.FacilityZone.Other;*/ } } diff --git a/NwPluginAPI/Events/IEventCancellation.cs b/NwPluginAPI/Events/IEventCancellation.cs index 6c47081..b0bff80 100644 --- a/NwPluginAPI/Events/IEventCancellation.cs +++ b/NwPluginAPI/Events/IEventCancellation.cs @@ -33,6 +33,7 @@ public interface IEventCancellation /// /// The delay in seconds. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData RejectDelay(byte seconds, bool isForced) { if (seconds < 1 || seconds > 25) @@ -46,6 +47,7 @@ public static PreauthCancellationData RejectDelay(byte seconds, bool isForced) /// /// The new server port. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData RejectRedirect(ushort port, bool isForced) => new PreauthCancellationData(RejectionReason.Redirect, isForced, port: port); /// @@ -54,6 +56,7 @@ public static PreauthCancellationData RejectDelay(byte seconds, bool isForced) /// The ban reason. /// The ban expiration time. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData RejectBanned(string banReason, DateTime expiration, bool isForced) => RejectBanned(banReason, expiration.Ticks, isForced); @@ -63,6 +66,7 @@ public static PreauthCancellationData RejectBanned(string banReason, DateTime ex /// The ban reason. /// The ban expiration time in .NET Ticks. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data // ReSharper disable once MemberCanBePrivate.Global public static PreauthCancellationData RejectBanned(string banReason, long expiration, bool isForced) { @@ -77,6 +81,7 @@ public static PreauthCancellationData RejectBanned(string banReason, long expira /// /// Custom rejection reason. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData Reject(string customReason, bool isForced) { if (string.IsNullOrEmpty(customReason) || customReason.Length > 400) @@ -90,6 +95,7 @@ public static PreauthCancellationData Reject(string customReason, bool isForced) /// /// Rejection reason. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData Reject(RejectionReason reason, bool isForced) { switch (reason) @@ -110,11 +116,13 @@ public static PreauthCancellationData Reject(RejectionReason reason, bool isForc /// /// The instance. /// Indicates whether the player has to be rejected forcefully or not. + /// Event cancellation data public static PreauthCancellationData Reject(NetDataWriter writer, bool isForced) => new PreauthCancellationData(RejectionReason.NotSpecified, isForced, writer: writer); /// /// Accepts the connection. /// + /// Event cancellation data public static PreauthCancellationData Accept() => new PreauthCancellationData(RejectionReason.NotSpecified, false, isCancelled: false); @@ -177,4 +185,36 @@ public NetDataWriter GenerateWriter(out bool forced) return writer; } } + + /// + /// Preauth Event Cancellation Data + /// + public readonly struct PlayerCheckReservedSlotCancellationData : IEventCancellation + { + public bool IsCancelled { get; } + + // ReSharper disable once MemberCanBePrivate.Global + public readonly bool HasReservedSlot; + + private PlayerCheckReservedSlotCancellationData(bool isCancelled, bool hasReservedSlot) + { + IsCancelled = isCancelled; + HasReservedSlot = hasReservedSlot; + } + + /// + /// Doesn't override the reserved slot check. + /// + /// Event cancellation data + public static PlayerCheckReservedSlotCancellationData LeaveUnchanged() => + new PlayerCheckReservedSlotCancellationData(false, false); + + /// + /// Overrides reserved slot check. + /// + /// Indicates whether the player has a reserved slot or not. + /// Event cancellation data + public static PlayerCheckReservedSlotCancellationData Override(bool hasReservedSlot) => + new PlayerCheckReservedSlotCancellationData(true, hasReservedSlot); + } } \ No newline at end of file diff --git a/NwPluginAPI/NwPluginAPI.csproj b/NwPluginAPI/NwPluginAPI.csproj index ce1d626..bc27a92 100644 --- a/NwPluginAPI/NwPluginAPI.csproj +++ b/NwPluginAPI/NwPluginAPI.csproj @@ -30,7 +30,7 @@ true Northwood.PluginAPI Copyright by Hubert Moszka Northwood, 2022 - 12.0.0-beta6 + 12.0.0-beta7 diff --git a/NwPluginAPI/PluginApiVersion.cs b/NwPluginAPI/PluginApiVersion.cs index bb8746b..73b921f 100644 --- a/NwPluginAPI/PluginApiVersion.cs +++ b/NwPluginAPI/PluginApiVersion.cs @@ -3,7 +3,7 @@ internal static class PluginApiVersion { internal const string Version = "12.0.0"; //major.minor.patch ONLY - internal const string VersionString = "12.0.0-beta6"; + internal const string VersionString = "12.0.0-beta7"; //PackageVersion needs to be set to the same value as VersionString MANUALLY IN .csproj }