Skip to content

Commit

Permalink
Server Maid
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
XingYeNotFish authored Mar 18, 2024
1 parent fc2ea13 commit f4f4fd4
Show file tree
Hide file tree
Showing 37 changed files with 31,402 additions and 0 deletions.
Binary file added Server Maid.dll
Binary file not shown.
25 changes: 25 additions & 0 deletions Server Maid.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server Maid", "Server Maid\Server Maid.csproj", "{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92040C17-B7E5-4DA6-B4F0-AEC880F9645E}
EndGlobalSection
EndGlobal
70 changes: 70 additions & 0 deletions Server Maid/Maid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.API.Features.Pickups;
using Exiled.Events.EventArgs.Server;
using MEC;
using System.Collections.Generic;
using System.Linq;

namespace Server_Maid
{
public class Maid
{
public static CoroutineHandle MaidSystem_Coroutine;
private static XYlikeconfig config => Plugin.Instance.Config;
public static void Start()
{
if (config.Is_cleaning_module_enabled)
{
MaidSystem_Coroutine = Timing.RunCoroutine(MaidSystem());
Log.Warn(config.Cleaning_module_enabled_server_console_messages);
}
}

public static void End(RoundEndedEventArgs e)
{
if (config.Is_cleaning_module_enabled)
{
Timing.KillCoroutines(MaidSystem_Coroutine);
}
}

public static IEnumerator<float> MaidSystem()
{

yield return Timing.WaitForSeconds(config.Cleaning_interval);
for (; ; )
{
int ragdollnum = 0;
int itemnum = 0;

foreach (Ragdoll ragdoll in Ragdoll.List.ToHashSet())
{
ragdoll.Destroy();
int num = ragdollnum;
ragdollnum = num + 1;
}

foreach (Pickup item in Pickup.List.ToHashSet())
{
bool flag = !item.Type.IsScp() && !item.Type.IsKeycard() && !item.Type.IsMedical() && !item.Type.IsThrowable() && item.Type != ItemType.MicroHID && !item.Type.IsWeapon(true);
if (flag)
{
item.Destroy();
int num = itemnum;
itemnum = num + 1;
}
}

Log.Warn(string.Format(config.Server_console_messages, itemnum, ragdollnum));

Timing.CallDelayed(5f, delegate ()
{
Map.Broadcast(10, string.Format(config.Broadcast_messages, itemnum, ragdollnum), 0, true);
});

yield return Timing.WaitForSeconds(config.Cleaning_interval);
}
}
}
}
31 changes: 31 additions & 0 deletions Server Maid/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Exiled.API.Features;
using System;

namespace Server_Maid
{
public class Plugin : Plugin<XYlikeconfig>
{
public override string Name { get; } = "Server Maid / 服务器女仆";
public override string Author { get; } = "XingYeNotFish";
public override Version Version { get; } = new Version(1, 0, 0);

private static readonly Lazy<Plugin> LazyInstance = new Lazy<Plugin>(() => new Plugin());
public static Plugin Instance => LazyInstance.Value;

public override void OnEnabled()
{
base.OnEnabled();
Exiled.Events.Handlers.Server.RoundStarted += Maid.Start;
Exiled.Events.Handlers.Server.RoundEnded += Maid.End;
Log.Info("Plugin has been enabled! / 插件已启用!");
}

public override void OnDisabled()
{
base.OnDisabled();
Exiled.Events.Handlers.Server.RoundStarted -= Maid.Start;
Exiled.Events.Handlers.Server.RoundEnded += Maid.End;
Log.Info("Plugin has been disabled! / 插件已关闭!");
}
}
}
35 changes: 35 additions & 0 deletions Server Maid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Server Maid / 服务器女仆")]
[assembly: AssemblyDescription("A plugin that automatically helps you clean up your server's drops and ragdolls")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Server Maid / 服务器女仆")]
[assembly: AssemblyCopyright("Copyright © 2023 XingYeNotFish")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("6b577e13-73e2-45fb-bad8-19e93f31f5b6")]

// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
117 changes: 117 additions & 0 deletions Server Maid/Server Maid.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6B577E13-73E2-45FB-BAD8-19E93F31F5B6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Auto_Clear</RootNamespace>
<AssemblyName>Auto Clear</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Assembly-CSharp_publicized">
<HintPath>D:\steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\publicized_assemblies\Assembly-CSharp_publicized.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=8.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Updater.dll</HintPath>
</Reference>
<Reference Include="Mirror">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="PluginAPI, Version=12.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\PluginAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.2.1\lib\net48\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Maid.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XYlikeconfig.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
26 changes: 26 additions & 0 deletions Server Maid/XYlikeconfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Exiled.API.Interfaces;
using System.ComponentModel;

namespace Server_Maid
{
public sealed class XYlikeconfig : IConfig
{
[Description("Do you want to enable the plugin? / 是否开启此插件?")]
public bool IsEnabled { get; set; } = true;

public bool Debug { get; set; } = false;

[Description("Cleaning module settings / 清理模块设置")]
public bool Is_cleaning_module_enabled { get; set; } = true;

public string Cleaning_module_enabled_server_console_messages { get; set; } = "Cleaning module has been enable in this round!";

[Description("Cleaning interval time Unit: seconds/ 清理间隔时间 单位: 秒")]
public float Cleaning_interval { get; set; } = 300;

[Description("Cleanup ended displaying content {0} represents the number of items cleared {1} is the player's ragdolls/ 清理结束显示内容 {0} 代表清理的物品数量 {1}为玩家尸体")]
public string Server_console_messages { get; set; } = "[<color=#EEEE00>Server Maid</color>]Cleanup successful! Cleaning {0} items and {1} ragdolls this time!";

public string Broadcast_messages { get; set; } = "[<color=#EEEE00>Server Maid</color>]Cleanup successful! Cleaning {0} items and {1} ragdolls this time!";
}
}
Binary file not shown.
34 changes: 34 additions & 0 deletions Server Maid/obj/Debug/Auto Clear.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Auto Clear.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Auto Clear.pdb
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\CommandSystem.Core.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.API.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CreditTags.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CustomItems.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CustomRoles.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Events.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Loader.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Permissions.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Updater.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Mirror.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\NorthwoodLib.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\PluginAPI.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\UnityEngine.CoreModule.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\YamlDotNet.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\UnityEngine.TextRenderingModule.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\UnityEngine.InputLegacyModule.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\UnityEngine.IMGUIModule.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\UnityEngine.SharedInternalsModule.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.API.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CreditTags.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CustomItems.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.CustomRoles.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Events.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Loader.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Permissions.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Exiled.Updater.xml
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\obj\Debug\Auto Clear.csproj.AssemblyReference.cache
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\obj\Debug\Auto Clear.csproj.CoreCompileInputs.cache
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\obj\Debug\Auto Clear.csproj.CopyComplete
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\obj\Debug\Auto Clear.dll
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\obj\Debug\Auto Clear.pdb
C:\Users\TYUJH\Desktop\001\Auto Clear\Auto Clear\bin\Debug\Assembly-CSharp-Publicized.dll
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
4 changes: 4 additions & 0 deletions Server Maid/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EXILED" version="8.2.1" targetFramework="net481" />
</packages>
Binary file added packages/EXILED.8.2.1/EXILED.8.2.1.nupkg
Binary file not shown.
Binary file added packages/EXILED.8.2.1/images/Exiled_Icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added packages/EXILED.8.2.1/lib/net48/Exiled.API.dll
Binary file not shown.
Loading

0 comments on commit f4f4fd4

Please sign in to comment.