diff --git a/ModTools/ModTools.csproj b/ModTools/ModTools.csproj deleted file mode 100644 index 99c017b..0000000 --- a/ModTools/ModTools.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - - net48 - enable - disable - latest - ReportNotifier - - - - true - true - full - - - - true - false - none - - - - - ..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp.dll - - - ..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\CommandSystem.Core.dll - - - ..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll - - - ..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll - - - - - - - diff --git a/ModTools/ReportNotifier.cs b/ModTools/ReportNotifier.cs deleted file mode 100644 index b62221b..0000000 --- a/ModTools/ReportNotifier.cs +++ /dev/null @@ -1,70 +0,0 @@ -using LabApi.Events.Arguments.PlayerEvents; -using LabApi.Events.Handlers; -using LabApi.Features; -using LabApi.Features.Console; -using LabApi.Features.Permissions; -using LabApi.Features.Wrappers; - -namespace ReportNotifier; - -public class Plugin: LabApi.Loader.Features.Plugins.Plugin -{ - public override string Name => "ModTools"; - public override string Author => "Code002Lover"; - public override Version Version { get; } = new(1, 0, 0); - public override string Description => "Various tools for moderation, including report notification and extra logs."; - public override Version RequiredApiVersion { get; } = new(LabApiProperties.CompiledVersion); - - public string LogFile { get; set; } = "ModTools.log"; - - private static FileStream _logFileHandler; - - public override void Enable() - { - PlayerEvents.ReportedPlayer += OnReport; - PlayerEvents.Banned += OnBan; - PlayerEvents.Kicked += OnKick; - - _logFileHandler = File.Open(LogFile, FileMode.Append); - } - - public override void Disable() - { - PlayerEvents.ReportedPlayer -= OnReport; - PlayerEvents.Banned -= OnBan; - PlayerEvents.Kicked -= OnKick; - - _logFileHandler = null; - } - - private static void OnReport(PlayerReportedPlayerEventArgs ev) - { - Log($"Received Report from {ev.Player.Nickname} for {ev.Target.Nickname} with the reason: {ev.Reason}"); - foreach (var player in Player.List) - { - Logger.Debug($"Player {player.Nickname} has permissions: {player.GetPermissions()}"); - if (player.HasPermissions("AdminChat")) - { - player.SendBroadcast($"{ev.Player.Nickname} reported {ev.Target.Nickname} for {ev.Reason}", 3, Broadcast.BroadcastFlags.AdminChat, true); - } - } - } - - private static void Log(string message) - { - Logger.Debug(message); - var now = DateTime.Now; - var bytes = System.Text.Encoding.UTF8.GetBytes($"[{now:dd.MM.yyyy : HH:mm:ss}] - {message}"); - _logFileHandler.Write(bytes, 0, bytes.Length); - } - - private static void OnBan(PlayerBannedEventArgs ev) - { - Log($"Player {ev.Player?.Nickname} ({ev.PlayerId}) got banned by {ev.Issuer.Nickname} ({ev.Issuer.PlayerId}) with reason: {ev.Reason}"); - } - - private static void OnKick(PlayerKickedEventArgs ev) - { - Log($"Player {ev.Player.Nickname} ({ev.Player.PlayerId}) got kicked by {ev.Issuer.Nickname} ({ev.Issuer.PlayerId}) with reason: {ev.Reason}"); - } -} \ No newline at end of file diff --git a/SecretPluginLaboratories.sln b/SecretPluginLaboratories.sln index c2c46d7..5964e99 100644 --- a/SecretPluginLaboratories.sln +++ b/SecretPluginLaboratories.sln @@ -18,8 +18,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RangeBan.Tests", "RangeBan. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CuffedFrenemies", "CuffedFrenemies\CuffedFrenemies.csproj", "{C3FEEC52-B7C0-4DB6-A0CA-54BE175072D8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModTools", "ModTools\ModTools.csproj", "{F0AE1ABF-4FAF-4D20-AD71-C98804442D71}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -62,9 +60,5 @@ Global {C3FEEC52-B7C0-4DB6-A0CA-54BE175072D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3FEEC52-B7C0-4DB6-A0CA-54BE175072D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3FEEC52-B7C0-4DB6-A0CA-54BE175072D8}.Release|Any CPU.Build.0 = Release|Any CPU - {F0AE1ABF-4FAF-4D20-AD71-C98804442D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0AE1ABF-4FAF-4D20-AD71-C98804442D71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0AE1ABF-4FAF-4D20-AD71-C98804442D71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0AE1ABF-4FAF-4D20-AD71-C98804442D71}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal