From 7cae390262029a5b63e7ae81317345734257ad47 Mon Sep 17 00:00:00 2001 From: Sluimerstand Date: Thu, 25 Jul 2024 18:40:01 +0200 Subject: [PATCH] Maybe make the version check not so spammy. --- Core.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Core.lua b/Core.lua index 58a1484..b362d52 100644 --- a/Core.lua +++ b/Core.lua @@ -67,6 +67,8 @@ function app.Initialise() -- Declare session variables app.DoingStuff = false + app.Flag = {} + app.Flag["versionCheck"] = 0 -- Get player info app.Sex = C_PlayerInfo.GetSex(PlayerLocation:CreateFromUnit("player")) @@ -716,7 +718,11 @@ function event:CHAT_MSG_ADDON(prefix, text, channel, sender, target, zoneChannel -- Now compare our versions if otherGameVersion > localGameVersion or (otherGameVersion == localGameVersion and otherAddonVersion > localAddonVersion) then - app.Print("There is a newer version of "..app.NameLong.." available: "..version) + -- But only send the message once every 10 minutes + if GetServerTime() - app.Flag["versionCheck"] > 600 then + app.Print("There is a newer version of "..app.NameLong.." available: "..version) + app.Flag["versionCheck"] = GetServerTime() + end end end end