From 4f0a26541cce2d90718519629e28c4483d77be95 Mon Sep 17 00:00:00 2001 From: jonathan-robertson Date: Sun, 4 Jun 2023 19:54:59 -0500 Subject: [PATCH 1/3] fix bug allowing bypass of pvp protection close #78 --- CHANGELOG.md | 4 ++++ ModInfo.xml | 2 +- src/Handlers/GameMessage.cs | 13 ++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cf60bf..457c057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2023-06-04 + +- fix bug allowing bypass of pvp protection + ## [1.2.0] - 2023-05-31 - add clarification for blood moon protection buff diff --git a/ModInfo.xml b/ModInfo.xml index f06c84e..cbc803a 100644 --- a/ModInfo.xml +++ b/ModInfo.xml @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/src/Handlers/GameMessage.cs b/src/Handlers/GameMessage.cs index 8d99678..ba8968d 100644 --- a/src/Handlers/GameMessage.cs +++ b/src/Handlers/GameMessage.cs @@ -34,17 +34,16 @@ public static bool Handle(ClientInfo clientInfo, EnumGameMessages messageType, s log.Trace($"{clientIdentifier} died and did not have bloodmoon memory protection."); } - if (Config.ProtectMemoryDuringPvp && !mainName.Equals(secondaryName)) + if (Config.ProtectMemoryDuringPvp && mainName != secondaryName) { // TODO: this is nice, but damage/kill handling needs to also be redone to include the killing player in game message even if that player is offline // and probably also to give that player offline credit for the kill(s). - foreach (var kvp in GameManager.Instance.persistentPlayers.Players) + + var killerClient = ConnectionManager.Instance.Clients.GetForNameOrId(secondaryName); + if (killerClient != null) { - if (secondaryName.Equals(kvp.Value.PlayerName)) - { - log.Trace($"{clientIdentifier} was killed by {secondaryName} but this server has pvp deaths set to not harm memory."); - return true; // being killed in pvp doesn't count against player - } + log.Trace($"{clientIdentifier} was killed by {killerClient.InternalId.CombinedString} ({secondaryName}) but this server has pvp deaths set to not harm memory."); + return true; // being killed in pvp doesn't count against player } } From 0316ceed09c65a1e5425a83a550e46bdee32525d Mon Sep 17 00:00:00 2001 From: jonathan-robertson Date: Sun, 4 Jun 2023 20:24:37 -0500 Subject: [PATCH 2/3] add deprecation reminders for hardened mem --- src/Data/Config.cs | 2 +- src/Data/Values.cs | 2 +- src/Handlers/PlayerSpawnedInWorld.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Data/Config.cs b/src/Data/Config.cs index 79387c3..c471d40 100644 --- a/src/Data/Config.cs +++ b/src/Data/Config.cs @@ -115,7 +115,7 @@ public static void SetLongTermMemoryLevel(int value) { _ = player.Buffs.AddBuff(Values.BuffNewbieCoat); } - if (player.Buffs.HasBuff(Values.BuffHardenedMemory)) + if (player.Buffs.HasBuff(Values.BuffHardenedMemory)) // TODO: deprecated; remove in 2.0.0 { player.Buffs.RemoveBuff(Values.BuffHardenedMemory); PlayerHelper.GiveItem(player, Values.NameMemoryBoosters); diff --git a/src/Data/Values.cs b/src/Data/Values.cs index 6aebb6b..91e79be 100644 --- a/src/Data/Values.cs +++ b/src/Data/Values.cs @@ -15,7 +15,7 @@ internal class Values public const string BuffPositiveOutlook = "buffAmnesiaPositiveOutlook"; public const string BuffBloodmoonLifeProtection = "buffAmnesiaBloodmoonLifeProtection"; public const string BuffPostBloodmoonLifeProtection = "buffAmnesiaPostBloodmoonLifeProtection"; - public const string BuffHardenedMemory = "buffAmnesiaHardenedMemory"; + public const string BuffHardenedMemory = "buffAmnesiaHardenedMemory"; // TODO: deprecated; remove in 2.0.0 public const string BuffFragileMemory = "buffAmnesiaFragileMemory"; public const string BuffMemoryLoss = "buffAmnesiaMemoryLoss"; public const string BuffNewbieCoat = "buffNewbieCoat"; diff --git a/src/Handlers/PlayerSpawnedInWorld.cs b/src/Handlers/PlayerSpawnedInWorld.cs index 3a1bb2a..a98eb91 100644 --- a/src/Handlers/PlayerSpawnedInWorld.cs +++ b/src/Handlers/PlayerSpawnedInWorld.cs @@ -28,13 +28,13 @@ public static void Handle(ClientInfo clientInfo, RespawnType respawnType, Vector { case RespawnType.EnterMultiplayer: // first-time login for new player _ = PlayerHelper.AddPositiveOutlookTime(player, Config.PositiveOutlookTimeOnFirstJoin); - RefundHardenedMemory(clientInfo, player); + RefundHardenedMemory(clientInfo, player); // TODO: deprecated; remove in 2.0.0 HandleStandardRespawnSteps(player); break; case RespawnType.JoinMultiplayer: // existing player rejoining // grace period should continue only so long as you don't disconnect player.Buffs.RemoveBuff(Values.BuffPostBloodmoonLifeProtection); - RefundHardenedMemory(clientInfo, player); + RefundHardenedMemory(clientInfo, player); // TODO: deprecated; remove in 2.0.0 HandleStandardRespawnSteps(player); break; case RespawnType.Died: // existing player returned from death @@ -94,7 +94,7 @@ private static void HandleStandardRespawnSteps(EntityPlayer player) /// Temporary method to automatically refund any players with the Hardened Memory buff from version 1.0.0. /// /// EntityPlayer to check buffs for and refund if hardened. - private static void RefundHardenedMemory(ClientInfo clientInfo, EntityPlayer player) + private static void RefundHardenedMemory(ClientInfo clientInfo, EntityPlayer player) // TODO: deprecated; remove in 2.0.0 { if (player.Buffs.HasBuff(Values.BuffHardenedMemory)) { From 6885df89317d5a93b539fe3e33582e2115e7137a Mon Sep 17 00:00:00 2001 From: jonathan-robertson Date: Sun, 4 Jun 2023 20:26:05 -0500 Subject: [PATCH 3/3] fix players, add fragile console commands --- Amnesia.dll | Bin 54784 -> 55296 bytes CHANGELOG.md | 2 ++ src/Commands/ConsoleCmdAmnesia.cs | 35 ++++++++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Amnesia.dll b/Amnesia.dll index 8b1770beb6f301d3cd8f07e03d8110b14aba0d52..35bcbf32c1d1cbb674025da3beb9e7e9ff755c35 100644 GIT binary patch delta 18054 zcmbVz31C#!)&IHg&Age+WZo=UCd(w5Bm{<#AYl!QN@Nif0*DA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g7io#t>Xc7cqy zIQ@-V91a_L5twTyMb~rC9-jzgs1BjXPHZ!pcjtI!NEQr!s;ZHngL7Jlpusm?(B0jDC{vcu_=9!?mG zUh3xhEYSFwP4hQ?X>5L}ESBfc0yA_a%^!aP&D<7^mOsaaIkCccPdSB59Q?Cv~!K@^?t1Nxn|rIKPEqd%2{4laOA%b~)6* z41au2V6N#eoD{MNf0M@vp6(>fg2nzOmy<-G2~*^4W7f;5(+be0reYcUrmi~K15I56 zO%*wTroM{eNej&4uI^BD|7bnarzo6AB9D^|52V#BC6Dq%lDk98gQUx~GVZ|3V`FWy zE2y8ag8{`6CeT!^n@+2p2@NhtS8~EORp&T);x<+1Vk!$^B|v!^Mj+lMr#PPY-{~K1 znvA#Uo{-r#mNZo-`$S(W`|;pRfwpWr3NFN(*NGGY3s06Ig_{PWqH%Ihap@Qta?JWf z40PR{=qQSulx)kWdL=){9COW~>MrCf&lsH@VWKomFqXWM?@B^gq-*1eR|be3t)IMd zwI+5LwfhcdVQF#5vB7LKpI8S-5h<1 z$45yD2|W=$w^eREuz!?dWW4PQEIZk;&_BrKP;)`LvgV|5>DxPv(EEE^^>_ZMDo+n; M^}qjxXzuCwzgnpw5C8xG diff --git a/CHANGELOG.md b/CHANGELOG.md index 457c057..e947253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.2.1] - 2023-06-04 +- add admin command to give/heal fragile memory - fix bug allowing bypass of pvp protection +- fix/update admin command players ## [1.2.0] - 2023-05-31 diff --git a/src/Commands/ConsoleCmdAmnesia.cs b/src/Commands/ConsoleCmdAmnesia.cs index d91e804..8126f38 100644 --- a/src/Commands/ConsoleCmdAmnesia.cs +++ b/src/Commands/ConsoleCmdAmnesia.cs @@ -22,6 +22,7 @@ public ConsoleCmdAmnesia() { "debug", "toggle debug logging mode" }, { "players", "show players and their amnesia-related info" }, { "grant ", "grant player some bonus xp time" }, + { "fragile ", "give or remove fragile memory debuff" }, { "config", "show current amnesia configuration" }, { "set", "show the single-value fields you can adjust" }, { "set ", "describe how you can update this field" }, @@ -81,6 +82,13 @@ public override void Execute(List _params, CommandSenderInfo _senderInfo } HandleGrant(_params); return; + case "fragile": + if (_params.Count != 3) + { + break; + } + HandleFragile(_params); + return; case "config": SdtdConsole.Instance.Output(Config.AsString()); return; @@ -109,9 +117,9 @@ private void HandleShowPlayers() { SdtdConsole.Instance.Output("No players are currently online."); } - foreach (var player in players) + for (var i = 0; i < players.Count; i++) { - SdtdConsole.Instance.Output($"{player.entityId}. {Values.BuffHardenedMemory}: {player.Buffs.HasBuff(Values.BuffHardenedMemory)}, {Values.CVarPositiveOutlookRemTime}: {player.GetCVar(Values.CVarPositiveOutlookRemTime)} ({player.GetDebugName()})"); + SdtdConsole.Instance.Output($"{players[i].entityId,8} | {players[i].GetDebugName()} | level {players[i].Progression.Level} | {Values.BuffFragileMemory}: {players[i].Buffs.HasBuff(Values.BuffFragileMemory)} | {Values.CVarPositiveOutlookRemTime}: {players[i].GetCVar(Values.CVarPositiveOutlookRemTime)}"); } } @@ -150,6 +158,29 @@ private void HandleGrant(List @params) SdtdConsole.Instance.Output($"Added {valueToAdd} seconds of bonus xp time to {player.GetDebugName()} for a new value of {newValue}."); } + private void HandleFragile(List @params) + { + if (!bool.TryParse(@params[2], out var shouldAdd)) + { + SdtdConsole.Instance.Output("Unable to parse valueToAdd: must be of type bool"); + return; + } + var clientInfo = ConsoleHelper.ParseParamIdOrName(@params[1], true, false); + if (clientInfo == null || !GameManager.Instance.World.Players.dict.TryGetValue(clientInfo.entityId, out var player)) + { + SdtdConsole.Instance.Output("Unable to find this player; note: player must be online"); + return; + } + if (shouldAdd) + { + _ = player.Buffs.AddBuff(Values.BuffFragileMemory); + SdtdConsole.Instance.Output($"Successfully added {Values.BuffFragileMemory} to {player.GetDebugName()}."); + return; + } + player.Buffs.RemoveBuff(Values.BuffFragileMemory); + SdtdConsole.Instance.Output($"Successfully removed {Values.BuffFragileMemory} from {player.GetDebugName()}."); + } + private void RouteListRequest(List @params) { if (@params.Count() == 1)