From da9e622bf3c99ddfef32528249569d7d8be3ad1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=20=E5=AD=A6?= <1242509682@qq.com> Date: Mon, 1 Jul 2024 20:57:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E5=AE=B5?= =?UTF-8?q?=E7=A6=81=20v2.7.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GoodNight/Commands.cs | 13 +++++++++++++ GoodNight/Goodnight.cs | 19 ++++++++++--------- GoodNight/README.md | 5 +++++ Yaaiomni | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/GoodNight/Commands.cs b/GoodNight/Commands.cs index 3440634d..d6913f39 100644 --- a/GoodNight/Commands.cs +++ b/GoodNight/Commands.cs @@ -2,6 +2,7 @@ using System.Globalization; using Terraria; using TShockAPI; +using static Org.BouncyCastle.Math.EC.ECCurve; namespace Goodnight { @@ -84,6 +85,17 @@ public static void GnCmd(CommandArgs args) } #endregion + #region 清理允许召唤表 + if (args.Parameters.Count == 1 && args.Parameters[0].ToLower() == "clear") + { + Goodnight.Config.NpcDead.Clear(); + Goodnight.KillCounters.Clear(); + args.Player.SendSuccessMessage($"已清理《允许召唤表》的怪物ID"); + Goodnight.Config.Write(); + return; + } + #endregion + #region 修改禁止怪物ID + 修改解禁怪物在线人数 if (args.Parameters.Count == 2) { @@ -258,6 +270,7 @@ private static void HelpCmd(TSPlayer player) "/gn kick —— 开启|关闭断连功能\n" + "/gn pos —— 开启|关闭召唤区\n" + "/gn all —— 开启|关闭召唤区需所有人在场\n" + + "/gn clear —— 清理《允许召唤表》\n" + "/gn boss 次数 —— 设置加入《允许召唤表》击杀要求次数\n" + "/gn reset ID —— 设置重置《允许召唤表》的怪物ID\n" + "/gn plr 人数 —— 设置无视《禁止怪物表》在线人数\n" + diff --git a/GoodNight/Goodnight.cs b/GoodNight/Goodnight.cs index 3620135a..0413fd1f 100644 --- a/GoodNight/Goodnight.cs +++ b/GoodNight/Goodnight.cs @@ -13,7 +13,7 @@ public class Goodnight : TerrariaPlugin #region 变量与插件信息 public override string Name => "宵禁"; public override string Author => "Jonesn 羽学 少司命"; - public override Version Version => new Version(2, 7, 2); + public override Version Version => new Version(2, 7, 3); public override string Description => "设置服务器无法进入或禁止生成怪物的时段"; internal static Configuration Config; #endregion @@ -116,7 +116,7 @@ private void OnSpawn(NpcSpawnEventArgs args) { if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( - $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}]个玩家! \n" + + $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}]个玩家! \n" + $"检测到{RegionInfo}已在【[c/E2FA76:{Config.RegionName}]】\n" + $"允许召唤以下怪物:\n" + $"[c/6EABE9:{NpcDeadInfo}]", Color.Aquamarine); @@ -125,7 +125,7 @@ private void OnSpawn(NpcSpawnEventArgs args) { if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( - $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}]个玩家! \n" + + $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}]个玩家! \n" + $"允许召唤表为[c/6EABE9:空],请在满足[c/FF3A4B:{Config.MaxPlayers}人]\n" + $"或[c/338AE1:宵禁时段]外: [c/DF95EC:{Config.Time.Start}] — [c/FF9187:{Config.Time.Stop}]\n" + $"尽可能击败该怪物([c/FF3A4B:{Config.DeadCount}次])来获取允许召唤权", Color.AntiqueWhite); @@ -182,7 +182,7 @@ private void OnSpawn(NpcSpawnEventArgs args) if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( $"【宵禁】当前服务器处于维护时间\n" + - $"当前在线人数不满足:[c/FF3A4B:{PlayerCount}/{Config.MaxPlayers}人" + + $"当前在线人数不满足:[c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}人\n" + $"且处于宵禁时段: [c/DF95EC:{Config.Time.Start}] — [c/FF9187:{Config.Time.Stop}]\n"+ $"仅允许召唤以下怪物:\n" + $"[c/6EABE9:{NpcDeadInfo}]\n", Color.Aquamarine); @@ -280,7 +280,7 @@ private void OnTransform(NpcTransformationEventArgs args) #endregion #region 判断杀怪计数到《允许召唤表》方法 - private Dictionary KillCounters = new Dictionary(); + internal static Dictionary KillCounters = new Dictionary(); private void OnNPCKilled(NpcKilledEventArgs args) { if (!Config.Enabled || args.npc == null) return; @@ -288,6 +288,7 @@ private void OnNPCKilled(NpcKilledEventArgs args) int KillNpc = args.npc.netID; string npcName = TShock.Utils.GetNPCById(KillNpc)?.FullName ?? "未知NPC"; var NpcListInfo = string.Join(", ", Config.NpcDead.Select(x => TShock.Utils.GetNPCById(x)?.FullName + $"({x})")); + if (Config.Npcs.Contains(KillNpc)) { if (!KillCounters.ContainsKey(KillNpc)) @@ -353,10 +354,10 @@ private static bool InRegion2() { foreach (var plr in TShock.Players) { - if (plr != null - && plr.Active - && plr.CurrentRegion != null - && plr.CurrentRegion.Name == Config.RegionName) + if (plr != null && + plr.Active && + plr.CurrentRegion != null && + plr.CurrentRegion.Name == Config.RegionName) return true; } return false; diff --git a/GoodNight/README.md b/GoodNight/README.md index e34b82b3..1ba9f9e9 100644 --- a/GoodNight/README.md +++ b/GoodNight/README.md @@ -13,6 +13,10 @@ ## 更新日志 ``` +v2.7.3 +修正一些广播格式 +加入了清理《允许召唤表》的指令(/gn clear) + v2.7.2 修复检测到没有配置文件时,创建的配置没有参数 不会因为使用/reload重复写入或覆盖原来参数等问题 @@ -92,6 +96,7 @@ v2.0.0 | /gn kick | 无 | goodnight.admin | 开启或关闭断连功能 | | /gn pos | 无 | goodnight.admin | 开启或关闭召唤区 | | /gn all | 无 | goodnight.admin | 开启或关闭召唤区需所有人在场 | +| /gn clear | 无 | goodnight.admin | 清理《允许召唤表》的怪物ID | | /gn boss 次数 | 无 | goodnight.admin | 设置加入《允许召唤表》击杀要求次数 | | /gn reset 怪物ID | 无 | goodnight.admin | 设置重置《允许召唤表》的怪物ID | | /gn plr 人数 | 无 | goodnight.admin | 设置无视《禁止怪物表》在线人数 | diff --git a/Yaaiomni b/Yaaiomni index 1dc79675..b73e8bb8 160000 --- a/Yaaiomni +++ b/Yaaiomni @@ -1 +1 @@ -Subproject commit 1dc7967580c9bfbca9b756e924f073d924a6f581 +Subproject commit b73e8bb854683b57ec784246a7df4ca88e18db81 From 715a61a0278d81b1c373c498bf82bfc89fb42d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=20=E5=AD=A6?= <1242509682@qq.com> Date: Mon, 1 Jul 2024 21:40:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DisableMonsCoin/Commands.cs | 2 +- DisableMonsCoin/Configuration.cs | 2 +- .../{DisableMonsCoin.csproj => DisableMonsLoot.csproj} | 0 DisableMonsCoin/Plugin.cs | 6 +++--- DisableMonsCoin/README.md | 2 +- GoodNight/Goodnight.cs | 2 +- Plugin.sln | 2 +- README.md | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename DisableMonsCoin/{DisableMonsCoin.csproj => DisableMonsLoot.csproj} (100%) diff --git a/DisableMonsCoin/Commands.cs b/DisableMonsCoin/Commands.cs index 05dd784a..7cf4f81c 100644 --- a/DisableMonsCoin/Commands.cs +++ b/DisableMonsCoin/Commands.cs @@ -1,7 +1,7 @@ using TShockAPI; using Microsoft.Xna.Framework; -namespace DisableMonsCoin +namespace DisableMonsLoot { public class Commands { diff --git a/DisableMonsCoin/Configuration.cs b/DisableMonsCoin/Configuration.cs index a36eada9..4938effe 100644 --- a/DisableMonsCoin/Configuration.cs +++ b/DisableMonsCoin/Configuration.cs @@ -1,7 +1,7 @@ using Newtonsoft.Json; using TShockAPI; -namespace DisableMonsCoin +namespace DisableMonsLoot { internal class Configuration { diff --git a/DisableMonsCoin/DisableMonsCoin.csproj b/DisableMonsCoin/DisableMonsLoot.csproj similarity index 100% rename from DisableMonsCoin/DisableMonsCoin.csproj rename to DisableMonsCoin/DisableMonsLoot.csproj diff --git a/DisableMonsCoin/Plugin.cs b/DisableMonsCoin/Plugin.cs index 7f73f3ee..391e0e1b 100644 --- a/DisableMonsCoin/Plugin.cs +++ b/DisableMonsCoin/Plugin.cs @@ -2,11 +2,11 @@ using TerrariaApi.Server; using TShockAPI; using TShockAPI.Hooks; -using static DisableMonsCoin.Configuration; -using static DisableMonsCoin.Commands; +using static DisableMonsLoot.Configuration; +using static DisableMonsLoot.Commands; -namespace DisableMonsCoin; +namespace DisableMonsLoot; [ApiVersion(2, 1)] public class Plugin : TerrariaPlugin diff --git a/DisableMonsCoin/README.md b/DisableMonsCoin/README.md index 79f7b4ce..33c41b62 100644 --- a/DisableMonsCoin/README.md +++ b/DisableMonsCoin/README.md @@ -1,4 +1,4 @@ -# DisableMonsCoin 禁怪物掉落 +# DisableMonsLoot 禁怪物掉落 - 作者: 羽学 - 出处: [github](https://gitee.com/Crafty/bean-points) diff --git a/GoodNight/Goodnight.cs b/GoodNight/Goodnight.cs index 0413fd1f..267e41d5 100644 --- a/GoodNight/Goodnight.cs +++ b/GoodNight/Goodnight.cs @@ -116,7 +116,7 @@ private void OnSpawn(NpcSpawnEventArgs args) { if (BcstSwitchOFF || (BcstDefault && BcstSwitch)) TShock.Utils.Broadcast( - $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}]个玩家! \n" + + $"【宵禁】当前[c/338AE1:服务器]存在 [c/FF3A4B:{PlayerCount}]/{Config.MaxPlayers}个玩家! \n" + $"检测到{RegionInfo}已在【[c/E2FA76:{Config.RegionName}]】\n" + $"允许召唤以下怪物:\n" + $"[c/6EABE9:{NpcDeadInfo}]", Color.Aquamarine); diff --git a/Plugin.sln b/Plugin.sln index d0020a81..5ced8229 100644 --- a/Plugin.sln +++ b/Plugin.sln @@ -44,7 +44,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CGive", "CGive\CGive.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableGodMod", "DisableGodMod\DisableGodMod.csproj", "{5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsCoin", "DisableMonsCoin\DisableMonsCoin.csproj", "{C8B631CB-F176-4921-B313-6E49A4AAC3AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsLoot", "DisableMonsCoin\DisableMonsLoot.csproj", "{C8B631CB-F176-4921-B313-6E49A4AAC3AC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableSurfaceProjectiles", "DisableSurfaceProjectiles\DisableSurfaceProjectiles.csproj", "{CD5A7945-D416-4DEE-8079-DF0B9B3652ED}" EndProject diff --git a/README.md b/README.md index fee8933f..07d96141 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ | [BridgeBuilder](BridgeBuilder/README.md) | 快速铺桥 | 无 | | [OnlineGiftPackage](OnlineGiftPackage/README.md) | 在线礼包 | 无 | | [LifemaxExtra](LifemaxExtra/README.md) | 吃更多生命果/水晶 | 无 | -| [DisableMonsCoin](DisableMonsCoin/README.md) | 禁怪物掉落 | 无 | +| [DisableMonsLoot](DisableMonsLoot/README.md) | 禁怪物掉落 | 无 | | [PermaBuff](PermaBuff/README.md) | 永久 Buff | 无 | | [ShortCommand](ShortCommand/README.md) | 简短指令 | 无 | | [ProgressBag](ProgressBag/README.md) | 进度礼包 | 无 | From da255fb6a1b2b0813a31c957aaaf62982626615c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=20=E5=AD=A6?= <1242509682@qq.com> Date: Mon, 1 Jul 2024 21:41:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {DisableMonsCoin => DisableMonsLoot}/Commands.cs | 0 {DisableMonsCoin => DisableMonsLoot}/Configuration.cs | 0 {DisableMonsCoin => DisableMonsLoot}/DisableMonsLoot.csproj | 0 {DisableMonsCoin => DisableMonsLoot}/Plugin.cs | 0 {DisableMonsCoin => DisableMonsLoot}/README.md | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {DisableMonsCoin => DisableMonsLoot}/Commands.cs (100%) rename {DisableMonsCoin => DisableMonsLoot}/Configuration.cs (100%) rename {DisableMonsCoin => DisableMonsLoot}/DisableMonsLoot.csproj (100%) rename {DisableMonsCoin => DisableMonsLoot}/Plugin.cs (100%) rename {DisableMonsCoin => DisableMonsLoot}/README.md (100%) diff --git a/DisableMonsCoin/Commands.cs b/DisableMonsLoot/Commands.cs similarity index 100% rename from DisableMonsCoin/Commands.cs rename to DisableMonsLoot/Commands.cs diff --git a/DisableMonsCoin/Configuration.cs b/DisableMonsLoot/Configuration.cs similarity index 100% rename from DisableMonsCoin/Configuration.cs rename to DisableMonsLoot/Configuration.cs diff --git a/DisableMonsCoin/DisableMonsLoot.csproj b/DisableMonsLoot/DisableMonsLoot.csproj similarity index 100% rename from DisableMonsCoin/DisableMonsLoot.csproj rename to DisableMonsLoot/DisableMonsLoot.csproj diff --git a/DisableMonsCoin/Plugin.cs b/DisableMonsLoot/Plugin.cs similarity index 100% rename from DisableMonsCoin/Plugin.cs rename to DisableMonsLoot/Plugin.cs diff --git a/DisableMonsCoin/README.md b/DisableMonsLoot/README.md similarity index 100% rename from DisableMonsCoin/README.md rename to DisableMonsLoot/README.md From d388f6f7ffd3ffab2b26e3f521422a808b3cd723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BE=BD=20=E5=AD=A6?= <1242509682@qq.com> Date: Mon, 1 Jul 2024 22:28:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=8A=8A?= =?UTF-8?q?=E7=A6=81=E6=80=AA=E7=89=A9=E6=8E=89=E8=90=BD=E7=9A=84=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E6=94=B9=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugin.sln | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Plugin.sln b/Plugin.sln index 5ced8229..5a2e1292 100644 --- a/Plugin.sln +++ b/Plugin.sln @@ -44,8 +44,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CGive", "CGive\CGive.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableGodMod", "DisableGodMod\DisableGodMod.csproj", "{5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsLoot", "DisableMonsCoin\DisableMonsLoot.csproj", "{C8B631CB-F176-4921-B313-6E49A4AAC3AC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableSurfaceProjectiles", "DisableSurfaceProjectiles\DisableSurfaceProjectiles.csproj", "{CD5A7945-D416-4DEE-8079-DF0B9B3652ED}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NormalDropsBags", "NormalDropsBags\NormalDropsBags.csproj", "{D169A104-9372-4DB4-AF39-B511087885A0}" @@ -190,6 +188,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpclPerm", "SpclPerm\SpclPe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonsterRegen", "MonsterRegen\MonsterRegen.csproj", "{9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisableMonsLoot", "DisableMonsLoot\DisableMonsLoot.csproj", "{98A03E00-1A75-426C-8172-3C954130EEA1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -342,14 +342,6 @@ Global {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|Any CPU.Build.0 = Release|Any CPU {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|x64.ActiveCfg = Release|Any CPU {5C7C65FD-E104-4BDA-B7E5-4FC1BF0D2F16}.Release|x64.Build.0 = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Debug|x64.Build.0 = Debug|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|Any CPU.Build.0 = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|x64.ActiveCfg = Release|Any CPU - {C8B631CB-F176-4921-B313-6E49A4AAC3AC}.Release|x64.Build.0 = Release|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD5A7945-D416-4DEE-8079-DF0B9B3652ED}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -926,6 +918,14 @@ Global {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|Any CPU.Build.0 = Release|Any CPU {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|x64.ActiveCfg = Release|Any CPU {9C2892C6-0F71-443D-9DF8-6FBF3BDCBE9D}.Release|x64.Build.0 = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|x64.ActiveCfg = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Debug|x64.Build.0 = Debug|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|Any CPU.Build.0 = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|x64.ActiveCfg = Release|Any CPU + {98A03E00-1A75-426C-8172-3C954130EEA1}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE