* Applying Ahzz's profile patch. Thanks Ahzz!

* Fixed a few bugs in the patch that are sim crashers.
* There's still a bug in mySQL mode/ grid mode where the main userprofile text doesn't save.
This commit is contained in:
Teravus Ovares
2008-03-03 08:30:36 +00:00
parent c953e51c11
commit fe49c96ee0
15 changed files with 350 additions and 36 deletions

View File

@@ -181,9 +181,25 @@ namespace OpenSim.Framework
public static int UnixTimeSinceEpoch()
{
TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
int timestamp = (int) t.TotalSeconds;
return timestamp;
return ToUnixTime(DateTime.UtcNow);
}
public static int ToUnixTime(DateTime stamp)
{
TimeSpan t = (stamp.ToUniversalTime() - Convert.ToDateTime("1/1/1970 8:00:00 AM"));
return (int)t.TotalSeconds;
}
public static DateTime ToDateTime(ulong seconds)
{
DateTime epoch = Convert.ToDateTime("1/1/1970 8:00:00 AM");
return epoch.AddSeconds(seconds);
}
public static DateTime ToDateTime(int seconds)
{
DateTime epoch = Convert.ToDateTime("1/1/1970 8:00:00 AM");
return epoch.AddSeconds(seconds);
}
public static string Md5Hash(string pass)