From 158748c1be02edf0739ba79d757da446a9d2b12f Mon Sep 17 00:00:00 2001 From: FN Date: Wed, 15 May 2024 15:04:01 +0700 Subject: [PATCH 1/2] Fixed money exploit --- .../Preferences/Managers/ServerPreferencesManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index b4c73936d91..3d20a21eae2 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -9,6 +9,7 @@ using Content.Shared.Humanoid.Prototypes; using Content.Shared.Preferences; using Content.Shared.Roles; +using FastAccessors; using Robust.Shared.Configuration; using Robust.Shared.Network; using Robust.Shared.Player; @@ -102,6 +103,15 @@ private async void HandleUpdateCharacterMessage(MsgUpdateCharacter message) var curPrefs = prefsData.Prefs!; + if (profile is HumanoidCharacterProfile humanoid) + if (curPrefs.Characters.TryGetValue(slot, out var storedProfile) && storedProfile is HumanoidCharacterProfile storedHumanoid) + { + if (humanoid.BankBalance != storedHumanoid.BankBalance) + return; + } + else if (humanoid.BankBalance != HumanoidCharacterProfile.DefaultBalance) + return; + // Corvax-Sponsors-Start: Ensure removing sponsor markings if client somehow bypassed client filtering // WARN! It's not removing markings from DB! var sponsorPrototypes = _sponsors != null && _sponsors.TryGetPrototypes(message.MsgChannel.UserId, out var prototypes) From 6f1331ec80d4cfb53ca761a14ff1984aa59f11a4 Mon Sep 17 00:00:00 2001 From: FN Date: Wed, 15 May 2024 15:20:01 +0700 Subject: [PATCH 2/2] Removed unused using --- Content.Server/Preferences/Managers/ServerPreferencesManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index 3d20a21eae2..63a939fa9d4 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -9,7 +9,6 @@ using Content.Shared.Humanoid.Prototypes; using Content.Shared.Preferences; using Content.Shared.Roles; -using FastAccessors; using Robust.Shared.Configuration; using Robust.Shared.Network; using Robust.Shared.Player;