aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-03 00:04:12 +0100
committerJustin Clark-Casey (justincc)2013-09-03 00:04:12 +0100
commit4035badd20c00c766a1262afd7fa730ea6c53e98 (patch)
treec2a11f67865bff1a09de04e112b4293e81097128 /OpenSim/Framework/Util.cs
parentFix bug where users teleporting to non-neighbour regions could continue to he... (diff)
downloadopensim-SC_OLD-4035badd20c00c766a1262afd7fa730ea6c53e98.zip
opensim-SC_OLD-4035badd20c00c766a1262afd7fa730ea6c53e98.tar.gz
opensim-SC_OLD-4035badd20c00c766a1262afd7fa730ea6c53e98.tar.bz2
opensim-SC_OLD-4035badd20c00c766a1262afd7fa730ea6c53e98.tar.xz
Add experimental "show grid users online" console command to show grid users online from a standalone/robust instance.
This is not guaranteed to be accurate since users may be left "online" in certain situations. For example, if a simulator crashes and they never login/logout again. To counter this somewhat, only users continuously online for less than 5 days are shown.
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index f0e5bc1..52f5432 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Framework
130 private static SmartThreadPool m_ThreadPool; 130 private static SmartThreadPool m_ThreadPool;
131 131
132 // Unix-epoch starts at January 1st 1970, 00:00:00 UTC. And all our times in the server are (or at least should be) in UTC. 132 // Unix-epoch starts at January 1st 1970, 00:00:00 UTC. And all our times in the server are (or at least should be) in UTC.
133 private static readonly DateTime unixEpoch = 133 public static readonly DateTime UnixEpoch =
134 DateTime.ParseExact("1970-01-01 00:00:00 +0", "yyyy-MM-dd hh:mm:ss z", DateTimeFormatInfo.InvariantInfo).ToUniversalTime(); 134 DateTime.ParseExact("1970-01-01 00:00:00 +0", "yyyy-MM-dd hh:mm:ss z", DateTimeFormatInfo.InvariantInfo).ToUniversalTime();
135 135
136 private static readonly string rawUUIDPattern 136 private static readonly string rawUUIDPattern
@@ -521,19 +521,19 @@ namespace OpenSim.Framework
521 521
522 public static int ToUnixTime(DateTime stamp) 522 public static int ToUnixTime(DateTime stamp)
523 { 523 {
524 TimeSpan t = stamp.ToUniversalTime() - unixEpoch; 524 TimeSpan t = stamp.ToUniversalTime() - UnixEpoch;
525 return (int) t.TotalSeconds; 525 return (int) t.TotalSeconds;
526 } 526 }
527 527
528 public static DateTime ToDateTime(ulong seconds) 528 public static DateTime ToDateTime(ulong seconds)
529 { 529 {
530 DateTime epoch = unixEpoch; 530 DateTime epoch = UnixEpoch;
531 return epoch.AddSeconds(seconds); 531 return epoch.AddSeconds(seconds);
532 } 532 }
533 533
534 public static DateTime ToDateTime(int seconds) 534 public static DateTime ToDateTime(int seconds)
535 { 535 {
536 DateTime epoch = unixEpoch; 536 DateTime epoch = UnixEpoch;
537 return epoch.AddSeconds(seconds); 537 return epoch.AddSeconds(seconds);
538 } 538 }
539 539