Thread Tools Display Modes
07-17-21, 11:50 AM   #1
darhanger
A Fallenroot Satyr
 
darhanger's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2017
Posts: 20
Exclamation Help to compare date

Make function for block addon when when the date doesn't match. The problem is, if the time on the computer is not correct, the function will fail. The idea is to also simultaneously check the day / month / year on the server. But duno how make it.

Lua Code:
  1. GetKeyDate = function()
  2. local KeyExpiration = { year = 2022, month = 08, day = 08, hour = 00, min = 00, sec = 00 }
  3. local KeyDate = time(KeyExpiration)
  4.     return KeyDate
  5. end;
  6. GetRealDate = function()
  7.     local OSDate = time()
  8.         return OSDate
  9. end;
  10. GetLicenseTime = function()
  11.     local function Calculate(time)
  12.         local day = floor(time/86400)
  13.         local hour = floor(mod(time,86400)/3600)
  14.         local minutes = floor(mod(time,3600)/60)
  15.         local seconds = floor(mod(time,60))
  16.             return format("%dd : %02dh : %02dm : %02ds", day, hour, minutes, seconds)
  17.     end;
  18.         local TimesLeft = GetKeyDate() - GetRealDate()
  19.         local date3 = Calculate(TimesLeft)
  20.     return date3
  21. end;
  Reply With Quote
07-17-21, 05:38 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I'd like to point out that Blizzard's Addon Policy requires addons to be made freely available for use (no paywall, etc). I'm not certain what the point of your code here is for. Not to mention that it would be incredibly easy to circumvent, since the Addon Policy also states that the code must be readable and not obfuscated.
https://us.forums.blizzard.com/en/wo...t-policy/24534
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-18-21, 12:42 AM   #3
darhanger
A Fallenroot Satyr
 
darhanger's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2017
Posts: 20
Originally Posted by Seerah View Post
I'd like to point out that Blizzard's Addon Policy requires addons to be made freely available for use (no paywall, etc). I'm not certain what the point of your code here is for. Not to mention that it would be incredibly easy to circumvent, since the Addon Policy also states that the code must be readable and not obfuscated.
https://us.forums.blizzard.com/en/wo...t-policy/24534
I'm just interested in general development.
  Reply With Quote
07-18-21, 06:01 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I'm same Seerah .. sounds like you are aiming to stop the addon from working for some reason .. seeing as some addons can work several expansions after they are made ( if they are lucky ) there would not necessarily be a reason to stop the addon from working. You shouldn't need to stop the addon working as the game will tell them if there is a problem and stop it itself, giving the user the opportunity to remove the addon themselves. Any other reason to stop it from working sounds like its against the terms of use.


That said ..

As far as I am aware the OSDate you were calculating is the date on the server the game is running on, not the person computer.

As to anything else you might want to do .. you might want to look at https://wowpedia.fandom.com/wiki/World_of_Warcraft_API as that should give you the information you need. The Addons section should be able to help you.
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help to compare date

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off