mirror of
https://gitee.com/cssfw/EasyTools.git
synced 2026-03-28 03:51:36 +08:00
style: 清理未使用的引用并添加缩进
This commit is contained in:
@@ -1,15 +1,9 @@
|
|||||||
using EasyTools.Configs;
|
using EasyTools.Events;
|
||||||
using EasyTools.Events;
|
|
||||||
using GameCore;
|
|
||||||
using LabApi.Features.Wrappers;
|
using LabApi.Features.Wrappers;
|
||||||
using MEC;
|
using MEC;
|
||||||
using NewXp.IniApi;
|
using NewXp.IniApi;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Log = LabApi.Features.Console.Logger;
|
using Log = LabApi.Features.Console.Logger;
|
||||||
|
|
||||||
namespace EasyTools.BadgeSystem
|
namespace EasyTools.BadgeSystem
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ using EasyTools.Events;
|
|||||||
using LabApi.Features.Wrappers;
|
using LabApi.Features.Wrappers;
|
||||||
using RelativePositioning;
|
using RelativePositioning;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Commands
|
namespace EasyTools.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.ComponentModel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Configs
|
namespace EasyTools.Configs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Configs
|
namespace EasyTools.Configs
|
||||||
{
|
{
|
||||||
@@ -25,7 +22,7 @@ namespace EasyTools.Configs
|
|||||||
public ushort AutoServerMessageTimer { get; set; } = 5;
|
public ushort AutoServerMessageTimer { get; set; } = 5;
|
||||||
|
|
||||||
[Description("服务器广播文本")]
|
[Description("服务器广播文本")]
|
||||||
public List<string> AutoServerMessageText { get; set; } = ["服务器广播1","服务器广播2"];
|
public List<string> AutoServerMessageText { get; set; } = ["服务器广播1", "服务器广播2"];
|
||||||
|
|
||||||
/// /////////////////////////////////////////////////
|
/// /////////////////////////////////////////////////
|
||||||
[Description("启用.bc和.c聊天系统")]
|
[Description("启用.bc和.c聊天系统")]
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
using LabApi.Loader.Features.Paths;
|
using System.ComponentModel;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Configs
|
namespace EasyTools.Configs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
using LabApi.Loader.Features.Paths;
|
using LabApi.Loader.Features.Paths;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Configs
|
namespace EasyTools.Configs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
using EasyTools.Utils;
|
using EasyTools.Utils;
|
||||||
using PlayerRoles;
|
using PlayerRoles;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Configs
|
namespace EasyTools.Configs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using EasyTools.DataBase.Serialization;
|
using EasyTools.DataBase.Serialization;
|
||||||
using EasyTools.Events;
|
using EasyTools.Events;
|
||||||
using LiteDB;
|
using LiteDB;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine.LowLevel;
|
|
||||||
|
|
||||||
namespace EasyTools.DataBase
|
namespace EasyTools.DataBase
|
||||||
{
|
{
|
||||||
@@ -22,7 +17,7 @@ namespace EasyTools.DataBase
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
using LiteDatabase database = new(CustomEventHandler.DataBaseConfig.database_path);
|
using LiteDatabase database = new(CustomEventHandler.DataBaseConfig.database_path);
|
||||||
|
|
||||||
if ((data = database.GetCollection<PlayerData>("Players")?.FindById(id)) != null)
|
if ((data = database.GetCollection<PlayerData>("Players")?.FindById(id)) != null)
|
||||||
{
|
{
|
||||||
PlayerDataDic.Add(id, data);
|
PlayerDataDic.Add(id, data);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System.Collections.Generic;
|
using EasyTools.DataBase.Serialization;
|
||||||
using EasyTools.DataBase.Serialization;
|
|
||||||
using EasyTools.Events;
|
using EasyTools.Events;
|
||||||
using LabApi.Features.Wrappers;
|
using LabApi.Features.Wrappers;
|
||||||
using LiteDB;
|
using LiteDB;
|
||||||
using MEC;
|
using MEC;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace EasyTools.DataBase
|
namespace EasyTools.DataBase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,31 +1,19 @@
|
|||||||
using CommandSystem.Commands.RemoteAdmin.Decontamination;
|
using EasyTools.BadgeSystem;
|
||||||
using EasyTools.BadgeSystem;
|
|
||||||
using EasyTools.Configs;
|
using EasyTools.Configs;
|
||||||
using EasyTools.Utils;
|
using EasyTools.Utils;
|
||||||
using GameCore;
|
|
||||||
using HintServiceMeow.UI.Utilities;
|
|
||||||
using InventorySystem.Items;
|
using InventorySystem.Items;
|
||||||
using LabApi.Events.Arguments.PlayerEvents;
|
using LabApi.Events.Arguments.PlayerEvents;
|
||||||
using LabApi.Events.Arguments.ServerEvents;
|
using LabApi.Events.Arguments.ServerEvents;
|
||||||
using LabApi.Events.CustomHandlers;
|
using LabApi.Events.CustomHandlers;
|
||||||
using LabApi.Features.Wrappers;
|
using LabApi.Features.Wrappers;
|
||||||
using MEC;
|
using MEC;
|
||||||
using NewXp.IniApi;
|
|
||||||
using PlayerRoles;
|
using PlayerRoles;
|
||||||
using PlayerStatsSystem;
|
using PlayerStatsSystem;
|
||||||
using RemoteAdmin.Communication;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection.Emit;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.LowLevel;
|
|
||||||
using static Broadcast;
|
|
||||||
using static UnityEngine.GraphicsBuffer;
|
|
||||||
using Log = LabApi.Features.Console.Logger;
|
using Log = LabApi.Features.Console.Logger;
|
||||||
|
|
||||||
namespace EasyTools.Events
|
namespace EasyTools.Events
|
||||||
@@ -123,7 +111,7 @@ namespace EasyTools.Events
|
|||||||
{
|
{
|
||||||
Badge.Remove(player);
|
Badge.Remove(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnPlayerHurting(PlayerHurtingEventArgs ev)
|
public override void OnPlayerHurting(PlayerHurtingEventArgs ev)
|
||||||
@@ -239,7 +227,7 @@ namespace EasyTools.Events
|
|||||||
{
|
{
|
||||||
Timing.CallDelayed(0.5f, () =>
|
Timing.CallDelayed(0.5f, () =>
|
||||||
{
|
{
|
||||||
Player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.AdminCommand);
|
Player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.AdminCommand);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +374,7 @@ namespace EasyTools.Events
|
|||||||
}
|
}
|
||||||
else if (randomValue < 15f && !success) // 5% 粉糖
|
else if (randomValue < 15f && !success) // 5% 粉糖
|
||||||
{
|
{
|
||||||
player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink,ItemAddReason.Undefined);
|
player.GiveCandy(InventorySystem.Items.Usables.Scp330.CandyKindID.Pink, ItemAddReason.Undefined);
|
||||||
rewardName = "获得了粉糖";
|
rewardName = "获得了粉糖";
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
@@ -412,7 +400,8 @@ namespace EasyTools.Events
|
|||||||
if (healthIndex)
|
if (healthIndex)
|
||||||
{
|
{
|
||||||
player.AddItem(ItemType.SCP500);
|
player.AddItem(ItemType.SCP500);
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
player.AddItem(ItemType.Medkit);
|
player.AddItem(ItemType.Medkit);
|
||||||
}
|
}
|
||||||
@@ -450,7 +439,8 @@ namespace EasyTools.Events
|
|||||||
{
|
{
|
||||||
PocketDimension.ForceInside(player);
|
PocketDimension.ForceInside(player);
|
||||||
rewardName = "传送到老头空间";
|
rewardName = "传送到老头空间";
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
PocketDimension.ForceExit(player);
|
PocketDimension.ForceExit(player);
|
||||||
rewardName = "离开了老头空间";
|
rewardName = "离开了老头空间";
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
using EasyTools.Configs;
|
using EasyTools.Configs;
|
||||||
using EasyTools.Events;
|
using EasyTools.Events;
|
||||||
using LabApi.Events.CustomHandlers;
|
using LabApi.Events.CustomHandlers;
|
||||||
using LabApi.Events.Handlers;
|
|
||||||
using LabApi.Features;
|
using LabApi.Features;
|
||||||
using LabApi.Features.Wrappers;
|
|
||||||
using LabApi.Loader;
|
using LabApi.Loader;
|
||||||
using LabApi.Loader.Features.Plugins;
|
using LabApi.Loader.Features.Plugins;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools
|
namespace EasyTools
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// 有关程序集的一般信息由以下
|
// 有关程序集的一般信息由以下
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ using PlayerRoles;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Utils
|
namespace EasyTools.Utils
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace NewXp.IniApi
|
namespace NewXp.IniApi
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
using CustomPlayerEffects;
|
using EasyTools.Events;
|
||||||
using EasyTools.Events;
|
|
||||||
using LabApi.Features.Wrappers;
|
using LabApi.Features.Wrappers;
|
||||||
using MEC;
|
using MEC;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace EasyTools.Utils
|
namespace EasyTools.Utils
|
||||||
@@ -45,14 +41,14 @@ namespace EasyTools.Utils
|
|||||||
_lastHealth[p] = lastHealth;
|
_lastHealth[p] = lastHealth;
|
||||||
|
|
||||||
Vector3 pos = p.Position;
|
Vector3 pos = p.Position;
|
||||||
if(_lastMove.TryGetValue(p,out var last))
|
if (_lastMove.TryGetValue(p, out var last))
|
||||||
{
|
{
|
||||||
if (Vector3.Distance(pos,last.pos) < 0.1f)
|
if (Vector3.Distance(pos, last.pos) < 0.1f)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool canceled = false;
|
bool canceled = false;
|
||||||
// 检测是否正在受伤
|
// 检测是否正在受伤
|
||||||
if (_lastDamageTime.TryGetValue(p,out var lastDamageTime))
|
if (_lastDamageTime.TryGetValue(p, out var lastDamageTime))
|
||||||
{
|
{
|
||||||
if (DateTime.UtcNow - lastDamageTime < TimeSpan.FromSeconds(CustomEventHandler.Config.heal_atk_secend)) { canceled = true; }
|
if (DateTime.UtcNow - lastDamageTime < TimeSpan.FromSeconds(CustomEventHandler.Config.heal_atk_secend)) { canceled = true; }
|
||||||
}
|
}
|
||||||
@@ -68,8 +64,10 @@ namespace EasyTools.Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { _lastMove[p] = (pos, DateTime.UtcNow); }
|
else { _lastMove[p] = (pos, DateTime.UtcNow); }
|
||||||
}else { _lastMove[p] = (pos, DateTime.UtcNow); }
|
}
|
||||||
}else if (_lastMove.ContainsKey(p)) { _lastMove.Remove(p); }
|
else { _lastMove[p] = (pos, DateTime.UtcNow); }
|
||||||
|
}
|
||||||
|
else if (_lastMove.ContainsKey(p)) { _lastMove.Remove(p); }
|
||||||
}
|
}
|
||||||
yield return Timing.WaitForSeconds(1f);
|
yield return Timing.WaitForSeconds(1f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ using LabApi.Features.Wrappers;
|
|||||||
using MEC;
|
using MEC;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EasyTools.Utils
|
namespace EasyTools.Utils
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user