From 543b23a644afbcbd65804e756b5e788fd9fa299d Mon Sep 17 00:00:00 2001 From: CallMeJ <73816044+realCallMeJ@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:03:49 -1000 Subject: [PATCH 1/3] fix: not getting discord info till restart --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index c8766da..87f65cf 100644 --- a/server/main.lua +++ b/server/main.lua @@ -99,7 +99,7 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals) deferrals.defer() Wait(0) - if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and not discordInfo then + if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and next(discordInfo) == nil then discordInfo = checkDiscordIdentifier(identifiers) if not discordInfo then deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite)) From 3f0c47c2d0c627211360bf4a2eaa61bc53f380e0 Mon Sep 17 00:00:00 2001 From: CallMeJ <73816044+realCallMeJ@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:22:43 -1000 Subject: [PATCH 2/3] add next as a local --- server/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/main.lua b/server/main.lua index 87f65cf..28e3ef1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,6 +3,7 @@ NDCore.players = {} PlayersInfo = {} local resourceName = GetCurrentResourceName() local tempPlayersInfo = {} +local next = next Config = { serverName = GetConvar("core:serverName", "Unconfigured ND-Core Server"), From 289d040b5ce97392eae59ac06a1c1b04932426dc Mon Sep 17 00:00:00 2001 From: Andy <86536434+Andyyy7666@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:02:13 +0100 Subject: [PATCH 3/3] Update main.lua --- server/main.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 28e3ef1..774ff73 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,6 @@ NDCore.players = {} PlayersInfo = {} local resourceName = GetCurrentResourceName() local tempPlayersInfo = {} -local next = next Config = { serverName = GetConvar("core:serverName", "Unconfigured ND-Core Server"), @@ -95,12 +94,12 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals) local tempSrc = source local identifiers = getIdentifierList(tempSrc) local mainIdentifier = identifiers[Config.characterIdentifier] - local discordInfo = {} + local discordInfo = nil deferrals.defer() Wait(0) - if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and next(discordInfo) == nil then + if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" then discordInfo = checkDiscordIdentifier(identifiers) if not discordInfo then deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite))