Quick question. In SavedVariables -> TimesPlus section Census seem to be saving population data with offset = -1 day. I wonder if its ment to be that way or this is somekind of bug?
Exaple: Purged database to make sure. Then i took census:
-Game time was 13:54 (1:56PM) Today we have 14 august 2005
In saved variables it shows
2005-08-13&13:54:00
which is exactly -24h
It isnt big problem im just wondering how exactly it works :]
date
Are you on EU servers? Also, what timezone do you reside in? I do some modifying of the date based on the Server time, server locale (US or EU) and your local timezone. It is possible there is a problem with this, most likely an edge case where only at certain times is it off. If you can give me more info, it might help me to determine what I'm doing wrong.
phpbb:phpinfo()
Found first small bug (yep im digin into code) which would also remove "unable to determine locale" message
line 1219:
CensusPlus.lua
Hmm that will be hard to explain
Basicaly you don't take into account time change here in Europe. I will explain on example.
In winter(winter time so no offset to GMT):
GMT Time is lets say 8am
London time is 8am
EU (france) server time is GMT +1 which is 9am.
Ok but when time goes to summer time we have:
GMT Time is 8am
London time is GMT +summer time offset (1) so 9am
servers time is GMT time +1 +summer time so its 10am
So if( servDiff == 1 or servDiff == -23 )
won't catch it
Edit: erm whole part wrong.. should be:
Should be if( servDiff == 1 servDiff ==2)
why?
servDiff is difference between UTC and server time so in winter it is 1h and in summer 1h + summer time offset so 2h and it shouldnt be anything other for EU servers
Well thats all i found till now if i made mistake please someone correct me
im nowhere near to be timespecialist ;]
line 1219:
CensusPlus.lua
Code: Select all
if( servDiff == 1 or servDiff == -23 ) then
CensusPlus_Msg("Guessing European (EU) Servers");
if( g_CensusPlusLocale == "US" and g_TZWarningSent == false) then
CensusPlus_Msg("I guessed you are playing on EURO servers but your locale is not set to EU, are you sure this is correct? Type /census locale to change locale setting.");
g_TZWarningSent = true;
end
Basicaly you don't take into account time change here in Europe. I will explain on example.
In winter(winter time so no offset to GMT):
GMT Time is lets say 8am
London time is 8am
EU (france) server time is GMT +1 which is 9am.
Ok but when time goes to summer time we have:
GMT Time is 8am
London time is GMT +summer time offset (1) so 9am
servers time is GMT time +1 +summer time so its 10am
So if( servDiff == 1 or servDiff == -23 )
won't catch it
Edit: erm whole part wrong.. should be:
Should be if( servDiff == 1 servDiff ==2)
why?
servDiff is difference between UTC and server time so in winter it is 1h and in summer 1h + summer time offset so 2h and it shouldnt be anything other for EU servers
Well thats all i found till now if i made mistake please someone correct me

Found it
Same reason as that bug with "unable to determine locale" (post above)
Line: 152
CensusPlusPvP.lua
Should be elseif( g_CensusPlusTZOffset > 2 )
BTW i dont know if there is any need to keep that first line now ->
Hmm hopefully i didnt mess anything ;]
Same reason as that bug with "unable to determine locale" (post above)
Line: 152
CensusPlusPvP.lua
Code: Select all
if( g_CensusPlusTZOffset < -8 ) then
-- then it should only be equal to -23
TZOffset = 1;
[u]elseif( g_CensusPlusTZOffset > 1 )[/u] then
-- then it should only be equal to 16 - 20
TZOffset = g_CensusPlusTZOffset - 24;
end
BTW i dont know if there is any need to keep that first line now ->
Code: Select all
if( g_CensusPlusTZOffset < -8 ) then
-- then it should only be equal to -23
TZOffset = 1;
Sht oki its 1am here and now i understand reason for -23 in that if ;] (at least i think i understand
)
funny thing ;]
so it should be:
In CensusPlus.lua
and in CensusPlusPvP.lua
hmm >.<
Edit: Crist did mistakes again... corrected... argh now it should be ok
i should stop spaming now O.o or i will create even more complicated and full of mistakes posts

funny thing ;]
so it should be:
In CensusPlus.lua
Code: Select all
if( servDiff >= 1 and servDiff <=2) or (servDiff <= -22 and servDiff >=-23)
Code: Select all
if( g_CensusPlusTZOffset ==-23 ) then
-- then it should only be equal to -23
TZOffset = 1;
elseif( g_CensusPlusTZOffset == -22 ) then
TZOffset = 2;
elseif( g_CensusPlusTZOffset > 2 ) then
-- then it should only be equal to 16 - 20
TZOffset = g_CensusPlusTZOffset - 24;
end
Edit: Crist did mistakes again... corrected... argh now it should be ok
i should stop spaming now O.o or i will create even more complicated and full of mistakes posts
