Skip to content

Commit fe31c78

Browse files
Up someing
1 parent d611bbf commit fe31c78

File tree

10 files changed

+566
-0
lines changed

10 files changed

+566
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{15DBB390-4F2D-4D0B-93E4-23EB13AF1828}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>FuckYouNorthWood</RootNamespace>
11+
<AssemblyName>FuckYouNorthWood</AssemblyName>
12+
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
34+
<DebugSymbols>true</DebugSymbols>
35+
<OutputPath>bin\x64\Debug\</OutputPath>
36+
<DefineConstants>DEBUG;TRACE</DefineConstants>
37+
<DebugType>full</DebugType>
38+
<PlatformTarget>x64</PlatformTarget>
39+
<LangVersion>7.3</LangVersion>
40+
<ErrorReport>prompt</ErrorReport>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
43+
<OutputPath>bin\x64\Release\</OutputPath>
44+
<DefineConstants>TRACE</DefineConstants>
45+
<Optimize>true</Optimize>
46+
<DebugType>pdbonly</DebugType>
47+
<PlatformTarget>x64</PlatformTarget>
48+
<LangVersion>7.3</LangVersion>
49+
<ErrorReport>prompt</ErrorReport>
50+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
51+
<DocumentationFile>bin\x64\Release\FuckYouNorthWood.xml</DocumentationFile>
52+
</PropertyGroup>
53+
<ItemGroup>
54+
<Reference Include="Assembly-CSharp">
55+
<HintPath>..\..\DSPlugin\Managed\Assembly-CSharp.dll</HintPath>
56+
<Private>False</Private>
57+
</Reference>
58+
<Reference Include="Assembly-CSharp-firstpass">
59+
<HintPath>..\..\DSPlugin\Managed\Assembly-CSharp-firstpass.dll</HintPath>
60+
<Private>False</Private>
61+
</Reference>
62+
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
63+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\CommandSystem.Core.dll</HintPath>
64+
<Private>False</Private>
65+
</Reference>
66+
<Reference Include="Exiled.API, Version=8.14.1.0, Culture=neutral, processorArchitecture=AMD64">
67+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\Exiled.API.dll</HintPath>
68+
<Private>False</Private>
69+
</Reference>
70+
<Reference Include="Exiled.Events, Version=8.14.1.0, Culture=neutral, processorArchitecture=AMD64">
71+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\Exiled.Events.dll</HintPath>
72+
<Private>False</Private>
73+
</Reference>
74+
<Reference Include="Exiled.Loader, Version=8.14.1.0, Culture=neutral, processorArchitecture=AMD64">
75+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\Exiled.Loader.dll</HintPath>
76+
<Private>False</Private>
77+
</Reference>
78+
<Reference Include="NorthwoodLib, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
79+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\NorthwoodLib.dll</HintPath>
80+
<Private>False</Private>
81+
</Reference>
82+
<Reference Include="System">
83+
<Private>False</Private>
84+
</Reference>
85+
<Reference Include="System.Core">
86+
<Private>False</Private>
87+
</Reference>
88+
<Reference Include="System.Xml.Linq">
89+
<Private>False</Private>
90+
</Reference>
91+
<Reference Include="System.Data.DataSetExtensions">
92+
<Private>False</Private>
93+
</Reference>
94+
<Reference Include="Microsoft.CSharp">
95+
<Private>False</Private>
96+
</Reference>
97+
<Reference Include="System.Data">
98+
<Private>False</Private>
99+
</Reference>
100+
<Reference Include="System.Net.Http">
101+
<Private>False</Private>
102+
</Reference>
103+
<Reference Include="System.Xml">
104+
<Private>False</Private>
105+
</Reference>
106+
<Reference Include="UnityEngine">
107+
<HintPath>..\..\DSPlugin\Managed\UnityEngine.dll</HintPath>
108+
<Private>False</Private>
109+
</Reference>
110+
<Reference Include="UnityEngine.CoreModule">
111+
<HintPath>..\..\DSPlugin\Managed\UnityEngine.CoreModule.dll</HintPath>
112+
<Private>False</Private>
113+
</Reference>
114+
<Reference Include="UnityEngine.PhysicsModule">
115+
<HintPath>..\..\DSPlugin\Managed\UnityEngine.PhysicsModule.dll</HintPath>
116+
<Private>False</Private>
117+
</Reference>
118+
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
119+
<HintPath>..\packages\ExMod.Exiled.8.14.1\lib\net48\YamlDotNet.dll</HintPath>
120+
<Private>False</Private>
121+
</Reference>
122+
</ItemGroup>
123+
<ItemGroup>
124+
<Compile Include="Plugin\Core.cs" />
125+
<Compile Include="Plugin\PluginConfig.cs" />
126+
<Compile Include="Properties\AssemblyInfo.cs" />
127+
<Compile Include="Whitelist\API\Split.cs" />
128+
<Compile Include="Whitelist\GetIPList.cs" />
129+
<Compile Include="Whitelist\PlayerJoin.cs" />
130+
</ItemGroup>
131+
<ItemGroup>
132+
<AdditionalFiles Include="stylecop.json" />
133+
</ItemGroup>
134+
<ItemGroup>
135+
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
136+
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
137+
</ItemGroup>
138+
<ItemGroup />
139+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
140+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ProjectView>ProjectFiles</ProjectView>
5+
</PropertyGroup>
6+
</Project>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="Core.cs" company="Carl Frellett">
3+
// Copyright (c) Carl Frellett. All rights reserved.
4+
// Licensed under the GPL-3.0 license license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace FuckYouNorthWood
9+
{
10+
using Exiled.API.Enums;
11+
using Exiled.API.Features;
12+
using FuckYouNorthWood.Whitelist;
13+
14+
#pragma warning disable SA1201
15+
/// <summary>
16+
/// 插件主类, 用于加载插件.
17+
/// </summary>
18+
public class Core : Plugin<PluginConfig>
19+
{
20+
/// <inheritdoc/>
21+
public override string Author => "Carl Frellett";
22+
23+
/// <inheritdoc/>
24+
public override string Name => "FuckYouNorthWood";
25+
26+
/// <inheritdoc/>
27+
public override PluginPriority Priority => PluginPriority.High;
28+
29+
/// <summary>
30+
/// 静态接口Config.
31+
/// </summary>
32+
internal static PluginConfig PluginConfig = new PluginConfig();
33+
34+
/// <summary>
35+
/// 当插件启动时.
36+
/// </summary>
37+
public override void OnEnabled()
38+
{
39+
base.OnEnabled();
40+
41+
GetIPList.FetchIpList();
42+
Log.Info("FuckYou140scpsl - 旧版白名单插件 [已加载]");
43+
Log.Info("FuckYou140scpsl - 旧版白名单更新系统 [已加载]");
44+
45+
PlayerJoin joinEvent = new PlayerJoin();
46+
Exiled.Events.Handlers.Player.Joined += joinEvent.Join;
47+
}
48+
49+
/// <summary>
50+
/// 当插件关闭时.
51+
/// </summary>
52+
public override void OnDisabled()
53+
{
54+
base.OnDisabled();
55+
Log.Info("FuckYou140scpsl - 旧版白名单插件 [已卸载]");
56+
57+
PlayerJoin joinEvent = null;
58+
Exiled.Events.Handlers.Player.Joined -= joinEvent.Join;
59+
}
60+
}
61+
#pragma warning restore SA1201
62+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="PluginConfig.cs" company="Carl Frellett">
3+
// Copyright (c) Carl Frellett. All rights reserved.
4+
// Licensed under the GPL-3.0 license license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace FuckYouNorthWood
9+
{
10+
using System.ComponentModel;
11+
12+
using Exiled.API.Interfaces;
13+
14+
/// <summary>
15+
/// 配置文件类.
16+
/// </summary>
17+
public sealed class PluginConfig : IConfig
18+
{
19+
/// <inheritdoc/>
20+
[Description("是否启用插件")]
21+
public bool IsEnabled { get; set; } = true;
22+
23+
/// <inheritdoc/>
24+
[Description("是否启用插件调试")]
25+
public bool Debug { get; set; } = false;
26+
27+
/// <summary>
28+
/// Gets or sets a value indicating whether 是否允许离线玩家加入.
29+
/// </summary>
30+
[Description("是否允许离线玩家加入?[离线玩家指未开启Steam的玩家 (关闭此选项会导致更多的作弊问题!)]")]
31+
public bool IsEnabledUnOnlinePlayerJoin { get; set; } = true;
32+
33+
/// <summary>
34+
/// Gets or sets 多久更新列表.
35+
/// </summary>
36+
[Description("多久更新一次IP列表")]
37+
public int Time { get; set; } = 100;
38+
39+
/// <summary>
40+
/// Gets or sets 首选的Url地址.
41+
/// </summary>
42+
[Description("首选Url")]
43+
public string Url { get; set; } = "https://oldserver.scpslgame.cn/api/whlistip.php?key=sdhSHJ231";
44+
45+
/// <summary>
46+
/// Gets or sets 备选的Url地址.
47+
/// </summary>
48+
[Description("备选Url")]
49+
public string Url_2 { get; set; } = "http://103.119.1.71:45684/api/whlistip.php?key=sdhSHJ231";
50+
}
51+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="AssemblyInfo.cs" company="Carl Frellett">
3+
// Copyright (c) Carl Frellett. All rights reserved.
4+
// Licensed under the GPL-3.0 license license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
using System.Reflection;
9+
using System.Runtime.InteropServices;
10+
11+
// 有关程序集的一般信息由以下
12+
// 控制。更改这些特性值可修改
13+
// 与程序集关联的信息。
14+
[assembly: AssemblyTitle("FuckYouNorthWood")]
15+
[assembly: AssemblyDescription("SCPSL怀旧服白名单系统")]
16+
[assembly: AssemblyConfiguration("Release")]
17+
[assembly: AssemblyCompany("Carl Frellett")]
18+
[assembly: AssemblyProduct("FuckYouNorthWood")]
19+
[assembly: AssemblyCopyright("Copyright ©Carl Frellett 2024")]
20+
[assembly: AssemblyTrademark("")]
21+
[assembly: AssemblyCulture("")]
22+
23+
// 将 ComVisible 设置为 false 会使此程序集中的类型
24+
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
25+
// 请将此类型的 ComVisible 特性设置为 true。
26+
[assembly: ComVisible(false)]
27+
28+
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
29+
[assembly: Guid("15dbb390-4f2d-4d0b-93e4-23eb13af1828")]
30+
31+
// 程序集的版本信息由下列四个值组成:
32+
//
33+
// 主版本
34+
// 次版本
35+
// 生成号
36+
// 修订号
37+
//
38+
[assembly: AssemblyVersion("0.0.0.0")]
39+
[assembly: AssemblyFileVersion("0.0.0.0")]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="Split.cs" company="Carl Frellett">
3+
// Copyright (c) Carl Frellett. All rights reserved.
4+
// Licensed under the GPL-3.0 license license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace FuckYouNorthWood.Whitelist.API
9+
{
10+
using System;
11+
using System.Text.RegularExpressions;
12+
13+
/// <summary>
14+
/// 用于分割IP地址以确保规整性.
15+
/// </summary>
16+
internal static class Split
17+
{
18+
/// <summary>
19+
/// 用于分割IP地址的方法.
20+
/// </summary>
21+
/// <param name="iPList">IP列表.</param>
22+
/// <returns>一个分割IP的数组方法.</returns>
23+
public static string[] IPList(string iPList)
24+
{
25+
if (string.IsNullOrEmpty(iPList))
26+
{
27+
return Array.Empty<string>();
28+
}
29+
30+
iPList = Regex.Replace(iPList, "<pre>", string.Empty, RegexOptions.IgnoreCase);
31+
iPList = Regex.Replace(iPList, "</pre>", string.Empty, RegexOptions.IgnoreCase);
32+
33+
string[] iP = iPList.Split(new string[] { "<br>" }, StringSplitOptions.RemoveEmptyEntries);
34+
35+
for (int i = 0; i < iP.Length; i++)
36+
{
37+
iP[i] = iP[i].Trim();
38+
}
39+
40+
return iP;
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)