diff options
author | Justin Clark-Casey (justincc) | 2012-05-04 19:21:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-04 19:21:43 +0100 |
commit | cccef2e56dc8b02ccd83fb1c832e4ce026cdcaf9 (patch) | |
tree | 20f26f179ac1af19c7bfcbbc076aaebc2bc3535d /OpenSim/Services/LLLoginService/LLLoginResponse.cs | |
parent | minor: Tweak BaseHttpServer message to make it clear that this relates to slo... (diff) | |
download | opensim-SC-cccef2e56dc8b02ccd83fb1c832e4ce026cdcaf9.zip opensim-SC-cccef2e56dc8b02ccd83fb1c832e4ce026cdcaf9.tar.gz opensim-SC-cccef2e56dc8b02ccd83fb1c832e4ce026cdcaf9.tar.bz2 opensim-SC-cccef2e56dc8b02ccd83fb1c832e4ce026cdcaf9.tar.xz |
Calculate the Daylight Savings Time information sent to the viewer based on US Pacific Standard Time rather than whatever timezone the login server is set to.
This is because the viewer doesn't receive a timezone from the server but bases its displays on Pacific Standard Time.
However, it still expects to receive notification from the server as to whether or not Daylight Savings Time for PST is in operation.
This commit introduces a new DSTZone setting in the [LoginService] config setting that accepts a list of timezone names valid across different platforms to calculate Pacific DST.
If you need the old behaviour of calculating DST based on the local timezone of the server running the login service, then please override DSTZone with "local".
A mailing list announcement will be made later.
Thanks to Olivier Van Helden and Gudule Lapointe for determining this behaviour and providing this patch.
From http://opensimulator.org/mantis/view.php?id=5972
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginResponse.cs | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 01de159..6b3bc84 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -226,7 +226,8 @@ namespace OpenSim.Services.LLLoginService | |||
226 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, | 226 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, |
227 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, | 227 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, |
228 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, | 228 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, |
229 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency) | 229 | GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency, |
230 | string DSTZone) | ||
230 | : this() | 231 | : this() |
231 | { | 232 | { |
232 | FillOutInventoryData(invSkel, libService); | 233 | FillOutInventoryData(invSkel, libService); |
@@ -255,7 +256,45 @@ namespace OpenSim.Services.LLLoginService | |||
255 | FillOutRegionData(destination); | 256 | FillOutRegionData(destination); |
256 | 257 | ||
257 | FillOutSeedCap(aCircuit, destination, clientIP); | 258 | FillOutSeedCap(aCircuit, destination, clientIP); |
258 | 259 | ||
260 | switch (DSTZone) | ||
261 | { | ||
262 | case "none": | ||
263 | DST = "N"; | ||
264 | break; | ||
265 | case "local": | ||
266 | DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; | ||
267 | break; | ||
268 | default: | ||
269 | TimeZoneInfo dstTimeZone = null; | ||
270 | string[] tzList = DSTZone.Split(';'); | ||
271 | |||
272 | foreach (string tzName in tzList) | ||
273 | { | ||
274 | try | ||
275 | { | ||
276 | dstTimeZone = TimeZoneInfo.FindSystemTimeZoneById(tzName); | ||
277 | } | ||
278 | catch (Exception e) | ||
279 | { | ||
280 | continue; | ||
281 | } | ||
282 | break; | ||
283 | } | ||
284 | |||
285 | if (dstTimeZone == null) | ||
286 | { | ||
287 | m_log.WarnFormat( | ||
288 | "[LLOGIN RESPONSE]: No valid timezone found for DST in {0}, falling back to system time.", tzList); | ||
289 | DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; | ||
290 | } | ||
291 | else | ||
292 | { | ||
293 | DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; | ||
294 | } | ||
295 | |||
296 | break; | ||
297 | } | ||
259 | } | 298 | } |
260 | 299 | ||
261 | private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService) | 300 | private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService) |