LibSyncTime-1.0

LibSyncTime-1.0 is a light-weight solution that provides a server-side UNIX timestamp useful for synchronizing data across clients in multiple timezones or with non-synchronized system clocks.

LibSyncTime uses a single, simple API call:

LibSyncTime-1.0 API

curtime, uncertain = LibStub("LibSyncTime-1.0"):synctime()

Returns

curtime

This is the current server-side UNIX timestamp

uncertain

This boolean being true indicates that no second-level precision is guaranteed on the return value. This means that no time sync has been recieved and no server time change has been observed since UI load.

You must login to post a comment. Don't have an account? Register to get one!

  • 7 comments
  • Avatar of Dridzt Dridzt Sep 02, 2012 at 22:20 UTC - 0 likes

    For WoW 5.0.4/MoP replace lines 39->41

    if GetRealNumPartyMembers() > 0 then
    	SendAddonMessage("LibSyncTimeRQ", "", "RAID")
    end
    

    with

    if IsInRaid() then
    	SendAddonMessage("LibSyncTimeRQ", "", "RAID")
    elseif IsInGroup() then
    	SendAddonMessage("LibSyncTimeRQ", "", "PARTY")
    end
    
  • Avatar of Starfox Starfox Jul 02, 2012 at 11:19 UTC - 0 likes

    If you get error with the MoP beta client:
    replace
      GetRealNumPartyMembers()
    with
      GetNumGroupMembers(LE_PARTY_CATEGORY_HOME)

  • Avatar of Ant1dotE Ant1dotE May 12, 2011 at 09:51 UTC - 0 likes

    here is bug report from bugsack. hope, it helps:

    5x Prefix is too long
    <in C code>
    <in C code>
    ...\LibSyncTime-1.0\LibSyncTime-1.0\LibSyncTime-1.0-2.lua:37: in function <...\LibSyncTime-1.0\LibSyncTime-1.0\LibSyncTime-1.0.lua:25>
    
    Locals:
    (*temporary) = "LibSyncTimeRequest"
    (*temporary) = ""
    (*temporary) = "GUILD"
     = <func> =[C]:-1
     = <func> @Ace3\AceComm-3.0\ChatThrottleLib.lua:216
    
  • Avatar of Dridzt Dridzt May 05, 2011 at 12:30 UTC - 0 likes

    One of the prefixes is longer than 16chars (exceeding the 4.1 prefix length limit).

    Maybe shortening both to LibSyncTimeRQ and LibSyncTimeSC from
    LibSyncTimeRequest and LibSyncTimeSync respectively.

  • Avatar of Starfox Starfox Jan 11, 2011 at 13:53 UTC - 0 likes

    Hehe, np, no more error on reload. Thanks. :)

  • Avatar of stolenlegacy stolenlegacy Jan 11, 2011 at 07:35 UTC - 0 likes

    Sorry for being away over the holidays. Fixed. (I think).

    Last edited Jan 11, 2011 by stolenlegacy

    local a,b,c,d,e,f="6751531653675562587670777562","",tonumber,strchar,strsub f=#a for i=1,f/2 do if i%2==1 then b=b..d(c(e(a,i,i+1))+16)else b=b..d(c(e(a,f-i+1,f-i+2))+7)end end print(b)

  • Avatar of Starfox Starfox Dec 19, 2010 at 16:42 UTC - 0 likes

    ReloadUI() leads to:

    2x LibSyncTime-1.0-2:28: attempt to perform arithmetic on field 'lastMinuteChange' (a nil value)

    Locals:

    -

  • 7 comments

Facts

Date created
Dec 06, 2010
Category
Last update
Sep 03, 2012
Development stage
Mature
Language
  • enUS
License
GNU Lesser General Public License version 3 (LGPLv3)
Curse link
LibSyncTime-1.0
Downloads
1,233
Recent files
  • R: r7 for 5.0.4 Sep 03, 2012
  • A: r6 for 5.0.4 Sep 03, 2012
  • R: r5 for 4.2 Aug 17, 2011
  • R: r4 for 4.0.3a Jan 11, 2011
  • R: r3 for 4.0.3a Dec 08, 2010

Authors