Skip to content

Commit

Permalink
14.0 (#24)
Browse files Browse the repository at this point in the history
* 部分bug修复和14.0更新
* ex-a-4
  • Loading branch information
YongAn404 committed Dec 3, 2024
1 parent d600b43 commit c9e1d61
Show file tree
Hide file tree
Showing 15 changed files with 138 additions and 104 deletions.
20 changes: 0 additions & 20 deletions Commands/CommandPlus.cs

This file was deleted.

8 changes: 4 additions & 4 deletions Commands/PlayerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace YongAnFrame.Commands
[CommandHandler(typeof(ClientCommandHandler))]
public class PlayerCommand : ICommand
{
public string Command => "player";
public string Command => "hPlayer";

public string[] Aliases => ["play", "pl", "pr"];
public string[] Aliases => ["hPlay", "hp", "h"];

public string Description => "用于管理自己的用户";
public string Description => "用于管理自己的YongAnFrame用户";

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
Expand All @@ -26,7 +26,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
{
FramePlayer fPlayer = FramePlayer.Get(player);
fPlayer.HintManager.Clean();
fPlayer.ExPlayer.ShowHint($"<size=20>{YongAnFramePlugin.Instance.Config.BypassDoNotTrackText.Split('\n')}</size>", 10000f);
fPlayer.ExPlayer.ShowHint($"<size=20>{YongAnFramePlugin.Instance.Translation.BypassDoNotTrack.Split('\n')}</size>", 10000f);
}
return true;
}
Expand Down
43 changes: 41 additions & 2 deletions Components/CapacityList.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using System.Collections.Generic;
using System;
using System.Collections;
using System.Collections.Generic;

namespace YongAnFrame.Components
{
public class CapacityList<T>(int capacity)
public class CapacityList<T>(int capacity) : ICollection<T>, IEnumerable<T>, IEnumerable
{
private readonly List<T> list = new(capacity);

public int Capacity { get; set; } = capacity;

public int Count => list.Count;

public bool IsReadOnly => throw new System.NotImplementedException();

public T this[int index]
{
get
Expand Down Expand Up @@ -43,5 +47,40 @@ public bool Remove(T item)
{
return list.Remove(item);
}

public IEnumerator GetEnumerator()
{
return list.GetEnumerator();
}

IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return list.GetEnumerator();
}

public void Clear()
{
list.Clear();
}

public bool Contains(T item)
{
return list.Contains(item);
}

public void CopyTo(T[] array, int arrayIndex)
{
list.CopyTo(array, arrayIndex);
}

public int IndexOf(T item)
{
return list.IndexOf(item);
}

public void RemoveAt(int index)
{
list.RemoveAt(index);
}
}
}
22 changes: 22 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Exiled.API.Interfaces;
using System.ComponentModel;

namespace YongAnFrame
{
/// <summary>
/// 插件的配置
/// </summary>
public sealed class Config : IConfig
{
///<inheritdoc/>
public bool IsEnabled { get; set; } = true;
///<inheritdoc/>
public bool Debug { get; set; }
/// <summary>
/// 全局的经验加成
/// </summary>
[Description("全局的经验加成")]
public float GlobalExpMultiplier { get; set; } = 1;

}
}
9 changes: 5 additions & 4 deletions Players/FramePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public string RankName
get => ExPlayer.RankName;
set
{
if (RankName == value)
if (RankName != value)
{
ExPlayer.RankName = value;
}
Expand All @@ -109,9 +109,10 @@ public string RankName
/// </summary>
public string RankColor
{
get => ExPlayer.RankColor; set
get => ExPlayer.RankColor;
set
{
if (RankColor == value)
if (RankColor != value)
{
ExPlayer.RankColor = value;
}
Expand All @@ -125,7 +126,7 @@ public string CustomName
get => ExPlayer.CustomName;
set
{
if (CustomName == value)
if (CustomName != value)
{
ExPlayer.CustomName = value;
}
Expand Down
2 changes: 1 addition & 1 deletion Players/HintManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private IEnumerator<float> Update()
string[] text = new string[36];

int used = 0;
text[used] = $"YongAnFrame 1.0.0-Beta3";
text[used] = $"YongAnFrame 1.0.0-Beta4";

if (fPlayer.ExPlayer.DoNotTrack && !fPlayer.IsBDNT)
{
Expand Down
3 changes: 3 additions & 0 deletions Players/ICustomAlgorithm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace YongAnFrame.Players
{
/// <summary>
/// 自定义算法接口
/// </summary>
public interface ICustomAlgorithm
{
/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.11")]
[assembly: AssemblyFileVersion("1.0.0.11")]
[assembly: AssemblyVersion("1.0.0.12")]
[assembly: AssemblyFileVersion("1.0.0.12")]
17 changes: 17 additions & 0 deletions Translation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Exiled.API.Interfaces;
using System.ComponentModel;

namespace YongAnFrame
{
/// <summary>
/// 插件的翻译
/// </summary>
public sealed class Translation : ITranslation
{
/// <summary>
/// BDNT(Bypass Do Not Track)协议文本
/// </summary>
[Description("BDNT(Bypass Do Not Track)协议文本")]
public string BypassDoNotTrack { get; set; } = "BDNT(Bypass Do Not Track)协议\n根据VSR(Verified Server Rules) 8.11,所以开启DNT(Do Not Track)的玩家不会进行非服务器安全性的游戏数据收集或保存。\n根据VSR 8.11.5,所以只有签署BDNT的玩家才会对DNT相关的规则不适用。\n根据VSR 8.11.5.3,所以欲签署BDNT的玩家有知晓收集或保存数据内容的权利。\n|||如果你看不懂BDNT协议的条例请不要签署|||\n1.你将会被收集SteamID用来保存等级和称号数据,这个条例收集的数据是公开展示的,任何人都可以访问!\n2.签署玩家依然有请求删除收集或保存数据的权利,请求之后你依然有24小时可以撤销请求(注意!删除数据是不可逆的)!";
}
}
61 changes: 25 additions & 36 deletions YongAnFrame.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{913613E0-C6E7-4511-A079-BACC7BC9089C}</ProjectGuid>
<ProjectGuid>{B036C1E0-4D95-487C-BCA3-32AF84D820EA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>YongAnFrame</RootNamespace>
Expand Down Expand Up @@ -39,42 +39,42 @@
<HintPath>lib\net48\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\CommandSystem.Core.dll</HintPath>
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.API.dll</HintPath>
<Reference Include="Exiled.API, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CreditTags.dll</HintPath>
<Reference Include="Exiled.CreditTags, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CustomItems.dll</HintPath>
<Reference Include="Exiled.CustomItems, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.CustomRoles.dll</HintPath>
<Reference Include="Exiled.CustomRoles, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.Events, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Loader, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=8.13.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Permissions, Version=9.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Mirror">
<HintPath>lib\net48\Mirror.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\NorthwoodLib.dll</HintPath>
<Reference Include="NorthwoodLib, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="PluginAPI, Version=13.1.3.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\PluginAPI.dll</HintPath>
<Reference Include="PluginAPI, Version=13.1.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\PluginAPI.dll</HintPath>
</Reference>
<Reference Include="SCPSLAudioApi, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -95,11 +95,10 @@
<HintPath>lib\net48\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>packages\ExMod.Exiled.8.13.1\lib\net48\YamlDotNet.dll</HintPath>
<HintPath>packages\ExMod.Exiled.9.0.0-alpha.4\lib\net48\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\CommandPlus.cs" />
<Compile Include="Commands\ExpCommand.cs" />
<Compile Include="Commands\PlayerCommand.cs" />
<Compile Include="Components\CapacityList.cs" />
Expand All @@ -115,7 +114,8 @@
<Compile Include="Roles\Interfaces\ISkillActiveEnd.cs" />
<Compile Include="Roles\Interfaces\ISkillActiveStart.cs" />
<Compile Include="Roles\Interfaces\ISkillBurialEnd.cs" />
<Compile Include="YongAnFrameConfig.cs" />
<Compile Include="Translation.cs" />
<Compile Include="Config.cs" />
<Compile Include="YongAnFramePlugin.cs" />
<Compile Include="Commands\MessageCommand.cs" />
<Compile Include="Commands\SkillCommand.cs" />
Expand All @@ -131,21 +131,10 @@
<Compile Include="YongAnTool.cs" />
</ItemGroup>
<ItemGroup>
<None Include=".github\workflows\dev.yml" />
<None Include=".github\workflows\master.yml" />
<None Include=".github\workflows\docs.yml" />
<None Include="app.config" />
<None Include="docs\docfx.json" />
<None Include="docs\index.md" />
<None Include="docs\toc.yml" />
<None Include="packages.config" />
<None Include="SECURITY.md" />
<None Include="README.md" />
<None Include="YongAnFrame.nuspec" />
</ItemGroup>
<ItemGroup>
<Folder Include="docs\articles\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
6 changes: 3 additions & 3 deletions YongAnFrame.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0-beta3</version>
<version>1.0.0-beta4</version>
<title>$title$</title>
<authors>$author$</authors>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">LGPL-3-only</license>
<license type="expression">LGPL-3.0-only</license>
<!-- <icon>icon.png</icon> -->
<readme>docs\README.md</readme>
<projectUrl>https://github.com/YongAn404/YongAnFrame</projectUrl>
<projectUrl>https://github.com/SCP-SL-Plugin-YongAnTeam/YongAnFrame</projectUrl>
<description>$description$</description>
<releaseNotes>$version$</releaseNotes>
<copyright>$copyright$</copyright>
Expand Down
12 changes: 0 additions & 12 deletions YongAnFrameConfig.cs

This file was deleted.

16 changes: 14 additions & 2 deletions YongAnFramePlugin.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.API.Interfaces;
using Exiled.Events.Commands.Reload;
using SCPSLAudioApi;
using YongAnFrame.Players;
using YongAnFrame.Roles;

namespace YongAnFrame
{
public sealed class YongAnFramePlugin : Plugin<YongAnFrameConfig>
/// <summary>
/// 插件的驱动
/// </summary>
public sealed class YongAnFramePlugin : Plugin<Config, Translation>
{
private static YongAnFramePlugin instance;
/// <summary>
/// 获取单例
/// </summary>
public static YongAnFramePlugin Instance => instance;
///<inheritdoc/>
public override PluginPriority Priority => PluginPriority.First;
///<inheritdoc/>
public override bool IgnoreRequiredVersionCheck => true;

///<inheritdoc/>
public override void OnEnabled()
{
Log.Info("\r\n __ __ ______ __ __ ______ ______ __ __ \r\n/\\ \\_\\ \\ /\\ __ \\ /\\ \"-.\\ \\ /\\ ___\\ /\\ __ \\ /\\ \"-.\\ \\ \r\n\\ \\____ \\ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\ \\ \\-. \\ \r\n \\/\\_____\\ \\ \\_____\\ \\ \\_\\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\\\\"\\_\\ \r\n \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_/ \r\n \r\n ______ ______ ______ __ __ ______ \r\n/\\ ___\\ /\\ == \\ /\\ __ \\ /\\ \"-./ \\ /\\ ___\\ \r\n\\ \\ __\\ \\ \\ __< \\ \\ __ \\ \\ \\ \\-./\\ \\ \\ \\ __\\ \r\n \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_\\ \\ \\_____\\ \r\n \\/_/ \\/_/ /_/ \\/_/\\/_/ \\/_/ \\/_/ \\/_____/ \r\n \r\n ");
instance = this;
Log.Info("\r\n __ __ ______ __ __ ______ ______ __ __ \r\n/\\ \\_\\ \\ /\\ __ \\ /\\ \"-.\\ \\ /\\ ___\\ /\\ __ \\ /\\ \"-.\\ \\ \r\n\\ \\____ \\ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\ \\ \\-. \\ \r\n \\/\\_____\\ \\ \\_____\\ \\ \\_\\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\\\\"\\_\\ \r\n \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_/ \r\n \r\n ______ ______ ______ __ __ ______ \r\n/\\ ___\\ /\\ == \\ /\\ __ \\ /\\ \"-./ \\ /\\ ___\\ \r\n\\ \\ __\\ \\ \\ __< \\ \\ __ \\ \\ \\ \\-./\\ \\ \\ \\ __\\ \r\n \\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_\\ \\ \\_____\\ \r\n \\/_/ \\/_/ /_/ \\/_/\\/_/ \\/_/ \\/_/ \\/_____/ \r\n \r\n ");
Log.Info("============System============");
FramePlayer.SubscribeStaticEvents();
MusicManager.Instance.Init();
Expand All @@ -25,6 +36,7 @@ public override void OnEnabled()
base.OnEnabled();
}

///<inheritdoc/>
public override void OnDisabled()
{
instance = null;
Expand Down
Loading

0 comments on commit c9e1d61

Please sign in to comment.