From cdf506925482561493011ca67732d38dcd15e370 Mon Sep 17 00:00:00 2001 From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Thu, 13 Feb 2025 14:03:55 -0800 Subject: [PATCH 1/2] Vote kicks now ban the target's ip (#35131) * Make vote kicks ban the target's ip address * Make it stop crashing my game --- .../Voting/Managers/VoteManager.DefaultVotes.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index 187295a073..89f4acdef1 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -1,4 +1,6 @@ using System.Linq; +using System.Net; +using System.Net.Sockets; using Content.Server.Administration; using Content.Server.Administration.Managers; using Content.Server.Discord.WebhookMessages; @@ -48,6 +50,8 @@ namespace Content.Server.Voting.Managers else _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"Initiated a {voteType.ToString()} vote"); + _gameTicker = _entityManager.EntitySysManager.GetEntitySystem(); + bool timeoutVote = true; switch (voteType) @@ -68,7 +72,6 @@ namespace Content.Server.Voting.Managers default: throw new ArgumentOutOfRangeException(nameof(voteType), voteType, null); } - _gameTicker = _entityManager.EntitySysManager.GetEntitySystem(); _gameTicker.UpdateInfoText(); if (timeoutVote) TimeoutStandardVote(voteType); @@ -368,6 +371,15 @@ namespace Content.Server.Voting.Managers } var targetUid = located.UserId; var targetHWid = located.LastHWId; + (IPAddress, int)? targetIP = null; + + if (located.LastAddress is not null) + { + targetIP = located.LastAddress.AddressFamily is AddressFamily.InterNetwork + ? (located.LastAddress, 32) // People with ipv4 addresses get a /32 address so we ban that + : (located.LastAddress, 64); // This can only be an ipv6 address. People with ipv6 address should get /64 addresses so we ban that. + } + if (!_playerManager.TryGetSessionById(located.UserId, out ICommonSession? targetSession)) { _logManager.GetSawmill("admin.votekick") @@ -532,7 +544,7 @@ namespace Content.Server.Voting.Managers uint minutes = (uint)_cfg.GetCVar(CCVars.VotekickBanDuration); - _bans.CreateServerBan(targetUid, target, null, null, targetHWid, minutes, severity, reason); + _bans.CreateServerBan(targetUid, target, null, targetIP, targetHWid, minutes, severity, reason); } } else From 782b9798af6a400672dc1bda26099a74887a83f5 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 14 Feb 2025 14:41:40 +1100 Subject: [PATCH 2/2] Update staging engine to v245.0.0 (#35147) Update engine to v245.0.0 --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index fea592e1d5..55571ef5b1 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit fea592e1d53b043bda73a66248576caa6e3f65dc +Subproject commit 55571ef5b131dfa6f00a38e71a356ded34ca5911