From 4cbadc3c4984b8bebc7098a720846309f645ad7b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 2 Sep 2013 17:27:45 +0100 Subject: Allow one to specify a DefaultHGRegion flag in [GridService] in order to allow different default regions for HG and direct grid logins. This requires a new GridService.GetDefaultHypergridRegions() so ROBUST services require updating but not simulators. This method still returns regions flagged with just DefaultRegion after any DefaultHGRegions, so if no DefaultHGRegions are specified then existing configured defaults will still work. Immediate use is for conference where we need to be able to specify different defaults However, this is also generally useful to send experienced HG users to one default location and local users whose specified region fails (e.g. no "home" or "last") to another. --- OpenSim/Framework/RegionFlags.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionFlags.cs b/OpenSim/Framework/RegionFlags.cs index a3089b0..7c6569e 100644 --- a/OpenSim/Framework/RegionFlags.cs +++ b/OpenSim/Framework/RegionFlags.cs @@ -48,6 +48,7 @@ namespace OpenSim.Framework NoMove = 64, // Don't allow moving this region Reservation = 128, // This is an inactive reservation Authenticate = 256, // Require authentication - Hyperlink = 512 // Record represents a HG link + Hyperlink = 512, // Record represents a HG link + DefaultHGRegion = 1024 // Record represents a default region for hypergrid teleports only. } } \ No newline at end of file -- cgit v1.1 From 4035badd20c00c766a1262afd7fa730ea6c53e98 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Sep 2013 00:04:12 +0100 Subject: 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. --- OpenSim/Framework/Util.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') 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 private static SmartThreadPool m_ThreadPool; // 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. - private static readonly DateTime unixEpoch = + public static readonly DateTime UnixEpoch = DateTime.ParseExact("1970-01-01 00:00:00 +0", "yyyy-MM-dd hh:mm:ss z", DateTimeFormatInfo.InvariantInfo).ToUniversalTime(); private static readonly string rawUUIDPattern @@ -521,19 +521,19 @@ namespace OpenSim.Framework public static int ToUnixTime(DateTime stamp) { - TimeSpan t = stamp.ToUniversalTime() - unixEpoch; + TimeSpan t = stamp.ToUniversalTime() - UnixEpoch; return (int) t.TotalSeconds; } public static DateTime ToDateTime(ulong seconds) { - DateTime epoch = unixEpoch; + DateTime epoch = UnixEpoch; return epoch.AddSeconds(seconds); } public static DateTime ToDateTime(int seconds) { - DateTime epoch = unixEpoch; + DateTime epoch = UnixEpoch; return epoch.AddSeconds(seconds); } -- cgit v1.1 From 431156f6c48944c79e3f56c54d64e7f3bc748f7b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Sep 2013 00:17:50 +0100 Subject: minor simplification of some unix date functions in Util. No functional change. --- OpenSim/Framework/Util.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 52f5432..e8dfec1 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -522,19 +522,17 @@ namespace OpenSim.Framework public static int ToUnixTime(DateTime stamp) { TimeSpan t = stamp.ToUniversalTime() - UnixEpoch; - return (int) t.TotalSeconds; + return (int)t.TotalSeconds; } public static DateTime ToDateTime(ulong seconds) { - DateTime epoch = UnixEpoch; - return epoch.AddSeconds(seconds); + return UnixEpoch.AddSeconds(seconds); } public static DateTime ToDateTime(int seconds) { - DateTime epoch = UnixEpoch; - return epoch.AddSeconds(seconds); + return UnixEpoch.AddSeconds(seconds); } /// -- cgit v1.1