diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index 2f385d7f8c..2583ed0221 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using Content.Server._Corvax.Sponsors; using Content.Server.Database; using Content.Shared.CCVar; using Content.Shared.Preferences; @@ -27,7 +26,6 @@ public sealed class ServerPreferencesManager : IServerPreferencesManager, IPostI [Dependency] private readonly IDependencyCollection _dependencies = default!; [Dependency] private readonly ILogManager _log = default!; [Dependency] private readonly UserDbDataManager _userDb = default!; - [Dependency] private readonly SponsorsManager _sponsors = default!; // Cache player prefs on the server so we don't need as much async hell related to them. private readonly Dictionary _cachedPlayerPrefs = @@ -35,7 +33,7 @@ public sealed class ServerPreferencesManager : IServerPreferencesManager, IPostI private ISawmill _sawmill = default!; - // private int MaxCharacterSlots => _cfg.GetCVar(CCVars.GameMaxCharacterSlots); + private int MaxCharacterSlots => _cfg.GetCVar(CCVars.GameMaxCharacterSlots); public void Init() { @@ -57,7 +55,7 @@ private async void HandleSelectCharacterMessage(MsgSelectCharacter message) return; } - if (index < 0 || index >= GetMaxUserCharacterSlots(userId)) // Corvax-Sponsors + if (index < 0 || index >= MaxCharacterSlots) { return; } @@ -97,7 +95,7 @@ public async Task SetProfile(NetUserId userId, int slot, ICharacterProfile profi return; } - if (slot < 0 || slot >= GetMaxUserCharacterSlots(userId)) // Corvax-Sponsors + if (slot < 0 || slot >= MaxCharacterSlots) return; var curPrefs = prefsData.Prefs!; @@ -127,7 +125,7 @@ private async void HandleDeleteCharacterMessage(MsgDeleteCharacter message) return; } - if (slot < 0 || slot >= GetMaxUserCharacterSlots(userId)) // Corvax-Sponsors + if (slot < 0 || slot >= MaxCharacterSlots) { return; } @@ -178,7 +176,7 @@ public async Task LoadData(ICommonSession session, CancellationToken cancel) { PrefsLoaded = true, Prefs = new PlayerPreferences( - new[] { new KeyValuePair(0, HumanoidCharacterProfile.Random()) }, + new[] {new KeyValuePair(0, HumanoidCharacterProfile.Random())}, 0, Color.Transparent) }; @@ -215,7 +213,7 @@ public void FinishLoad(ICommonSession session) msg.Preferences = prefsData.Prefs; msg.Settings = new GameSettings { - MaxCharacterSlots = GetMaxUserCharacterSlots(session.UserId), // Corvax-Sponsors + MaxCharacterSlots = MaxCharacterSlots }; _netManager.ServerSendMessage(msg, session.Channel); } @@ -230,14 +228,6 @@ public bool HavePreferencesLoaded(ICommonSession session) return _cachedPlayerPrefs.ContainsKey(session.UserId); } - // Corvax-Sponsors-Start: Calculate total available users slots with sponsors - private int GetMaxUserCharacterSlots(NetUserId userId) - { - var maxSlots = _cfg.GetCVar(CCVars.GameMaxCharacterSlots); - var extraSlots = _sponsors.TryGetInfo(userId, out var sponsor) ? sponsor.ExtraSlots : 0; - return maxSlots + extraSlots; - } - // Corvax-Sponsors-End /// /// Tries to get the preferences from the cache diff --git a/Content.Shared/_Corvax/Sponsors/MsgSponsorInfo.cs b/Content.Shared/_Corvax/Sponsors/MsgSponsorInfo.cs index e8fc5c1daf..7acf360b31 100644 --- a/Content.Shared/_Corvax/Sponsors/MsgSponsorInfo.cs +++ b/Content.Shared/_Corvax/Sponsors/MsgSponsorInfo.cs @@ -19,9 +19,6 @@ public sealed class SponsorInfo [JsonPropertyName("priorityJoin")] public bool HavePriorityJoin { get; set; } = false; - [JsonPropertyName("extraSlots")] - public int ExtraSlots { get; set; } - [JsonPropertyName("allowedMarkings")] // TODO: Rename API field in separate PR as breaking change! public string[] AllowedMarkings { get; set; } = Array.Empty(); diff --git a/Resources/ConfigPresets/Stories/stories.toml b/Resources/ConfigPresets/Stories/stories.toml index eb97101d6a..bac6e9d9b0 100644 --- a/Resources/ConfigPresets/Stories/stories.toml +++ b/Resources/ConfigPresets/Stories/stories.toml @@ -21,7 +21,6 @@ desc = """ 📚 Присоединяйтесь к нашему дружному сообществу 📚""" map_pool = "StoriesDefaultMapPool" lobbyduration = 210 -maxcharacterslots = 2 round_restart_time = 120 contraband_examine = false