From 7a69c5387a56710eff210eda6a6ad8487ffb5d16 Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:30:16 +0100 Subject: [PATCH] 1.6.6a ```diff + Reapply gravity/speed with timer + Added shake effect for slap + Fixed css_gravity and css_speed command + Fixed css_give command, for example weapon_knife returns weapon_knife instead of weapon_knife and weapon_knife_t + Small code improvements ``` --- CS2-SimpleAdmin/CS2-SimpleAdmin.cs | 2 +- CS2-SimpleAdmin/CS2-SimpleAdmin.csproj | 2 +- CS2-SimpleAdmin/Commands/playercommands.cs | 28 ++-- CS2-SimpleAdmin/Config.cs | 3 + CS2-SimpleAdmin/Events.cs | 106 ++++++++++---- .../Extensions/PlayerExtensions.cs | 18 ++- CS2-SimpleAdmin/Helper.cs | 25 +++- CS2-SimpleAdmin/Managers/PlayerManager.cs | 131 +++++++++++++----- CS2-SimpleAdmin/Managers/ServerManager.cs | 2 +- CS2-SimpleAdmin/VERSION | 2 +- CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj | 2 +- CS2-SimpleAdminApi/PlayerInfo.cs | 2 +- 12 files changed, 237 insertions(+), 86 deletions(-) diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs index e6a2f04..5a66790 100644 --- a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs @@ -19,7 +19,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)"); public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)"; public override string ModuleAuthor => "daffyy & Dliix66"; - public override string ModuleVersion => "1.6.5a"; + public override string ModuleVersion => "1.6.6a"; public override void Load(bool hotReload) { diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.csproj b/CS2-SimpleAdmin/CS2-SimpleAdmin.csproj index da6229a..a507910 100644 --- a/CS2-SimpleAdmin/CS2-SimpleAdmin.csproj +++ b/CS2-SimpleAdmin/CS2-SimpleAdmin.csproj @@ -10,7 +10,7 @@ - + diff --git a/CS2-SimpleAdmin/Commands/playercommands.cs b/CS2-SimpleAdmin/Commands/playercommands.cs index c9ae79c..3108ef6 100644 --- a/CS2-SimpleAdmin/Commands/playercommands.cs +++ b/CS2-SimpleAdmin/Commands/playercommands.cs @@ -1,5 +1,5 @@ +using System.Globalization; using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Core.Attributes.Registration; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Commands; using CounterStrikeSharp.API.Modules.Entities.Constants; @@ -10,6 +10,9 @@ namespace CS2_SimpleAdmin; public partial class CS2_SimpleAdmin { + internal static readonly Dictionary SpeedPlayers = []; + internal static readonly Dictionary GravityPlayers = []; + [RequiresPermissions("@css/slay")] [CommandHelper(minArgs: 1, usage: "<#userid or name>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] public void OnSlayCommand(CCSPlayerController? caller, CommandInfo command) @@ -265,8 +268,7 @@ internal static void SetHp(CCSPlayerController? caller, CCSPlayerController play [CommandHelper(minArgs: 1, usage: "<#userid or name> ", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] public void OnSpeedCommand(CCSPlayerController? caller, CommandInfo command) { - var callerName = caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName; - float.TryParse(command.GetArg(2), out var speed); + float.TryParse(command.GetArg(2), NumberStyles.Float, CultureInfo.InvariantCulture, out var speed); var targets = GetTarget(command); if (targets == null) return; @@ -294,6 +296,11 @@ internal static void SetSpeed(CCSPlayerController? caller, CCSPlayerController p // Set player's speed player.SetSpeed(speed); + + if (speed == 1f) + SpeedPlayers.Remove(player.Slot); + else + SpeedPlayers[player.Slot] = speed; // Log the command if (command == null) @@ -313,14 +320,12 @@ internal static void SetSpeed(CCSPlayerController? caller, CCSPlayerController p } } - [ConsoleCommand("css_gravity")] [RequiresPermissions("@css/slay")] [CommandHelper(minArgs: 1, usage: "<#userid or name> ", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] public void OnGravityCommand(CCSPlayerController? caller, CommandInfo command) { - var callerName = caller == null ? _localizer?["sa_console"] ?? "Console" : caller.PlayerName; - float.TryParse(command.GetArg(2), out var gravity); - + float.TryParse(command.GetArg(2), NumberStyles.Float, CultureInfo.InvariantCulture, out var gravity); + var targets = GetTarget(command); if (targets == null) return; @@ -347,7 +352,12 @@ internal static void SetGravity(CCSPlayerController? caller, CCSPlayerController // Set player's gravity player.SetGravity(gravity); - + + if (gravity == 1f) + GravityPlayers.Remove(player); + else + GravityPlayers[player] = gravity; + // Log the command if (command == null) Helper.LogCommand(caller, $"css_gravity {(string.IsNullOrEmpty(player.PlayerName) ? player.SteamID.ToString() : player.PlayerName)} {gravity}"); @@ -452,7 +462,7 @@ internal static void Slap(CCSPlayerController? caller, CCSPlayerController playe // Set default caller name if not provided var callerName = caller != null ? caller.PlayerName : _localizer?["sa_console"] ?? "Console"; - + // Apply slap damage to the player player.Pawn.Value?.Slap(damage); diff --git a/CS2-SimpleAdmin/Config.cs b/CS2-SimpleAdmin/Config.cs index bf492b3..134f8bb 100644 --- a/CS2-SimpleAdmin/Config.cs +++ b/CS2-SimpleAdmin/Config.cs @@ -221,6 +221,9 @@ public class OtherSettings [JsonPropertyName("ShowBanMenuIfNoTime")] public bool ShowBanMenuIfNoTime { get; set; } = true; + + [JsonPropertyName("UserMessageGagChatType")] + public bool UserMessageGagChatType { get; set; } = false; } public class CS2_SimpleAdminConfig : BasePluginConfig diff --git a/CS2-SimpleAdmin/Events.cs b/CS2-SimpleAdmin/Events.cs index 132c3b8..2fe3e8a 100644 --- a/CS2-SimpleAdmin/Events.cs +++ b/CS2-SimpleAdmin/Events.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging; using System.Text; using CounterStrikeSharp.API.Modules.Admin; +using CounterStrikeSharp.API.Modules.UserMessages; namespace CS2_SimpleAdmin; @@ -17,31 +18,33 @@ public partial class CS2_SimpleAdmin { private void RegisterEvents() { - RegisterListener(OnMapStart); RegisterListener(OnMapStart); RegisterListener(OnGameServerSteamAPIActivated); - AddCommandListener(null, OnCommandSayNew); - AddCommandListener("callvote", OnCommandCallVote); + if (Config.OtherSettings.UserMessageGagChatType) + HookUserMessage(118, HookUmChat); + + AddCommandListener(null, ComamndListenerHandler); + // AddCommandListener("callvote", OnCommandCallVote); // AddCommandListener("say", OnCommandSay); // AddCommandListener("say_team", OnCommandTeamSay); } - - private HookResult OnCommandCallVote(CCSPlayerController? caller, CommandInfo info) - { - var voteType = info.GetArg(1).ToLower(); - - if (voteType != "kick") - return HookResult.Continue; - - var target = int.TryParse(info.GetArg(2), out var userId) - ? Utilities.GetPlayerFromUserid(userId) - : null; - - if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected) - return HookResult.Continue; - - return !AdminManager.CanPlayerTarget(caller, target) ? HookResult.Stop : HookResult.Continue; - } + + // private HookResult OnCommandCallVote(CCSPlayerController? caller, CommandInfo info) + // { + // var voteType = info.GetArg(1).ToLower(); + // + // if (voteType != "kick") + // return HookResult.Continue; + // + // var target = int.TryParse(info.GetArg(2), out var userId) + // ? Utilities.GetPlayerFromUserid(userId) + // : null; + // + // if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected) + // return HookResult.Continue; + // + // return !AdminManager.CanPlayerTarget(caller, target) ? HookResult.Stop : HookResult.Continue; + // } private void OnGameServerSteamAPIActivated() { @@ -88,7 +91,9 @@ public HookResult OnClientDisconnect(EventPlayerDisconnect @event, GameEventInfo SilentPlayers.Remove(player.Slot); GodPlayers.Remove(player.Slot); - + SpeedPlayers.Remove(player.Slot); + GravityPlayers.Remove(player); + if (player.UserId.HasValue) PlayersInfo.Remove(player.UserId.Value); @@ -123,13 +128,16 @@ public HookResult OnPlayerFullConnect(EventPlayerConnectFull @event, GameEventIn } [GameEventHandler] - public HookResult OnRoundEnd(EventRoundStart @event, GameEventInfo info) + public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) { #if DEBUG Logger.LogCritical("[OnRoundEnd]"); #endif GodPlayers.Clear(); + SpeedPlayers.Clear(); + GravityPlayers.Clear(); + foreach (var player in PlayersInfo.Values) { player.DiePosition = null; @@ -153,22 +161,57 @@ public HookResult OnRoundEnd(EventRoundStart @event, GameEventInfo info) return HookResult.Continue; } + + private HookResult HookUmChat(UserMessage um) + { + var author = Utilities.GetPlayerFromIndex(um.ReadInt("entityindex")); + if (author == null || !author.IsValid || author.IsBot) + return HookResult.Continue; + + if (PlayerPenaltyManager.IsPenalized(author.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(author.Slot, PenaltyType.Silence)) + return HookResult.Stop; + + // um.Recipients.Clear(); + + return HookResult.Continue; + } - private HookResult OnCommandSayNew(CCSPlayerController? player, CommandInfo info) + private HookResult ComamndListenerHandler(CCSPlayerController? player, CommandInfo info) { if (player == null || !player.IsValid || player.IsBot) return HookResult.Continue; var command = info.GetArg(0).ToLower(); - if (command == "css_admins_reload") + switch (command) { - AddTimer(1.0f, () => ReloadAdmins(null)); - return HookResult.Continue; + case "css_admins_reload": + AddTimer(1.0f, () => ReloadAdmins(null)); + return HookResult.Continue; + case "callvote": + { + var voteType = info.GetArg(1).ToLower(); + + if (voteType != "kick") + return HookResult.Continue; + + var target = int.TryParse(info.GetArg(2), out var userId) + ? Utilities.GetPlayerFromUserid(userId) + : null; + + if (target == null || !target.IsValid || target.Connected != PlayerConnectedState.PlayerConnected) + return HookResult.Continue; + + return !AdminManager.CanPlayerTarget(player, target) ? HookResult.Stop : HookResult.Continue; + } } if (!command.Contains("say")) return HookResult.Continue; + + if (!Config.OtherSettings.UserMessageGagChatType) + if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence)) + return HookResult.Stop; if (info.GetArg(1).StartsWith($"/") || info.GetArg(1).StartsWith($"!")) @@ -177,9 +220,6 @@ private HookResult OnCommandSayNew(CCSPlayerController? player, CommandInfo info if (info.GetArg(1).Length == 0) return HookResult.Stop; - if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) || PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence)) - return HookResult.Stop; - if (command == "say" && info.GetArg(1).StartsWith($"@") && AdminManager.PlayerHasPermissions(player, "@css/chat")) { @@ -282,6 +322,8 @@ private void OnMapStart(string mapName) GodPlayers.Clear(); SilentPlayers.Clear(); + SpeedPlayers.Clear(); + GravityPlayers.Clear(); PlayerPenaltyManager.RemoveAllPenalties(); } @@ -294,6 +336,9 @@ public HookResult OnPlayerHurt(EventPlayerHurt @event, GameEventInfo info) if (player is null || @event.Attacker is null || !player.PawnIsAlive || player.PlayerPawn.Value == null) return HookResult.Continue; + if (SpeedPlayers.TryGetValue(player.Slot, out var speedPlayer)) + player.SetSpeed(speedPlayer); + if (!GodPlayers.Contains(player.Slot)) return HookResult.Continue; player.PlayerPawn.Value.Health = player.PlayerPawn.Value.MaxHealth; @@ -310,6 +355,9 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info) if (player?.UserId == null || player.IsBot || player.Connected != PlayerConnectedState.PlayerConnected) return HookResult.Continue; + SpeedPlayers.Remove(player.Slot); + GravityPlayers.Remove(player); + PlayersInfo[player.UserId.Value].DiePosition = new DiePosition( new Vector(player.PlayerPawn.Value?.AbsOrigin?.X, player.PlayerPawn.Value?.AbsOrigin?.Y, diff --git a/CS2-SimpleAdmin/Extensions/PlayerExtensions.cs b/CS2-SimpleAdmin/Extensions/PlayerExtensions.cs index e116739..5419644 100644 --- a/CS2-SimpleAdmin/Extensions/PlayerExtensions.cs +++ b/CS2-SimpleAdmin/Extensions/PlayerExtensions.cs @@ -6,6 +6,7 @@ using CounterStrikeSharp.API.Modules.Memory; using Microsoft.Extensions.Localization; using System.Text; +using CounterStrikeSharp.API.Modules.UserMessages; using Vector = CounterStrikeSharp.API.Modules.Utils.Vector; namespace CS2_SimpleAdmin; @@ -93,8 +94,8 @@ public static void Unbury(this CBasePlayerPawn pawn, float depth = 15f) public static void Freeze(this CBasePlayerPawn pawn) { - pawn.MoveType = MoveType_t.MOVETYPE_OBSOLETE; - Schema.SetSchemaValue(pawn.Handle, "CBaseEntity", "m_nActualMoveType", 1); // obsolete + pawn.MoveType = MoveType_t.MOVETYPE_INVALID; + Schema.SetSchemaValue(pawn.Handle, "CBaseEntity", "m_nActualMoveType", 11); // invalid Utilities.SetStateChanged(pawn, "CBaseEntity", "m_MoveType"); } @@ -171,6 +172,8 @@ private static void PerformSlap(CBasePlayerPawn pawn, int damage = 0) if (pawn.LifeState != (int)LifeState_t.LIFE_ALIVE) return; + var controller = pawn.Controller.Value?.As(); + /* Teleport in a random direction - thank you, Mani!*/ /* Thank you AM & al!*/ var random = new Random(); @@ -184,6 +187,17 @@ private static void PerformSlap(CBasePlayerPawn pawn, int damage = 0) pawn.AbsVelocity.Y = vel.Y; pawn.AbsVelocity.Z = vel.Z; + if (controller != null && controller.IsValid) + { + var shakeMessage = UserMessage.FromPartialName("Shake"); + shakeMessage.SetFloat("duration", 1); + shakeMessage.SetFloat("amplitude", 10); + shakeMessage.SetFloat("frequency", 1f); + shakeMessage.SetInt("command", 0); + shakeMessage.Recipients.Add(controller); + shakeMessage.Send(); + } + if (damage <= 0) return; diff --git a/CS2-SimpleAdmin/Helper.cs b/CS2-SimpleAdmin/Helper.cs index 11fac5f..f5d73b9 100644 --- a/CS2-SimpleAdmin/Helper.cs +++ b/CS2-SimpleAdmin/Helper.cs @@ -690,11 +690,30 @@ private static Dictionary BuildEnumMemberMap() public static List<(string EnumMemberValue, CsItem EnumValue)> GetWeaponsByPartialName(string input) { + // Normalize input for case-insensitive comparison + var normalizedInput = input.ToLowerInvariant(); + + // Find all matching weapons based on the input var matchingWeapons = WeaponsEnumCache.Value - .Where(kvp => kvp.Key.Contains(input)) - .Select(kvp => (kvp.Key, kvp.Value)) + .Where(kvp => kvp.Key.Contains(normalizedInput, StringComparison.InvariantCultureIgnoreCase)) + .Select(kvp => (EnumMemberValue: kvp.Key, EnumValue: kvp.Value)) + .ToList(); + + // Check for an exact match first + var exactMatch = matchingWeapons + .FirstOrDefault(m => m.EnumMemberValue.Equals(input, StringComparison.OrdinalIgnoreCase)); + + if (exactMatch.EnumMemberValue != null) + { + // Return a list containing only the exact match + return [exactMatch]; + } + + // If no exact match, get all matches that start with the input + var filteredWeapons = matchingWeapons + .Where(m => m.EnumMemberValue.StartsWith(normalizedInput, StringComparison.InvariantCultureIgnoreCase)) .ToList(); - return matchingWeapons; + return filteredWeapons; // Return all relevant matches for the partial input } } diff --git a/CS2-SimpleAdmin/Managers/PlayerManager.cs b/CS2-SimpleAdmin/Managers/PlayerManager.cs index d4138ed..5bbce5d 100644 --- a/CS2-SimpleAdmin/Managers/PlayerManager.cs +++ b/CS2-SimpleAdmin/Managers/PlayerManager.cs @@ -2,6 +2,7 @@ using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API.Modules.Admin; using CounterStrikeSharp.API.Modules.Entities; +using CounterStrikeSharp.API.Modules.Timers; using CounterStrikeSharp.API.ValveConstants.Protobuf; using CS2_SimpleAdminApi; using Dapper; @@ -205,6 +206,20 @@ await Server.NextFrameAsync(() => public void CheckPlayersTimer() { + CS2_SimpleAdmin.Instance.AddTimer(0.1f, () => + { + if (CS2_SimpleAdmin.GravityPlayers.Count <= 0) return; + + foreach (var value in CS2_SimpleAdmin.GravityPlayers) + { + if (value.Key is not + { IsValid: true, Connected: PlayerConnectedState.PlayerConnected, PawnIsAlive: true }) + continue; + + value.Key.SetGravity(value.Value); + } + }, TimerFlags.REPEAT); + CS2_SimpleAdmin.Instance.AddTimer(61.0f, () => { #if DEBUG @@ -214,23 +229,50 @@ public void CheckPlayersTimer() return; var players = Helper.GetValidPlayers(); - var onlinePlayers = players - .Where(player => player.IpAddress != null) - .Select(player => (player.IpAddress, player.SteamID, player.UserId, player.Slot)) - .ToList(); + var onlinePlayers = new List<(string? IpAddress, ulong SteamID, int? UserId, int Slot)>(); + // var onlinePlayers = players + // .Where(player => player.IpAddress != null) + // .Select(player => (player.IpAddress, player.SteamID, player.UserId, player.Slot)) + // .ToList(); - Task.Run(async () => + foreach (var player in players) { - await CS2_SimpleAdmin.Instance.MuteManager.ExpireOldMutes(); - await CS2_SimpleAdmin.Instance.BanManager.ExpireOldBans(); - await CS2_SimpleAdmin.Instance.WarnManager.ExpireOldWarns(); - await CS2_SimpleAdmin.Instance.PermissionManager.DeleteOldAdmins(); + if (player.IpAddress != null) + onlinePlayers.Add((player.IpAddress, player.SteamID, player.UserId, player.Slot)); + } + + try + { + var expireTasks = new[] + { + CS2_SimpleAdmin.Instance.BanManager.ExpireOldBans(), + CS2_SimpleAdmin.Instance.MuteManager.ExpireOldMutes(), + CS2_SimpleAdmin.Instance.WarnManager.ExpireOldWarns(), + CS2_SimpleAdmin.Instance.PermissionManager.DeleteOldAdmins() + }; - CS2_SimpleAdmin.BannedPlayers.Clear(); + Task.WhenAll(expireTasks).ContinueWith(t => + { + if (t is not { IsFaulted: true, Exception: not null }) return; + + foreach (var ex in t.Exception.InnerExceptions) + { + CS2_SimpleAdmin._logger?.LogError($"Error expiring penalties: {ex.Message}"); + } + }); + } + catch (Exception ex) + { + CS2_SimpleAdmin._logger?.LogError($"Unexpected error: {ex.Message}"); + } + + CS2_SimpleAdmin.BannedPlayers.Clear(); - if (onlinePlayers.Count > 0) + if (onlinePlayers.Count > 0) + { + try { - try + Task.Run(async () => { await CS2_SimpleAdmin.Instance.BanManager.CheckOnlinePlayers(onlinePlayers); @@ -238,39 +280,54 @@ public void CheckPlayersTimer() { await CS2_SimpleAdmin.Instance.MuteManager.CheckOnlineModeMutes(onlinePlayers); } - } - catch (Exception) + }).ContinueWith(t => { - CS2_SimpleAdmin._logger?.LogError("Unable to check bans for online players"); - } + if (t is not { IsFaulted: true, Exception: not null }) return; + + foreach (var ex in t.Exception.InnerExceptions) + { + CS2_SimpleAdmin._logger?.LogError($"Error checking online players: {ex.Message}"); + } + }); } + catch (Exception ex) + { + CS2_SimpleAdmin._logger?.LogError($"Unexpected error: {ex.Message}"); + } + } - await Server.NextFrameAsync(() => + if (onlinePlayers.Count <= 0) return; + + { + try { - if (onlinePlayers.Count > 0) + var penalizedSlots = players + .Where(player => PlayerPenaltyManager.IsSlotInPenalties(player.Slot)) + .Select(player => new + { + Player = player, + IsMuted = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute), + IsSilenced = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence), + IsGagged = PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag) + }); + + foreach (var entry in penalizedSlots) { - try - { - foreach (var player in players.Where(player => PlayerPenaltyManager.IsSlotInPenalties(player.Slot))) - { - if (!PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) && !PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence)) - player.VoiceFlags = VoiceFlags.Normal; - - if (PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Silence) || - PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Mute) || - PlayerPenaltyManager.IsPenalized(player.Slot, PenaltyType.Gag)) continue; - player.VoiceFlags = VoiceFlags.Normal; - } - - PlayerPenaltyManager.RemoveExpiredPenalties(); - } - catch (Exception) + // If the player is not muted or silenced, set voice flags to normal + if (!entry.IsMuted && !entry.IsSilenced) { - CS2_SimpleAdmin._logger?.LogError("Unable to remove old penalties"); + entry.Player.VoiceFlags = VoiceFlags.Normal; } } - }); - }); + + PlayerPenaltyManager.RemoveExpiredPenalties(); + } + catch (Exception ex) + { + CS2_SimpleAdmin._logger?.LogError($"Unable to remove old penalties: {ex.Message}"); + } + } + }, CounterStrikeSharp.API.Modules.Timers.TimerFlags.REPEAT); } } \ No newline at end of file diff --git a/CS2-SimpleAdmin/Managers/ServerManager.cs b/CS2-SimpleAdmin/Managers/ServerManager.cs index 3e59976..38f0293 100644 --- a/CS2-SimpleAdmin/Managers/ServerManager.cs +++ b/CS2-SimpleAdmin/Managers/ServerManager.cs @@ -7,7 +7,7 @@ namespace CS2_SimpleAdmin.Managers; public class ServerManager { - private int _getIpTryCount = 0; + private int _getIpTryCount; public void LoadServerData() { diff --git a/CS2-SimpleAdmin/VERSION b/CS2-SimpleAdmin/VERSION index 6842fcb..dcfd624 100644 --- a/CS2-SimpleAdmin/VERSION +++ b/CS2-SimpleAdmin/VERSION @@ -1 +1 @@ -1.6.5a \ No newline at end of file +1.6.6a \ No newline at end of file diff --git a/CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj b/CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj index 70e518f..d08b100 100644 --- a/CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj +++ b/CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/CS2-SimpleAdminApi/PlayerInfo.cs b/CS2-SimpleAdminApi/PlayerInfo.cs index b8e82af..e3d5cb7 100644 --- a/CS2-SimpleAdminApi/PlayerInfo.cs +++ b/CS2-SimpleAdminApi/PlayerInfo.cs @@ -28,7 +28,7 @@ public class PlayerInfo( public DiePosition? DiePosition { get; set; } } -public class DiePosition(Vector? position = null, QAngle? angle = null) +public struct DiePosition(Vector? position = null, QAngle? angle = null) { public Vector? Position { get; set; } = position; public QAngle? Angle { get; set; } = angle;