Skip to content

Commit

Permalink
Maybe make the version check not so spammy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackluster committed Jul 25, 2024
1 parent 062924d commit 7cae390
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7cae390

Please sign in to comment.