aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/LLLoginService/LLLoginResponse.cs
diff options
context:
space:
mode:
authorubit2012-07-17 02:07:21 +0200
committerubit2012-07-17 02:07:21 +0200
commite925b0654d12c534ff9f837355ad43483dbd22cb (patch)
treee8a05e918e55ec8034dd724c38f143aac31493b2 /OpenSim/Services/LLLoginService/LLLoginResponse.cs
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentMerge branch 'avination' into ubitwork (diff)
downloadopensim-SC_OLD-e925b0654d12c534ff9f837355ad43483dbd22cb.zip
opensim-SC_OLD-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.gz
opensim-SC_OLD-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.bz2
opensim-SC_OLD-e925b0654d12c534ff9f837355ad43483dbd22cb.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs69
1 files changed, 66 insertions, 3 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 079bcb1..a4b3cbd 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -231,7 +231,8 @@ namespace OpenSim.Services.LLLoginService
231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, 233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency) 234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency,
235 string DSTZone)
235 : this() 236 : this()
236 { 237 {
237 FillOutInventoryData(invSkel, libService); 238 FillOutInventoryData(invSkel, libService);
@@ -260,7 +261,45 @@ namespace OpenSim.Services.LLLoginService
260 FillOutRegionData(destination); 261 FillOutRegionData(destination);
261 262
262 FillOutSeedCap(aCircuit, destination, clientIP); 263 FillOutSeedCap(aCircuit, destination, clientIP);
263 264
265 switch (DSTZone)
266 {
267 case "none":
268 DST = "N";
269 break;
270 case "local":
271 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
272 break;
273 default:
274 TimeZoneInfo dstTimeZone = null;
275 string[] tzList = DSTZone.Split(';');
276
277 foreach (string tzName in tzList)
278 {
279 try
280 {
281 dstTimeZone = TimeZoneInfo.FindSystemTimeZoneById(tzName);
282 }
283 catch
284 {
285 continue;
286 }
287 break;
288 }
289
290 if (dstTimeZone == null)
291 {
292 m_log.WarnFormat(
293 "[LLOGIN RESPONSE]: No valid timezone found for DST in {0}, falling back to system time.", tzList);
294 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
295 }
296 else
297 {
298 DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
299 }
300
301 break;
302 }
264 } 303 }
265 304
266 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService) 305 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService)
@@ -355,7 +394,31 @@ namespace OpenSim.Services.LLLoginService
355 394
356 private void SetDefaultValues() 395 private void SetDefaultValues()
357 { 396 {
358 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; 397 TimeZoneInfo gridTimeZone;
398
399 // Disabled for now pending making timezone a config value, which can at some point have a default of
400 // a ; separated list of possible timezones.
401 // The problem here is that US/Pacific (or even the Olsen America/Los_Angeles) is not universal across
402 // windows, mac and various distributions of linux, introducing another element of consistency.
403 // The server operator needs to be able to control this setting
404// try
405// {
406// // First try to fetch DST from Pacific Standard Time, because this is
407// // the one expected by the viewer. "US/Pacific" is the string to search
408// // on linux and mac, and should work also on Windows (to confirm)
409// gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific");
410// }
411// catch (Exception e)
412// {
413// m_log.WarnFormat(
414// "[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time",
415// e.Message);
416
417 gridTimeZone = TimeZoneInfo.Local;
418// }
419
420 DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
421
359 StipendSinceLogin = "N"; 422 StipendSinceLogin = "N";
360 Gendered = "Y"; 423 Gendered = "Y";
361 EverLoggedIn = "Y"; 424 EverLoggedIn = "Y";