From 1b8c71c965c82a79011290c2cfbcbc8eb1e409c4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Apr 2017 16:15:33 +0100 Subject: give more information on Fatal Error during region startup --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index f761813..62cd543 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -163,8 +163,7 @@ namespace OpenSim.Framework.Servers } catch(Exception e) { - m_log.FatalFormat("Fatal error: {0}", - (e.Message == null || e.Message == String.Empty) ? "Unknown reason":e.Message ); + m_log.Fatal("Fatal error: " + e.ToString()); Environment.Exit(1); } -- cgit v1.1 From ba4e13ef55c378db13b6aa97316e99d651762a02 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Apr 2017 20:03:44 +0100 Subject: a few changes to permissions folding... we are testing. at this point only use master for TESTING also --- OpenSim/Framework/Util.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0ec24e6..4d025a9 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -79,7 +79,9 @@ namespace OpenSim.Framework FoldedMask = 0x0f, - // + FoldingShift = 13 , // number of bit shifts from normal perm to folded or back (same as Transfer shift below) + // when doing as a block + Transfer = 1 << 13, // 0x02000 Modify = 1 << 14, // 0x04000 Copy = 1 << 15, // 0x08000 @@ -91,6 +93,7 @@ namespace OpenSim.Framework All = 0x8e000, AllAndExport = 0x9e000, AllEffective = 0x9e000 + } /// -- cgit v1.1 From 04117d9f75ca278a921be9ce09c8c859f81cd428 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 29 Apr 2017 19:07:04 +0100 Subject: recover PermissionsUtil.ApplyFoldedPermissions (well my version). its use easys code readability --- OpenSim/Framework/PermissionsUtil.cs | 32 ++++++++++++++++++++++++++++++++ OpenSim/Framework/Util.cs | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index 3dce04d..a7f933c 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs @@ -64,5 +64,37 @@ namespace OpenSim.Framework str = "."; return str; } + + public static void ApplyFoldedPermissions(uint source, ref uint target) + { + uint folded = source & (uint)PermissionMask.FoldedMask; + if(folded == 0) // invalid we need to ignore + return; + + folded <<= (int)PermissionMask.FoldingShift; + folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well + folded |= ~(uint)PermissionMask.UnfoldedMask; + + uint tmp = target; + tmp &= folded; + target = tmp; + } + + // do not touch MOD + public static void ApplyNoModFoldedPermissions(uint source, ref uint target) + { + uint folded = source & (uint)PermissionMask.FoldedMask; + if(folded == 0) // invalid we need to ignore + return; + + folded <<= (int)PermissionMask.FoldingShift; + folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well + folded |= (~(uint)PermissionMask.UnfoldedMask | (uint)PermissionMask.Modify); + + uint tmp = target; + tmp &= folded; + target = tmp; + } + } } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 4d025a9..f6ded04 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -92,8 +92,8 @@ namespace OpenSim.Framework // explicitly given All = 0x8e000, AllAndExport = 0x9e000, - AllEffective = 0x9e000 - + AllEffective = 0x9e000, + UnfoldedMask = 0x1e000 } /// -- cgit v1.1 From 522695c821c9f68d6c13533220de428f0d036dd7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 29 Apr 2017 22:09:45 +0100 Subject: update folded permitions if taking from world, or after unfold --- OpenSim/Framework/PermissionsUtil.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index a7f933c..39ccaba 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs @@ -65,9 +65,9 @@ namespace OpenSim.Framework return str; } - public static void ApplyFoldedPermissions(uint source, ref uint target) + public static void ApplyFoldedPermissions(uint foldedSourcePerms, ref uint targetPerms) { - uint folded = source & (uint)PermissionMask.FoldedMask; + uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask; if(folded == 0) // invalid we need to ignore return; @@ -75,15 +75,15 @@ namespace OpenSim.Framework folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well folded |= ~(uint)PermissionMask.UnfoldedMask; - uint tmp = target; + uint tmp = targetPerms; tmp &= folded; - target = tmp; + targetPerms = tmp; } // do not touch MOD - public static void ApplyNoModFoldedPermissions(uint source, ref uint target) + public static void ApplyNoModFoldedPermissions(uint foldedSourcePerms, ref uint target) { - uint folded = source & (uint)PermissionMask.FoldedMask; + uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask; if(folded == 0) // invalid we need to ignore return; @@ -96,5 +96,21 @@ namespace OpenSim.Framework target = tmp; } + public static uint FixAndFoldPermissions(uint perms) + { + uint tmp = perms; + + // C & T rule + if((tmp & (uint)(PermissionMask.Copy | PermissionMask.Transfer)) == 0) + tmp |= (uint)PermissionMask.Transfer; + + // unlock + tmp |= (uint)PermissionMask.Move; + + tmp &= ~(uint)PermissionMask.FoldedMask; + tmp |= ((tmp >> (int)PermissionMask.FoldingShift) & (uint)PermissionMask.FoldedMask); + + return tmp; + } } } -- cgit v1.1 From b67904a6510d4827e8219a3534b8bc07a5115ec3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 30 Apr 2017 14:31:46 +0100 Subject: remove a redundant operation --- OpenSim/Framework/PermissionsUtil.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index 39ccaba..aba8320 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs @@ -72,7 +72,6 @@ namespace OpenSim.Framework return; folded <<= (int)PermissionMask.FoldingShift; - folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well folded |= ~(uint)PermissionMask.UnfoldedMask; uint tmp = targetPerms; @@ -88,7 +87,6 @@ namespace OpenSim.Framework return; folded <<= (int)PermissionMask.FoldingShift; - folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well folded |= (~(uint)PermissionMask.UnfoldedMask | (uint)PermissionMask.Modify); uint tmp = target; -- cgit v1.1 From 0d59a29dc7c6f732da266a4ed4fddb5b39521ddf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 30 Apr 2017 14:39:20 +0100 Subject: save some nanoseconds if unfolding will not change anything ( export default mks it rare, but looks nice) --- OpenSim/Framework/PermissionsUtil.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index aba8320..cf93323 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs @@ -68,7 +68,7 @@ namespace OpenSim.Framework public static void ApplyFoldedPermissions(uint foldedSourcePerms, ref uint targetPerms) { uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask; - if(folded == 0) // invalid we need to ignore + if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do return; folded <<= (int)PermissionMask.FoldingShift; @@ -83,7 +83,7 @@ namespace OpenSim.Framework public static void ApplyNoModFoldedPermissions(uint foldedSourcePerms, ref uint target) { uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask; - if(folded == 0) // invalid we need to ignore + if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do return; folded <<= (int)PermissionMask.FoldingShift; -- cgit v1.1 From a96c0f760a3df08217794e71ec450abddf3c3ef0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 30 Apr 2017 14:42:20 +0100 Subject: having the file open then let PermissionsToString know about Export --- OpenSim/Framework/PermissionsUtil.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs index cf93323..e50d4df 100644 --- a/OpenSim/Framework/PermissionsUtil.cs +++ b/OpenSim/Framework/PermissionsUtil.cs @@ -60,6 +60,8 @@ namespace OpenSim.Framework str += "C"; if ((perms & (int)PermissionMask.Transfer) != 0) str += "T"; + if ((perms & (int)PermissionMask.Export) != 0) + str += "X"; if (str == "") str = "."; return str; -- cgit v1.1