//
// Radegast Metaverse Client
-// Copyright (c) 2009, Radegast Development Team
+// Copyright (c) 2009-2010, Radegast Development Team
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
if (RadegastFormCreated != null) RadegastFormCreated(radForm);
}
#endregion
+
private GridClient client;
private RadegastNetcom netcom;
}
}
+ /// <summary>
+ /// When was Radegast started (UTC)
+ /// </summary>
+ public readonly DateTime StartupTimeUTC;
+
+ /// <summary>
+ /// Time zone of the current world (currently hard coded to US Pacific time)
+ /// </summary>
+ public TimeZoneInfo WordTimeZone;
+
private string userDir;
/// <summary>
/// System (not grid!) user's dir
client = client0;
+ // Initialize current time zone, and mark when we started
+ GetWorldTimeZone();
+ StartupTimeUTC = DateTime.UtcNow;
+
// Are we running mono?
monoRuntime = Type.GetType("Mono.Runtime") != null;
client.Assets.Cache.AutoPruneEnabled = false;
client.Throttle.Total = 5000000f;
- client.Settings.THROTTLE_OUTGOING_PACKETS = true;
+ client.Settings.THROTTLE_OUTGOING_PACKETS = false;
client.Settings.LOGIN_TIMEOUT = 120 * 1000;
client.Settings.SIMULATOR_TIMEOUT = 120 * 1000;
client.Settings.MAX_CONCURRENT_TEXTURE_DOWNLOADS = 20;
netcom.ClientConnected -= new EventHandler<EventArgs>(netcom_ClientConnected);
}
+ private void GetWorldTimeZone()
+ {
+ try
+ {
+ foreach (TimeZoneInfo tz in TimeZoneInfo.GetSystemTimeZones())
+ {
+ if (tz.Id == "Pacific Standard Time" || tz.Id == "America/Los_Angeles")
+ {
+ WordTimeZone = tz;
+ break;
+ }
+ }
+ }
+ catch (Exception) { }
+ }
+
+ public DateTime GetWorldTime()
+ {
+ DateTime now;
+
+ try
+ {
+ if (WordTimeZone != null)
+ now = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, WordTimeZone);
+ else
+ now = DateTime.UtcNow.AddHours(-7);
+ }
+ catch (Exception)
+ {
+ now = DateTime.UtcNow.AddHours(-7);
+ }
+
+ return now;
+ }
+
+
public void Reconnect()
{
TabConsole.DisplayNotificationInChat("Attempting to reconnect...", ChatBufferTextStyle.StatusDarkBlue);
if (name == INCOMPLETE_NAME)
{
- gotName.WaitOne(10 * 1000);
+ gotName.WaitOne(10 * 1000, false);
}
client.Avatars.UUIDNameReply -= handler;