WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help to compare date (https://www.wowinterface.com/forums/showthread.php?t=58843)

darhanger 07-17-21 11:50 AM

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;

Seerah 07-17-21 05:38 PM

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

darhanger 07-18-21 12:42 AM

Quote:

Originally Posted by Seerah (Post 339577)
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.

Xrystal 07-18-21 06:01 AM

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.


All times are GMT -6. The time now is 05:58 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI