Quantcast So it's not possible to get server side seconds-since-epoch? - WoWInterface
Thread Tools Display Modes
02-15-07, 12:19 AM   #1
Aule
A Fallenroot Satyr
 
Aule's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 20
So it's not possible to get server side seconds-since-epoch?

I'm adding features to a mod that requires an authoritative time/date stamp, so that users can report the last known time a given player was chosen as a target.

It seems that the only seconds-since-epoch functions are client-side and that there's no notion of "date" with any of the server side time functions.

This leaves me with two options:

1) Use GetTime() and just live with the fact that the "LastSeen" field will be garbage each time there is a server restart. (GetTime() returns server uptime, not SSE).

2) Use the time() function, try to figure out a way of determining what time zone the client is, and hope that their clock is accurate.


I'm thinking option 1 is by far the lesser of two evils.
__________________
"Any society that would trade liberty for security will lose both and deserve neither."
- Benjamin Franklin
  Reply With Quote
02-15-07, 12:47 AM   #2
Aule
A Fallenroot Satyr
 
Aule's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 20
Implemented an initialization check...

Since there's a server restart in the morning I'll be able to test this.

In my addon init function I implemented this:

Code:
-- Has there been a server reboot?
local current = GetTime()
if (GrudgeBook_Config.LastInitTimestamp < current) then
    -- No, server is still up since last run.
else
    -- Yes.  Invalidate all timestamps.
    GrudgeBook_InvalidateLastSeen()
end
GrudgeBook_Config.LastInitTimestamp = current
For the rest of the mod if the timestamp is nil, I display it as "Unknown".

Seconds since epoch on the server would sure be nice right about now!!
__________________
"Any society that would trade liberty for security will lose both and deserve neither."
- Benjamin Franklin
  Reply With Quote
02-15-07, 08:19 PM   #3
Tekkub
Featured Artist
 
Tekkub's Avatar
Featured
Join Date: Dec 2005
Posts: 960
why don't you just use addon messages to create a list of offsets for each client? factor in the current lag if you have to.
  Reply With Quote
02-15-07, 10:32 PM   #4
Aule
A Fallenroot Satyr
 
Aule's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 20
addon messages

Originally Posted by Tekkub
why don't you just use addon messages to create a list of offsets for each client? factor in the current lag if you have to.
I completely don't understand.

If by addon message you mean using SendAddonMessage(), that won't work because you have to be in party, raid, guild or battleground.

Sorry for my stupidity....I don't understand the idea you're getting at with the list of offsets...

Thanks for the reply tho
__________________
"Any society that would trade liberty for security will lose both and deserve neither."
- Benjamin Franklin
  Reply With Quote
02-15-07, 11:10 PM   #5
Tekkub
Featured Artist
 
Tekkub's Avatar
Featured
Join Date: Dec 2005
Posts: 960
Well I was *obviously* thinking that "last known time a given player was chosen as a target" would only be of relevance to a party, raid or battleground group

^^

I see now, you're looking to save a history for the user? Why not use their local time then?
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » So it's not possible to get server side seconds-since-epoch?

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