From 182196858bdb71f66cad5144499296c21dbd3663 Mon Sep 17 00:00:00 2001 From: Jakob Mueller Date: Fri, 22 Dec 2023 20:35:20 +0100 Subject: [PATCH] Fix problem with multiple bans being created --- CHANGELOG.md | 2 +- lua/vyhub/server/sv_ban.lua | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f9cc26..a043487 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -- Disable strict group sync by default +- Prevent rare situation where one ban creates multiple VyHub bans diff --git a/lua/vyhub/server/sv_ban.lua b/lua/vyhub/server/sv_ban.lua index 0eb1d4c..08e5bf9 100644 --- a/lua/vyhub/server/sv_ban.lua +++ b/lua/vyhub/server/sv_ban.lua @@ -118,6 +118,10 @@ function VyHub.Ban:handle_queue() end VyHub.API:post(url, nil, data, function(code, result) + if not VyHub.Ban.ban_queue[steamid] then + VyHub.Ban.ban_queue[steamid] = {} + end + VyHub.Ban.ban_queue[steamid][i] = nil VyHub.Ban:save_queues() VyHub.Ban:refresh()