get rid of modtools
This commit is contained in:
parent
c4ff84e8b6
commit
01b41461c1
@ -1,41 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>ReportNotifier</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<Optimize>true</Optimize>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<Optimize>true</Optimize>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommandSystem.Core">
|
||||
<HintPath>..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\CommandSystem.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mirror">
|
||||
<HintPath>..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\.local\share\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -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($"<color=#002DB3FF>{ev.Player.Nickname} reported {ev.Target.Nickname} for {ev.Reason}</color>", 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}");
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user