From 91312daeb2974c75ede3e53c9d7a1d9ca0300201 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 17 Sep 2012 09:04:54 -0700 Subject: Moving ScriptModuleComms into the CoreModules tree. --- .../ScriptModuleComms/ScriptModuleCommsModule.cs | 367 +++++++++++++++++++++ .../ScriptModuleComms/ScriptModuleCommsModule.cs | 367 --------------------- 2 files changed, 367 insertions(+), 367 deletions(-) create mode 100644 OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs delete mode 100644 OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs new file mode 100644 index 0000000..98396ff --- /dev/null +++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -0,0 +1,367 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using System.Collections.Generic; +using Nini.Config; +using log4net; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using Mono.Addins; +using OpenMetaverse; +using System.Linq; +using System.Linq.Expressions; + +namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ScriptModuleCommsModule")] + class ScriptModuleCommsModule : INonSharedRegionModule, IScriptModuleComms + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private Dictionary m_constants = new Dictionary(); + +#region ScriptInvocation + protected class ScriptInvocationData + { + public Delegate ScriptInvocationDelegate { get; private set; } + public string FunctionName { get; private set; } + public Type[] TypeSignature { get; private set; } + public Type ReturnType { get; private set; } + + public ScriptInvocationData(string fname, Delegate fn, Type[] callsig, Type returnsig) + { + FunctionName = fname; + ScriptInvocationDelegate = fn; + TypeSignature = callsig; + ReturnType = returnsig; + } + } + + private Dictionary m_scriptInvocation = new Dictionary(); +#endregion + + private IScriptModule m_scriptModule = null; + public event ScriptCommand OnScriptCommand; + +#region RegionModuleInterface + public void Initialise(IConfigSource config) + { + } + + public void AddRegion(Scene scene) + { + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + m_scriptModule = scene.RequestModuleInterface(); + + if (m_scriptModule != null) + m_log.Info("[MODULE COMMANDS]: Script engine found, module active"); + } + + public string Name + { + get { return "ScriptModuleCommsModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Close() + { + } +#endregion + +#region ScriptModuleComms + + public void RaiseEvent(UUID script, string id, string module, string command, string k) + { + ScriptCommand c = OnScriptCommand; + + if (c == null) + return; + + c(script, id, module, command, k); + } + + public void DispatchReply(UUID script, int code, string text, string k) + { + if (m_scriptModule == null) + return; + + Object[] args = new Object[] {-1, code, text, k}; + + m_scriptModule.PostScriptEvent(script, "link_message", args); + } + + private static MethodInfo GetMethodInfoFromType(Type target, string meth, bool searchInstanceMethods) + { + BindingFlags getMethodFlags = + BindingFlags.NonPublic | BindingFlags.Public; + + if (searchInstanceMethods) + getMethodFlags |= BindingFlags.Instance; + else + getMethodFlags |= BindingFlags.Static; + + return target.GetMethod(meth, getMethodFlags); + } + + public void RegisterScriptInvocation(object target, string meth) + { + MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true); + if (mi == null) + { + m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth); + return; + } + + RegisterScriptInvocation(target, mi); + } + + public void RegisterScriptInvocation(object target, string[] meth) + { + foreach (string m in meth) + RegisterScriptInvocation(target, m); + } + + public void RegisterScriptInvocation(object target, MethodInfo mi) + { + m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name); + + Type delegateType; + List typeArgs = mi.GetParameters() + .Select(p => p.ParameterType) + .ToList(); + + if (mi.ReturnType == typeof(void)) + { + delegateType = Expression.GetActionType(typeArgs.ToArray()); + } + else + { + typeArgs.Add(mi.ReturnType); + delegateType = Expression.GetFuncType(typeArgs.ToArray()); + } + + Delegate fcall; + if (!(target is Type)) + fcall = Delegate.CreateDelegate(delegateType, target, mi); + else + fcall = Delegate.CreateDelegate(delegateType, (Type)target, mi.Name); + + lock (m_scriptInvocation) + { + ParameterInfo[] parameters = fcall.Method.GetParameters(); + if (parameters.Length < 2) // Must have two UUID params + return; + + // Hide the first two parameters + Type[] parmTypes = new Type[parameters.Length - 2]; + for (int i = 2; i < parameters.Length; i++) + parmTypes[i - 2] = parameters[i].ParameterType; + m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); + } + } + + public void RegisterScriptInvocation(Type target, string[] methods) + { + foreach (string method in methods) + { + MethodInfo mi = GetMethodInfoFromType(target, method, false); + if (mi == null) + m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", method); + else + RegisterScriptInvocation(target, mi); + } + } + + public void RegisterScriptInvocations(IRegionModuleBase target) + { + foreach(MethodInfo method in target.GetType().GetMethods( + BindingFlags.Public | BindingFlags.Instance | + BindingFlags.Static)) + { + if(method.GetCustomAttributes( + typeof(ScriptInvocationAttribute), true).Any()) + { + if(method.IsStatic) + RegisterScriptInvocation(target.GetType(), method); + else + RegisterScriptInvocation(target, method); + } + } + } + + public Delegate[] GetScriptInvocationList() + { + List ret = new List(); + + lock (m_scriptInvocation) + { + foreach (ScriptInvocationData d in m_scriptInvocation.Values) + ret.Add(d.ScriptInvocationDelegate); + } + return ret.ToArray(); + } + + public string LookupModInvocation(string fname) + { + lock (m_scriptInvocation) + { + ScriptInvocationData sid; + if (m_scriptInvocation.TryGetValue(fname,out sid)) + { + if (sid.ReturnType == typeof(string)) + return "modInvokeS"; + else if (sid.ReturnType == typeof(int)) + return "modInvokeI"; + else if (sid.ReturnType == typeof(float)) + return "modInvokeF"; + else if (sid.ReturnType == typeof(UUID)) + return "modInvokeK"; + else if (sid.ReturnType == typeof(OpenMetaverse.Vector3)) + return "modInvokeV"; + else if (sid.ReturnType == typeof(OpenMetaverse.Quaternion)) + return "modInvokeR"; + else if (sid.ReturnType == typeof(object[])) + return "modInvokeL"; + + m_log.WarnFormat("[MODULE COMMANDS] failed to find match for {0} with return type {1}",fname,sid.ReturnType.Name); + } + } + + return null; + } + + public Delegate LookupScriptInvocation(string fname) + { + lock (m_scriptInvocation) + { + ScriptInvocationData sid; + if (m_scriptInvocation.TryGetValue(fname,out sid)) + return sid.ScriptInvocationDelegate; + } + + return null; + } + + public Type[] LookupTypeSignature(string fname) + { + lock (m_scriptInvocation) + { + ScriptInvocationData sid; + if (m_scriptInvocation.TryGetValue(fname,out sid)) + return sid.TypeSignature; + } + + return null; + } + + public Type LookupReturnType(string fname) + { + lock (m_scriptInvocation) + { + ScriptInvocationData sid; + if (m_scriptInvocation.TryGetValue(fname,out sid)) + return sid.ReturnType; + } + + return null; + } + + public object InvokeOperation(UUID hostid, UUID scriptid, string fname, params object[] parms) + { + List olist = new List(); + olist.Add(hostid); + olist.Add(scriptid); + foreach (object o in parms) + olist.Add(o); + Delegate fn = LookupScriptInvocation(fname); + return fn.DynamicInvoke(olist.ToArray()); + } + + /// + /// Operation to for a region module to register a constant to be used + /// by the script engine + /// + public void RegisterConstant(string cname, object value) + { + m_log.DebugFormat("[MODULE COMMANDS] register constant <{0}> with value {1}",cname,value.ToString()); + lock (m_constants) + { + m_constants.Add(cname,value); + } + } + + public void RegisterConstants(IRegionModuleBase target) + { + foreach (FieldInfo field in target.GetType().GetFields( + BindingFlags.Public | BindingFlags.Static | + BindingFlags.Instance)) + { + if (field.GetCustomAttributes( + typeof(ScriptConstantAttribute), true).Any()) + { + RegisterConstant(field.Name, field.GetValue(target)); + } + } + } + + /// + /// Operation to check for a registered constant + /// + public object LookupModConstant(string cname) + { + // m_log.DebugFormat("[MODULE COMMANDS] lookup constant <{0}>",cname); + + lock (m_constants) + { + object value = null; + if (m_constants.TryGetValue(cname,out value)) + return value; + } + + return null; + } + +#endregion + + } +} diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs deleted file mode 100644 index 98396ff..0000000 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Reflection; -using System.Collections.Generic; -using Nini.Config; -using log4net; -using OpenSim.Framework; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; -using Mono.Addins; -using OpenMetaverse; -using System.Linq; -using System.Linq.Expressions; - -namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms -{ - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ScriptModuleCommsModule")] - class ScriptModuleCommsModule : INonSharedRegionModule, IScriptModuleComms - { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private Dictionary m_constants = new Dictionary(); - -#region ScriptInvocation - protected class ScriptInvocationData - { - public Delegate ScriptInvocationDelegate { get; private set; } - public string FunctionName { get; private set; } - public Type[] TypeSignature { get; private set; } - public Type ReturnType { get; private set; } - - public ScriptInvocationData(string fname, Delegate fn, Type[] callsig, Type returnsig) - { - FunctionName = fname; - ScriptInvocationDelegate = fn; - TypeSignature = callsig; - ReturnType = returnsig; - } - } - - private Dictionary m_scriptInvocation = new Dictionary(); -#endregion - - private IScriptModule m_scriptModule = null; - public event ScriptCommand OnScriptCommand; - -#region RegionModuleInterface - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) - { - scene.RegisterModuleInterface(this); - } - - public void RemoveRegion(Scene scene) - { - } - - public void RegionLoaded(Scene scene) - { - m_scriptModule = scene.RequestModuleInterface(); - - if (m_scriptModule != null) - m_log.Info("[MODULE COMMANDS]: Script engine found, module active"); - } - - public string Name - { - get { return "ScriptModuleCommsModule"; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void Close() - { - } -#endregion - -#region ScriptModuleComms - - public void RaiseEvent(UUID script, string id, string module, string command, string k) - { - ScriptCommand c = OnScriptCommand; - - if (c == null) - return; - - c(script, id, module, command, k); - } - - public void DispatchReply(UUID script, int code, string text, string k) - { - if (m_scriptModule == null) - return; - - Object[] args = new Object[] {-1, code, text, k}; - - m_scriptModule.PostScriptEvent(script, "link_message", args); - } - - private static MethodInfo GetMethodInfoFromType(Type target, string meth, bool searchInstanceMethods) - { - BindingFlags getMethodFlags = - BindingFlags.NonPublic | BindingFlags.Public; - - if (searchInstanceMethods) - getMethodFlags |= BindingFlags.Instance; - else - getMethodFlags |= BindingFlags.Static; - - return target.GetMethod(meth, getMethodFlags); - } - - public void RegisterScriptInvocation(object target, string meth) - { - MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true); - if (mi == null) - { - m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth); - return; - } - - RegisterScriptInvocation(target, mi); - } - - public void RegisterScriptInvocation(object target, string[] meth) - { - foreach (string m in meth) - RegisterScriptInvocation(target, m); - } - - public void RegisterScriptInvocation(object target, MethodInfo mi) - { - m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name); - - Type delegateType; - List typeArgs = mi.GetParameters() - .Select(p => p.ParameterType) - .ToList(); - - if (mi.ReturnType == typeof(void)) - { - delegateType = Expression.GetActionType(typeArgs.ToArray()); - } - else - { - typeArgs.Add(mi.ReturnType); - delegateType = Expression.GetFuncType(typeArgs.ToArray()); - } - - Delegate fcall; - if (!(target is Type)) - fcall = Delegate.CreateDelegate(delegateType, target, mi); - else - fcall = Delegate.CreateDelegate(delegateType, (Type)target, mi.Name); - - lock (m_scriptInvocation) - { - ParameterInfo[] parameters = fcall.Method.GetParameters(); - if (parameters.Length < 2) // Must have two UUID params - return; - - // Hide the first two parameters - Type[] parmTypes = new Type[parameters.Length - 2]; - for (int i = 2; i < parameters.Length; i++) - parmTypes[i - 2] = parameters[i].ParameterType; - m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); - } - } - - public void RegisterScriptInvocation(Type target, string[] methods) - { - foreach (string method in methods) - { - MethodInfo mi = GetMethodInfoFromType(target, method, false); - if (mi == null) - m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", method); - else - RegisterScriptInvocation(target, mi); - } - } - - public void RegisterScriptInvocations(IRegionModuleBase target) - { - foreach(MethodInfo method in target.GetType().GetMethods( - BindingFlags.Public | BindingFlags.Instance | - BindingFlags.Static)) - { - if(method.GetCustomAttributes( - typeof(ScriptInvocationAttribute), true).Any()) - { - if(method.IsStatic) - RegisterScriptInvocation(target.GetType(), method); - else - RegisterScriptInvocation(target, method); - } - } - } - - public Delegate[] GetScriptInvocationList() - { - List ret = new List(); - - lock (m_scriptInvocation) - { - foreach (ScriptInvocationData d in m_scriptInvocation.Values) - ret.Add(d.ScriptInvocationDelegate); - } - return ret.ToArray(); - } - - public string LookupModInvocation(string fname) - { - lock (m_scriptInvocation) - { - ScriptInvocationData sid; - if (m_scriptInvocation.TryGetValue(fname,out sid)) - { - if (sid.ReturnType == typeof(string)) - return "modInvokeS"; - else if (sid.ReturnType == typeof(int)) - return "modInvokeI"; - else if (sid.ReturnType == typeof(float)) - return "modInvokeF"; - else if (sid.ReturnType == typeof(UUID)) - return "modInvokeK"; - else if (sid.ReturnType == typeof(OpenMetaverse.Vector3)) - return "modInvokeV"; - else if (sid.ReturnType == typeof(OpenMetaverse.Quaternion)) - return "modInvokeR"; - else if (sid.ReturnType == typeof(object[])) - return "modInvokeL"; - - m_log.WarnFormat("[MODULE COMMANDS] failed to find match for {0} with return type {1}",fname,sid.ReturnType.Name); - } - } - - return null; - } - - public Delegate LookupScriptInvocation(string fname) - { - lock (m_scriptInvocation) - { - ScriptInvocationData sid; - if (m_scriptInvocation.TryGetValue(fname,out sid)) - return sid.ScriptInvocationDelegate; - } - - return null; - } - - public Type[] LookupTypeSignature(string fname) - { - lock (m_scriptInvocation) - { - ScriptInvocationData sid; - if (m_scriptInvocation.TryGetValue(fname,out sid)) - return sid.TypeSignature; - } - - return null; - } - - public Type LookupReturnType(string fname) - { - lock (m_scriptInvocation) - { - ScriptInvocationData sid; - if (m_scriptInvocation.TryGetValue(fname,out sid)) - return sid.ReturnType; - } - - return null; - } - - public object InvokeOperation(UUID hostid, UUID scriptid, string fname, params object[] parms) - { - List olist = new List(); - olist.Add(hostid); - olist.Add(scriptid); - foreach (object o in parms) - olist.Add(o); - Delegate fn = LookupScriptInvocation(fname); - return fn.DynamicInvoke(olist.ToArray()); - } - - /// - /// Operation to for a region module to register a constant to be used - /// by the script engine - /// - public void RegisterConstant(string cname, object value) - { - m_log.DebugFormat("[MODULE COMMANDS] register constant <{0}> with value {1}",cname,value.ToString()); - lock (m_constants) - { - m_constants.Add(cname,value); - } - } - - public void RegisterConstants(IRegionModuleBase target) - { - foreach (FieldInfo field in target.GetType().GetFields( - BindingFlags.Public | BindingFlags.Static | - BindingFlags.Instance)) - { - if (field.GetCustomAttributes( - typeof(ScriptConstantAttribute), true).Any()) - { - RegisterConstant(field.Name, field.GetValue(target)); - } - } - } - - /// - /// Operation to check for a registered constant - /// - public object LookupModConstant(string cname) - { - // m_log.DebugFormat("[MODULE COMMANDS] lookup constant <{0}>",cname); - - lock (m_constants) - { - object value = null; - if (m_constants.TryGetValue(cname,out value)) - return value; - } - - return null; - } - -#endregion - - } -} -- cgit v1.1 From d29fc5305222abcc081daa7aa4b0b017d04bbae1 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 18 Sep 2012 09:47:15 -0400 Subject: Fix some inconsistencies in configurartion: NonPhys prims Fix inconsistencies between configuration parameter names and their description names. Changing the configuration parameters for non physical prim size min-max from Nonphys* to NonPhys*. Please update your OpenSim.ini and Regions.ini to reflect these changes. --- OpenSim/Framework/RegionInfo.cs | 8 ++++---- OpenSim/Region/Framework/Scenes/Scene.cs | 6 +++--- bin/OpenSim.ini.example | 8 ++++---- bin/OpenSimDefaults.ini | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 928e798..016f2a6 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -643,11 +643,11 @@ namespace OpenSim.Framework #region Prim stuff - m_nonphysPrimMin = config.GetFloat("NonphysicalPrimMin", 0); - allKeys.Remove("NonphysicalPrimMin"); + m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0); + allKeys.Remove("NonPhysicalPrimMin"); - m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0); - allKeys.Remove("NonphysicalPrimMax"); + m_nonphysPrimMax = config.GetInt("NonPhysicalPrimMax", 0); + allKeys.Remove("NonPhysicalPrimMax"); m_physPrimMin = config.GetFloat("PhysicalPrimMin", 0); allKeys.Remove("PhysicalPrimMin"); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9c3c53d..a27e126 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Minimum value of the size of a physical prim in each axis /// - public float m_minPhys = 0.01f; + public float m_minPhys = 0.001f; /// /// Maximum value of the size of a physical prim in each axis @@ -744,13 +744,13 @@ namespace OpenSim.Region.Framework.Scenes PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims); CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims); - m_minNonphys = startupConfig.GetFloat("NonphysicalPrimMin", m_minNonphys); + m_minNonphys = startupConfig.GetFloat("NonPhysicalPrimMin", m_minNonphys); if (RegionInfo.NonphysPrimMin > 0) { m_minNonphys = RegionInfo.NonphysPrimMin; } - m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); + m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); if (RegionInfo.NonphysPrimMax > 0) { m_maxNonphys = RegionInfo.NonphysPrimMax; diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 0de4002..cd90517 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -88,12 +88,12 @@ ; allow_regionless = false ;# {NonPhysicalPrimMin} {} {Minimum size of nonphysical prims?} {} 0.01 - ;; Minimum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMin!). - ; NonphysicalPrimMin = 0.01 + ;; Minimum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMin!). + ; NonPhysicalPrimMin = 0.01 ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 - ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). - ; NonphysicalPrimMax = 256 + ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!). + ; NonPhysicalPrimMax = 256 ;# {PhysicalPrimMin} {} {Minimum size of physical prims?} {} 10 ;; Maximum size where a prim can be physical. Affects resizing of existing prims. This can be overriden in the region config file. diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 0173f5b..ef4f578 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -85,8 +85,8 @@ ;; from the selected region_info_source. allow_regionless = false - ; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonphysicalPrimMax!). - NonphysicalPrimMax = 256 + ; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!). + NonPhysicalPrimMax = 256 ; Maximum size of physical prims. Affects resizing of existing prims. This can be overriden in the region config file. PhysicalPrimMax = 10 -- cgit v1.1 From 9d973ec3b377f51eab4cbd8ef7528d91477fc1d7 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 18 Sep 2012 10:09:32 -0400 Subject: Cleanup from prev. commit Make correct defaults to Phys/nonPhys prims to fix errors in prev. commit --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- bin/OpenSim.ini.example | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a27e126..c873cdf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Minimum value of the size of a non-physical prim in each axis /// - public float m_minNonphys = 0.01f; + public float m_minNonphys = 0.001f; /// /// Maximum value of the size of a non-physical prim in each axis @@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Minimum value of the size of a physical prim in each axis /// - public float m_minPhys = 0.001f; + public float m_minPhys = 0.01f; /// /// Maximum value of the size of a physical prim in each axis diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index cd90517..3ec4bab 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -87,9 +87,9 @@ ;; from the selected region_info_source. ; allow_regionless = false - ;# {NonPhysicalPrimMin} {} {Minimum size of nonphysical prims?} {} 0.01 + ;# {NonPhysicalPrimMin} {} {Minimum size of nonphysical prims?} {} 0.001 ;; Minimum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMin!). - ; NonPhysicalPrimMin = 0.01 + ; NonPhysicalPrimMin = 0.001 ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 ;; Maximum size for non-physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!). -- cgit v1.1 From 95809cabd947dcbbc69526fec2ad05a10458ddd3 Mon Sep 17 00:00:00 2001 From: justincc Date: Tue, 18 Sep 2012 23:45:06 +0100 Subject: Update libopenmetaverse components to commit f5cecaa Among other things this allows pCampbot to work under Windows since libopenmateverse now ships the same log4net.dll (publicly signed) as OpenSimulator This also updates the libopenmetaverse embedded libopenjpeg from 1.3 to 1.5. DLL naming and mapping for non-Windows libopenjpeg changes to remove version number to make future udpates easier and bring it into line with names of other shipped DLLs. libopenjpeg updates have been made for OSX, Windows (32 and 64 bit) and Linux (32 and 64 bit). Please report any issues. --- bin/OpenMetaverse.Rendering.Meshmerizer.dll | Bin 24576 -> 24576 bytes bin/OpenMetaverse.StructuredData.dll | Bin 114688 -> 102400 bytes bin/OpenMetaverse.dll | Bin 1904640 -> 1765376 bytes bin/OpenMetaverse.dll.config | 8 +++----- bin/OpenMetaverseTypes.dll | Bin 122880 -> 114688 bytes .../libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so | Bin 124540 -> 0 bytes bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1.so | Bin 128100 -> 0 bytes bin/lib32/libopenjpeg-dotnet.so | Bin 0 -> 139088 bytes .../libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64.so | Bin 142616 -> 0 bytes .../libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib | Bin 125136 -> 0 bytes bin/lib64/libopenjpeg-dotnet-x86_64.so | Bin 0 -> 149392 bytes bin/lib64/libopenjpeg-dotnet.dylib | Bin 0 -> 147288 bytes bin/openjpeg-dotnet-x86_64.dll | Bin 843776 -> 215040 bytes bin/openjpeg-dotnet.dll | Bin 187392 -> 201216 bytes bin/pCampBot.exe.config | 0 15 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so delete mode 100644 bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1.so create mode 100755 bin/lib32/libopenjpeg-dotnet.so delete mode 100644 bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64.so delete mode 100644 bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib create mode 100755 bin/lib64/libopenjpeg-dotnet-x86_64.so create mode 100755 bin/lib64/libopenjpeg-dotnet.dylib mode change 100644 => 100755 bin/pCampBot.exe.config diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 1b4cab5..30b9c7b 100755 Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index 7b5174d..5c0b3c6 100755 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index a08b406..511096e 100755 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverse.dll.config b/bin/OpenMetaverse.dll.config index e8c90a4..b67da5f 100644 --- a/bin/OpenMetaverse.dll.config +++ b/bin/OpenMetaverse.dll.config @@ -1,7 +1,5 @@ - - - - - + + + diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index fc4f8eb..8bc8885 100755 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ diff --git a/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so b/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so deleted file mode 100644 index 0106b56..0000000 Binary files a/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so and /dev/null differ diff --git a/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1.so b/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1.so deleted file mode 100644 index 53543e7..0000000 Binary files a/bin/lib32/libopenjpeg-dotnet-2.1.3.0-dotnet-1.so and /dev/null differ diff --git a/bin/lib32/libopenjpeg-dotnet.so b/bin/lib32/libopenjpeg-dotnet.so new file mode 100755 index 0000000..5914368 Binary files /dev/null and b/bin/lib32/libopenjpeg-dotnet.so differ diff --git a/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64.so b/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64.so deleted file mode 100644 index be11bb4..0000000 Binary files a/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64.so and /dev/null differ diff --git a/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib b/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib deleted file mode 100644 index dc50775..0000000 Binary files a/bin/lib64/libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib and /dev/null differ diff --git a/bin/lib64/libopenjpeg-dotnet-x86_64.so b/bin/lib64/libopenjpeg-dotnet-x86_64.so new file mode 100755 index 0000000..421dc56 Binary files /dev/null and b/bin/lib64/libopenjpeg-dotnet-x86_64.so differ diff --git a/bin/lib64/libopenjpeg-dotnet.dylib b/bin/lib64/libopenjpeg-dotnet.dylib new file mode 100755 index 0000000..18ca868 Binary files /dev/null and b/bin/lib64/libopenjpeg-dotnet.dylib differ diff --git a/bin/openjpeg-dotnet-x86_64.dll b/bin/openjpeg-dotnet-x86_64.dll index 97729ff..9e8cd21 100755 Binary files a/bin/openjpeg-dotnet-x86_64.dll and b/bin/openjpeg-dotnet-x86_64.dll differ diff --git a/bin/openjpeg-dotnet.dll b/bin/openjpeg-dotnet.dll index 64b2557..6377b8d 100755 Binary files a/bin/openjpeg-dotnet.dll and b/bin/openjpeg-dotnet.dll differ diff --git a/bin/pCampBot.exe.config b/bin/pCampBot.exe.config old mode 100644 new mode 100755 -- cgit v1.1 From f99278c95658f0e8ce7f1bba1ca815e85231b281 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Sep 2012 23:57:00 +0100 Subject: Add openmetaverse_data from libopenmetaverse to allow testing of texture baking via bot rather than just throwing out errors --- bin/openmetaverse_data/avatar_lad.xml | 12308 +++++++++++++++++++ bin/openmetaverse_data/blush_alpha.tga | Bin 0 -> 17352 bytes bin/openmetaverse_data/body_skingrain.tga | Bin 0 -> 262188 bytes bin/openmetaverse_data/bodyfreckles_alpha.tga | Bin 0 -> 257249 bytes bin/openmetaverse_data/bump_face_wrinkles.tga | Bin 0 -> 25243 bytes bin/openmetaverse_data/bump_head_base.tga | Bin 0 -> 105525 bytes bin/openmetaverse_data/bump_lowerbody_base.tga | Bin 0 -> 112782 bytes bin/openmetaverse_data/bump_pants_wrinkles.tga | Bin 0 -> 83183 bytes bin/openmetaverse_data/bump_shirt_wrinkles.tga | Bin 0 -> 81501 bytes bin/openmetaverse_data/bump_upperbody_base.tga | Bin 0 -> 147581 bytes bin/openmetaverse_data/eyebrows_alpha.tga | Bin 0 -> 9469 bytes bin/openmetaverse_data/eyeliner_alpha.tga | Bin 0 -> 4720 bytes bin/openmetaverse_data/eyeshadow_inner_alpha.tga | Bin 0 -> 5466 bytes bin/openmetaverse_data/eyeshadow_outer_alpha.tga | Bin 0 -> 7382 bytes bin/openmetaverse_data/eyewhite.tga | Bin 0 -> 42353 bytes .../facehair_chincurtains_alpha.tga | Bin 0 -> 34610 bytes .../facehair_moustache_alpha.tga | Bin 0 -> 14017 bytes .../facehair_sideburns_alpha.tga | Bin 0 -> 27328 bytes .../facehair_soulpatch_alpha.tga | Bin 0 -> 11277 bytes bin/openmetaverse_data/freckles_alpha.tga | Bin 0 -> 140558 bytes bin/openmetaverse_data/glove_length_alpha.tga | Bin 0 -> 49745 bytes bin/openmetaverse_data/gloves_fingers_alpha.tga | Bin 0 -> 39616 bytes bin/openmetaverse_data/head_alpha.tga | Bin 0 -> 6066 bytes bin/openmetaverse_data/head_color.tga | Bin 0 -> 70715 bytes bin/openmetaverse_data/head_hair.tga | Bin 0 -> 75600 bytes bin/openmetaverse_data/head_highlights_alpha.tga | Bin 0 -> 20503 bytes bin/openmetaverse_data/head_shading_alpha.tga | Bin 0 -> 35304 bytes bin/openmetaverse_data/head_skingrain.tga | Bin 0 -> 262376 bytes .../jacket_length_lower_alpha.tga | Bin 0 -> 9768 bytes .../jacket_length_upper_alpha.tga | Bin 0 -> 14617 bytes bin/openmetaverse_data/jacket_open_lower_alpha.tga | Bin 0 -> 19732 bytes bin/openmetaverse_data/jacket_open_upper_alpha.tga | Bin 0 -> 41606 bytes bin/openmetaverse_data/lipgloss_alpha.tga | Bin 0 -> 4738 bytes bin/openmetaverse_data/lips_mask.tga | Bin 0 -> 6110 bytes bin/openmetaverse_data/lipstick_alpha.tga | Bin 0 -> 7966 bytes bin/openmetaverse_data/lowerbody_color.tga | Bin 0 -> 135395 bytes .../lowerbody_highlights_alpha.tga | Bin 0 -> 8695 bytes bin/openmetaverse_data/lowerbody_shading_alpha.tga | Bin 0 -> 41766 bytes bin/openmetaverse_data/nailpolish_alpha.tga | Bin 0 -> 4656 bytes bin/openmetaverse_data/pants_length_alpha.tga | Bin 0 -> 26843 bytes bin/openmetaverse_data/pants_waist_alpha.tga | Bin 0 -> 10487 bytes bin/openmetaverse_data/rosyface_alpha.tga | Bin 0 -> 44382 bytes bin/openmetaverse_data/rouge_alpha.tga | Bin 0 -> 44382 bytes bin/openmetaverse_data/shirt_bottom_alpha.tga | Bin 0 -> 32242 bytes bin/openmetaverse_data/shirt_collar_alpha.tga | Bin 0 -> 14417 bytes bin/openmetaverse_data/shirt_collar_back_alpha.tga | Bin 0 -> 12789 bytes bin/openmetaverse_data/shirt_sleeve_alpha.tga | Bin 0 -> 72196 bytes bin/openmetaverse_data/shoe_height_alpha.tga | Bin 0 -> 24461 bytes bin/openmetaverse_data/skirt_length_alpha.tga | Bin 0 -> 4114 bytes bin/openmetaverse_data/skirt_slit_back_alpha.tga | Bin 0 -> 90350 bytes bin/openmetaverse_data/skirt_slit_front_alpha.tga | Bin 0 -> 90350 bytes bin/openmetaverse_data/skirt_slit_left_alpha.tga | Bin 0 -> 82006 bytes bin/openmetaverse_data/skirt_slit_right_alpha.tga | Bin 0 -> 91410 bytes bin/openmetaverse_data/underpants_trial_female.tga | Bin 0 -> 48063 bytes bin/openmetaverse_data/underpants_trial_male.tga | Bin 0 -> 144983 bytes bin/openmetaverse_data/undershirt_trial_female.tga | Bin 0 -> 81390 bytes bin/openmetaverse_data/upperbody_color.tga | Bin 0 -> 23348 bytes .../upperbody_highlights_alpha.tga | Bin 0 -> 6509 bytes bin/openmetaverse_data/upperbody_shading_alpha.tga | Bin 0 -> 25297 bytes bin/openmetaverse_data/upperbodyfreckles_alpha.tga | Bin 0 -> 180104 bytes 60 files changed, 12308 insertions(+) create mode 100644 bin/openmetaverse_data/avatar_lad.xml create mode 100644 bin/openmetaverse_data/blush_alpha.tga create mode 100644 bin/openmetaverse_data/body_skingrain.tga create mode 100644 bin/openmetaverse_data/bodyfreckles_alpha.tga create mode 100644 bin/openmetaverse_data/bump_face_wrinkles.tga create mode 100644 bin/openmetaverse_data/bump_head_base.tga create mode 100644 bin/openmetaverse_data/bump_lowerbody_base.tga create mode 100644 bin/openmetaverse_data/bump_pants_wrinkles.tga create mode 100644 bin/openmetaverse_data/bump_shirt_wrinkles.tga create mode 100644 bin/openmetaverse_data/bump_upperbody_base.tga create mode 100644 bin/openmetaverse_data/eyebrows_alpha.tga create mode 100644 bin/openmetaverse_data/eyeliner_alpha.tga create mode 100644 bin/openmetaverse_data/eyeshadow_inner_alpha.tga create mode 100644 bin/openmetaverse_data/eyeshadow_outer_alpha.tga create mode 100644 bin/openmetaverse_data/eyewhite.tga create mode 100644 bin/openmetaverse_data/facehair_chincurtains_alpha.tga create mode 100644 bin/openmetaverse_data/facehair_moustache_alpha.tga create mode 100644 bin/openmetaverse_data/facehair_sideburns_alpha.tga create mode 100644 bin/openmetaverse_data/facehair_soulpatch_alpha.tga create mode 100644 bin/openmetaverse_data/freckles_alpha.tga create mode 100644 bin/openmetaverse_data/glove_length_alpha.tga create mode 100644 bin/openmetaverse_data/gloves_fingers_alpha.tga create mode 100644 bin/openmetaverse_data/head_alpha.tga create mode 100644 bin/openmetaverse_data/head_color.tga create mode 100644 bin/openmetaverse_data/head_hair.tga create mode 100644 bin/openmetaverse_data/head_highlights_alpha.tga create mode 100644 bin/openmetaverse_data/head_shading_alpha.tga create mode 100644 bin/openmetaverse_data/head_skingrain.tga create mode 100644 bin/openmetaverse_data/jacket_length_lower_alpha.tga create mode 100644 bin/openmetaverse_data/jacket_length_upper_alpha.tga create mode 100644 bin/openmetaverse_data/jacket_open_lower_alpha.tga create mode 100644 bin/openmetaverse_data/jacket_open_upper_alpha.tga create mode 100644 bin/openmetaverse_data/lipgloss_alpha.tga create mode 100644 bin/openmetaverse_data/lips_mask.tga create mode 100644 bin/openmetaverse_data/lipstick_alpha.tga create mode 100644 bin/openmetaverse_data/lowerbody_color.tga create mode 100644 bin/openmetaverse_data/lowerbody_highlights_alpha.tga create mode 100644 bin/openmetaverse_data/lowerbody_shading_alpha.tga create mode 100644 bin/openmetaverse_data/nailpolish_alpha.tga create mode 100644 bin/openmetaverse_data/pants_length_alpha.tga create mode 100644 bin/openmetaverse_data/pants_waist_alpha.tga create mode 100644 bin/openmetaverse_data/rosyface_alpha.tga create mode 100644 bin/openmetaverse_data/rouge_alpha.tga create mode 100644 bin/openmetaverse_data/shirt_bottom_alpha.tga create mode 100644 bin/openmetaverse_data/shirt_collar_alpha.tga create mode 100644 bin/openmetaverse_data/shirt_collar_back_alpha.tga create mode 100644 bin/openmetaverse_data/shirt_sleeve_alpha.tga create mode 100644 bin/openmetaverse_data/shoe_height_alpha.tga create mode 100644 bin/openmetaverse_data/skirt_length_alpha.tga create mode 100644 bin/openmetaverse_data/skirt_slit_back_alpha.tga create mode 100644 bin/openmetaverse_data/skirt_slit_front_alpha.tga create mode 100644 bin/openmetaverse_data/skirt_slit_left_alpha.tga create mode 100644 bin/openmetaverse_data/skirt_slit_right_alpha.tga create mode 100644 bin/openmetaverse_data/underpants_trial_female.tga create mode 100644 bin/openmetaverse_data/underpants_trial_male.tga create mode 100644 bin/openmetaverse_data/undershirt_trial_female.tga create mode 100644 bin/openmetaverse_data/upperbody_color.tga create mode 100644 bin/openmetaverse_data/upperbody_highlights_alpha.tga create mode 100644 bin/openmetaverse_data/upperbody_shading_alpha.tga create mode 100644 bin/openmetaverse_data/upperbodyfreckles_alpha.tga diff --git a/bin/openmetaverse_data/avatar_lad.xml b/bin/openmetaverse_data/avatar_lad.xml new file mode 100644 index 0000000..3bd7ba7 --- /dev/null +++ b/bin/openmetaverse_data/avatar_lad.xml @@ -0,0 +1,12308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/openmetaverse_data/blush_alpha.tga b/bin/openmetaverse_data/blush_alpha.tga new file mode 100644 index 0000000..05be7e7 Binary files /dev/null and b/bin/openmetaverse_data/blush_alpha.tga differ diff --git a/bin/openmetaverse_data/body_skingrain.tga b/bin/openmetaverse_data/body_skingrain.tga new file mode 100644 index 0000000..7264baa Binary files /dev/null and b/bin/openmetaverse_data/body_skingrain.tga differ diff --git a/bin/openmetaverse_data/bodyfreckles_alpha.tga b/bin/openmetaverse_data/bodyfreckles_alpha.tga new file mode 100644 index 0000000..d30ab3d Binary files /dev/null and b/bin/openmetaverse_data/bodyfreckles_alpha.tga differ diff --git a/bin/openmetaverse_data/bump_face_wrinkles.tga b/bin/openmetaverse_data/bump_face_wrinkles.tga new file mode 100644 index 0000000..54bf7a5 Binary files /dev/null and b/bin/openmetaverse_data/bump_face_wrinkles.tga differ diff --git a/bin/openmetaverse_data/bump_head_base.tga b/bin/openmetaverse_data/bump_head_base.tga new file mode 100644 index 0000000..fa35685 Binary files /dev/null and b/bin/openmetaverse_data/bump_head_base.tga differ diff --git a/bin/openmetaverse_data/bump_lowerbody_base.tga b/bin/openmetaverse_data/bump_lowerbody_base.tga new file mode 100644 index 0000000..498ea3c Binary files /dev/null and b/bin/openmetaverse_data/bump_lowerbody_base.tga differ diff --git a/bin/openmetaverse_data/bump_pants_wrinkles.tga b/bin/openmetaverse_data/bump_pants_wrinkles.tga new file mode 100644 index 0000000..cca7241 Binary files /dev/null and b/bin/openmetaverse_data/bump_pants_wrinkles.tga differ diff --git a/bin/openmetaverse_data/bump_shirt_wrinkles.tga b/bin/openmetaverse_data/bump_shirt_wrinkles.tga new file mode 100644 index 0000000..9e0d757 Binary files /dev/null and b/bin/openmetaverse_data/bump_shirt_wrinkles.tga differ diff --git a/bin/openmetaverse_data/bump_upperbody_base.tga b/bin/openmetaverse_data/bump_upperbody_base.tga new file mode 100644 index 0000000..e57d635 Binary files /dev/null and b/bin/openmetaverse_data/bump_upperbody_base.tga differ diff --git a/bin/openmetaverse_data/eyebrows_alpha.tga b/bin/openmetaverse_data/eyebrows_alpha.tga new file mode 100644 index 0000000..c363e48 Binary files /dev/null and b/bin/openmetaverse_data/eyebrows_alpha.tga differ diff --git a/bin/openmetaverse_data/eyeliner_alpha.tga b/bin/openmetaverse_data/eyeliner_alpha.tga new file mode 100644 index 0000000..1611eb3 Binary files /dev/null and b/bin/openmetaverse_data/eyeliner_alpha.tga differ diff --git a/bin/openmetaverse_data/eyeshadow_inner_alpha.tga b/bin/openmetaverse_data/eyeshadow_inner_alpha.tga new file mode 100644 index 0000000..37d7919 Binary files /dev/null and b/bin/openmetaverse_data/eyeshadow_inner_alpha.tga differ diff --git a/bin/openmetaverse_data/eyeshadow_outer_alpha.tga b/bin/openmetaverse_data/eyeshadow_outer_alpha.tga new file mode 100644 index 0000000..00eef9d Binary files /dev/null and b/bin/openmetaverse_data/eyeshadow_outer_alpha.tga differ diff --git a/bin/openmetaverse_data/eyewhite.tga b/bin/openmetaverse_data/eyewhite.tga new file mode 100644 index 0000000..a720496 Binary files /dev/null and b/bin/openmetaverse_data/eyewhite.tga differ diff --git a/bin/openmetaverse_data/facehair_chincurtains_alpha.tga b/bin/openmetaverse_data/facehair_chincurtains_alpha.tga new file mode 100644 index 0000000..b103970 Binary files /dev/null and b/bin/openmetaverse_data/facehair_chincurtains_alpha.tga differ diff --git a/bin/openmetaverse_data/facehair_moustache_alpha.tga b/bin/openmetaverse_data/facehair_moustache_alpha.tga new file mode 100644 index 0000000..4068c4f Binary files /dev/null and b/bin/openmetaverse_data/facehair_moustache_alpha.tga differ diff --git a/bin/openmetaverse_data/facehair_sideburns_alpha.tga b/bin/openmetaverse_data/facehair_sideburns_alpha.tga new file mode 100644 index 0000000..acddc2d Binary files /dev/null and b/bin/openmetaverse_data/facehair_sideburns_alpha.tga differ diff --git a/bin/openmetaverse_data/facehair_soulpatch_alpha.tga b/bin/openmetaverse_data/facehair_soulpatch_alpha.tga new file mode 100644 index 0000000..687091a Binary files /dev/null and b/bin/openmetaverse_data/facehair_soulpatch_alpha.tga differ diff --git a/bin/openmetaverse_data/freckles_alpha.tga b/bin/openmetaverse_data/freckles_alpha.tga new file mode 100644 index 0000000..a9a4ec0 Binary files /dev/null and b/bin/openmetaverse_data/freckles_alpha.tga differ diff --git a/bin/openmetaverse_data/glove_length_alpha.tga b/bin/openmetaverse_data/glove_length_alpha.tga new file mode 100644 index 0000000..db89ad5 Binary files /dev/null and b/bin/openmetaverse_data/glove_length_alpha.tga differ diff --git a/bin/openmetaverse_data/gloves_fingers_alpha.tga b/bin/openmetaverse_data/gloves_fingers_alpha.tga new file mode 100644 index 0000000..dba2eec Binary files /dev/null and b/bin/openmetaverse_data/gloves_fingers_alpha.tga differ diff --git a/bin/openmetaverse_data/head_alpha.tga b/bin/openmetaverse_data/head_alpha.tga new file mode 100644 index 0000000..8164525 Binary files /dev/null and b/bin/openmetaverse_data/head_alpha.tga differ diff --git a/bin/openmetaverse_data/head_color.tga b/bin/openmetaverse_data/head_color.tga new file mode 100644 index 0000000..74b1b30 Binary files /dev/null and b/bin/openmetaverse_data/head_color.tga differ diff --git a/bin/openmetaverse_data/head_hair.tga b/bin/openmetaverse_data/head_hair.tga new file mode 100644 index 0000000..5321f35 Binary files /dev/null and b/bin/openmetaverse_data/head_hair.tga differ diff --git a/bin/openmetaverse_data/head_highlights_alpha.tga b/bin/openmetaverse_data/head_highlights_alpha.tga new file mode 100644 index 0000000..8dc5239 Binary files /dev/null and b/bin/openmetaverse_data/head_highlights_alpha.tga differ diff --git a/bin/openmetaverse_data/head_shading_alpha.tga b/bin/openmetaverse_data/head_shading_alpha.tga new file mode 100644 index 0000000..e8ea490 Binary files /dev/null and b/bin/openmetaverse_data/head_shading_alpha.tga differ diff --git a/bin/openmetaverse_data/head_skingrain.tga b/bin/openmetaverse_data/head_skingrain.tga new file mode 100644 index 0000000..b42dee0 Binary files /dev/null and b/bin/openmetaverse_data/head_skingrain.tga differ diff --git a/bin/openmetaverse_data/jacket_length_lower_alpha.tga b/bin/openmetaverse_data/jacket_length_lower_alpha.tga new file mode 100644 index 0000000..722bc19 Binary files /dev/null and b/bin/openmetaverse_data/jacket_length_lower_alpha.tga differ diff --git a/bin/openmetaverse_data/jacket_length_upper_alpha.tga b/bin/openmetaverse_data/jacket_length_upper_alpha.tga new file mode 100644 index 0000000..e9db7e7 Binary files /dev/null and b/bin/openmetaverse_data/jacket_length_upper_alpha.tga differ diff --git a/bin/openmetaverse_data/jacket_open_lower_alpha.tga b/bin/openmetaverse_data/jacket_open_lower_alpha.tga new file mode 100644 index 0000000..db0c2fb Binary files /dev/null and b/bin/openmetaverse_data/jacket_open_lower_alpha.tga differ diff --git a/bin/openmetaverse_data/jacket_open_upper_alpha.tga b/bin/openmetaverse_data/jacket_open_upper_alpha.tga new file mode 100644 index 0000000..71b8a0b Binary files /dev/null and b/bin/openmetaverse_data/jacket_open_upper_alpha.tga differ diff --git a/bin/openmetaverse_data/lipgloss_alpha.tga b/bin/openmetaverse_data/lipgloss_alpha.tga new file mode 100644 index 0000000..78ceeca Binary files /dev/null and b/bin/openmetaverse_data/lipgloss_alpha.tga differ diff --git a/bin/openmetaverse_data/lips_mask.tga b/bin/openmetaverse_data/lips_mask.tga new file mode 100644 index 0000000..ae1401c Binary files /dev/null and b/bin/openmetaverse_data/lips_mask.tga differ diff --git a/bin/openmetaverse_data/lipstick_alpha.tga b/bin/openmetaverse_data/lipstick_alpha.tga new file mode 100644 index 0000000..2795f1b Binary files /dev/null and b/bin/openmetaverse_data/lipstick_alpha.tga differ diff --git a/bin/openmetaverse_data/lowerbody_color.tga b/bin/openmetaverse_data/lowerbody_color.tga new file mode 100644 index 0000000..a63aa12 Binary files /dev/null and b/bin/openmetaverse_data/lowerbody_color.tga differ diff --git a/bin/openmetaverse_data/lowerbody_highlights_alpha.tga b/bin/openmetaverse_data/lowerbody_highlights_alpha.tga new file mode 100644 index 0000000..ae3413a Binary files /dev/null and b/bin/openmetaverse_data/lowerbody_highlights_alpha.tga differ diff --git a/bin/openmetaverse_data/lowerbody_shading_alpha.tga b/bin/openmetaverse_data/lowerbody_shading_alpha.tga new file mode 100644 index 0000000..0242663 Binary files /dev/null and b/bin/openmetaverse_data/lowerbody_shading_alpha.tga differ diff --git a/bin/openmetaverse_data/nailpolish_alpha.tga b/bin/openmetaverse_data/nailpolish_alpha.tga new file mode 100644 index 0000000..91af762 Binary files /dev/null and b/bin/openmetaverse_data/nailpolish_alpha.tga differ diff --git a/bin/openmetaverse_data/pants_length_alpha.tga b/bin/openmetaverse_data/pants_length_alpha.tga new file mode 100644 index 0000000..3c4f21c Binary files /dev/null and b/bin/openmetaverse_data/pants_length_alpha.tga differ diff --git a/bin/openmetaverse_data/pants_waist_alpha.tga b/bin/openmetaverse_data/pants_waist_alpha.tga new file mode 100644 index 0000000..35658c0 Binary files /dev/null and b/bin/openmetaverse_data/pants_waist_alpha.tga differ diff --git a/bin/openmetaverse_data/rosyface_alpha.tga b/bin/openmetaverse_data/rosyface_alpha.tga new file mode 100644 index 0000000..a0c8513 Binary files /dev/null and b/bin/openmetaverse_data/rosyface_alpha.tga differ diff --git a/bin/openmetaverse_data/rouge_alpha.tga b/bin/openmetaverse_data/rouge_alpha.tga new file mode 100644 index 0000000..a0c8513 Binary files /dev/null and b/bin/openmetaverse_data/rouge_alpha.tga differ diff --git a/bin/openmetaverse_data/shirt_bottom_alpha.tga b/bin/openmetaverse_data/shirt_bottom_alpha.tga new file mode 100644 index 0000000..7cce03d Binary files /dev/null and b/bin/openmetaverse_data/shirt_bottom_alpha.tga differ diff --git a/bin/openmetaverse_data/shirt_collar_alpha.tga b/bin/openmetaverse_data/shirt_collar_alpha.tga new file mode 100644 index 0000000..f55f635 Binary files /dev/null and b/bin/openmetaverse_data/shirt_collar_alpha.tga differ diff --git a/bin/openmetaverse_data/shirt_collar_back_alpha.tga b/bin/openmetaverse_data/shirt_collar_back_alpha.tga new file mode 100644 index 0000000..43a6453 Binary files /dev/null and b/bin/openmetaverse_data/shirt_collar_back_alpha.tga differ diff --git a/bin/openmetaverse_data/shirt_sleeve_alpha.tga b/bin/openmetaverse_data/shirt_sleeve_alpha.tga new file mode 100644 index 0000000..e3b18f4 Binary files /dev/null and b/bin/openmetaverse_data/shirt_sleeve_alpha.tga differ diff --git a/bin/openmetaverse_data/shoe_height_alpha.tga b/bin/openmetaverse_data/shoe_height_alpha.tga new file mode 100644 index 0000000..d08dd75 Binary files /dev/null and b/bin/openmetaverse_data/shoe_height_alpha.tga differ diff --git a/bin/openmetaverse_data/skirt_length_alpha.tga b/bin/openmetaverse_data/skirt_length_alpha.tga new file mode 100644 index 0000000..c867994 Binary files /dev/null and b/bin/openmetaverse_data/skirt_length_alpha.tga differ diff --git a/bin/openmetaverse_data/skirt_slit_back_alpha.tga b/bin/openmetaverse_data/skirt_slit_back_alpha.tga new file mode 100644 index 0000000..0e49688 Binary files /dev/null and b/bin/openmetaverse_data/skirt_slit_back_alpha.tga differ diff --git a/bin/openmetaverse_data/skirt_slit_front_alpha.tga b/bin/openmetaverse_data/skirt_slit_front_alpha.tga new file mode 100644 index 0000000..888bbf7 Binary files /dev/null and b/bin/openmetaverse_data/skirt_slit_front_alpha.tga differ diff --git a/bin/openmetaverse_data/skirt_slit_left_alpha.tga b/bin/openmetaverse_data/skirt_slit_left_alpha.tga new file mode 100644 index 0000000..210feac Binary files /dev/null and b/bin/openmetaverse_data/skirt_slit_left_alpha.tga differ diff --git a/bin/openmetaverse_data/skirt_slit_right_alpha.tga b/bin/openmetaverse_data/skirt_slit_right_alpha.tga new file mode 100644 index 0000000..ce11c64 Binary files /dev/null and b/bin/openmetaverse_data/skirt_slit_right_alpha.tga differ diff --git a/bin/openmetaverse_data/underpants_trial_female.tga b/bin/openmetaverse_data/underpants_trial_female.tga new file mode 100644 index 0000000..96bf732 Binary files /dev/null and b/bin/openmetaverse_data/underpants_trial_female.tga differ diff --git a/bin/openmetaverse_data/underpants_trial_male.tga b/bin/openmetaverse_data/underpants_trial_male.tga new file mode 100644 index 0000000..095695c Binary files /dev/null and b/bin/openmetaverse_data/underpants_trial_male.tga differ diff --git a/bin/openmetaverse_data/undershirt_trial_female.tga b/bin/openmetaverse_data/undershirt_trial_female.tga new file mode 100644 index 0000000..e17a309 Binary files /dev/null and b/bin/openmetaverse_data/undershirt_trial_female.tga differ diff --git a/bin/openmetaverse_data/upperbody_color.tga b/bin/openmetaverse_data/upperbody_color.tga new file mode 100644 index 0000000..85fcc41 Binary files /dev/null and b/bin/openmetaverse_data/upperbody_color.tga differ diff --git a/bin/openmetaverse_data/upperbody_highlights_alpha.tga b/bin/openmetaverse_data/upperbody_highlights_alpha.tga new file mode 100644 index 0000000..2d8102b Binary files /dev/null and b/bin/openmetaverse_data/upperbody_highlights_alpha.tga differ diff --git a/bin/openmetaverse_data/upperbody_shading_alpha.tga b/bin/openmetaverse_data/upperbody_shading_alpha.tga new file mode 100644 index 0000000..b420506 Binary files /dev/null and b/bin/openmetaverse_data/upperbody_shading_alpha.tga differ diff --git a/bin/openmetaverse_data/upperbodyfreckles_alpha.tga b/bin/openmetaverse_data/upperbodyfreckles_alpha.tga new file mode 100644 index 0000000..76c7ce8 Binary files /dev/null and b/bin/openmetaverse_data/upperbodyfreckles_alpha.tga differ -- cgit v1.1 From e50155ebca0538ddcbd579ef13feb6581e4220b8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Sep 2012 00:35:06 +0100 Subject: Downgrade libopenjpeg back to 1.3 from 1.5. This is because libopenjpeg 1.5 appears to require a minimum of glibc 2.14, whereas at least one fairly recent distro (openSUSE 11.4 from 2011-03-10) only has glibc Further investigation pending. --- bin/lib32/libopenjpeg-dotnet.so | Bin 139088 -> 124540 bytes bin/lib64/libopenjpeg-dotnet-x86_64.so | Bin 149392 -> 142616 bytes bin/lib64/libopenjpeg-dotnet.dylib | Bin 147288 -> 125136 bytes bin/openjpeg-dotnet-x86_64.dll | Bin 215040 -> 843776 bytes bin/openjpeg-dotnet.dll | Bin 201216 -> 187392 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/libopenjpeg-dotnet.so b/bin/lib32/libopenjpeg-dotnet.so index 5914368..0106b56 100755 Binary files a/bin/lib32/libopenjpeg-dotnet.so and b/bin/lib32/libopenjpeg-dotnet.so differ diff --git a/bin/lib64/libopenjpeg-dotnet-x86_64.so b/bin/lib64/libopenjpeg-dotnet-x86_64.so index 421dc56..be11bb4 100755 Binary files a/bin/lib64/libopenjpeg-dotnet-x86_64.so and b/bin/lib64/libopenjpeg-dotnet-x86_64.so differ diff --git a/bin/lib64/libopenjpeg-dotnet.dylib b/bin/lib64/libopenjpeg-dotnet.dylib index 18ca868..dc50775 100755 Binary files a/bin/lib64/libopenjpeg-dotnet.dylib and b/bin/lib64/libopenjpeg-dotnet.dylib differ diff --git a/bin/openjpeg-dotnet-x86_64.dll b/bin/openjpeg-dotnet-x86_64.dll index 9e8cd21..97729ff 100755 Binary files a/bin/openjpeg-dotnet-x86_64.dll and b/bin/openjpeg-dotnet-x86_64.dll differ diff --git a/bin/openjpeg-dotnet.dll b/bin/openjpeg-dotnet.dll index 6377b8d..64b2557 100755 Binary files a/bin/openjpeg-dotnet.dll and b/bin/openjpeg-dotnet.dll differ -- cgit v1.1 From 967d42d393a48841dd0f6e4e1173f77cfaa3c5e6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 19 Sep 2012 01:06:42 +0100 Subject: Correctly override and call base OpenSimTestCase.SetUp() method in GridConnectorsTests and ArchiverTests. Remove unrelated compile warning from AttachmentsModuleTests. --- .../Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 4 ++-- .../ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | 8 +++++--- OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 82c6390..51e10f5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests public class AttachmentsModuleTests : OpenSimTestCase { private AutoResetEvent m_chatEvent = new AutoResetEvent(false); - private OSChatMessage m_osChatMessageReceived; +// private OSChatMessage m_osChatMessageReceived; [TestFixtureSetUp] public void FixtureInit() @@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests { // Console.WriteLine("Got chat [{0}]", oscm.Message); - m_osChatMessageReceived = oscm; +// m_osChatMessageReceived = oscm; m_chatEvent.Set(); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 57ae549..4338133 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs @@ -46,8 +46,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests public class GridConnectorsTests : OpenSimTestCase { LocalGridServicesConnector m_LocalConnector; - private void SetUp() + + [SetUp] + public override void SetUp() { + base.SetUp(); + IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("GridService"); @@ -71,8 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - SetUp(); - // Create 4 regions GridRegion r1 = new GridRegion(); r1.RegionName = "Test Region 1"; diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 0a30905..82f49b0 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -65,8 +65,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected TaskInventoryItem m_soundItem; [SetUp] - public void SetUp() + public override void SetUp() { + base.SetUp(); + + // FIXME: Do something about this - relying on statics in unit tests causes trouble sooner or later new SceneManager(); m_archiverModule = new ArchiverModule(); -- cgit v1.1 From e50b6b5334270436ece8c2c5bdfe792395d044bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Sep 2012 01:26:35 +0100 Subject: Update libopenjpeg libraries used by libopenmetaverse back up to 1.5, this time using lkalif's linux libraries built against a much earlier libc (2.7) --- bin/lib32/libopenjpeg-dotnet.so | Bin 124540 -> 140028 bytes bin/lib64/libopenjpeg-dotnet-x86_64.so | Bin 142616 -> 149368 bytes bin/lib64/libopenjpeg-dotnet.dylib | Bin 125136 -> 147288 bytes bin/openjpeg-dotnet-x86_64.dll | Bin 843776 -> 215040 bytes bin/openjpeg-dotnet.dll | Bin 187392 -> 201216 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/libopenjpeg-dotnet.so b/bin/lib32/libopenjpeg-dotnet.so index 0106b56..193eca4 100755 Binary files a/bin/lib32/libopenjpeg-dotnet.so and b/bin/lib32/libopenjpeg-dotnet.so differ diff --git a/bin/lib64/libopenjpeg-dotnet-x86_64.so b/bin/lib64/libopenjpeg-dotnet-x86_64.so index be11bb4..7a9bdfc 100755 Binary files a/bin/lib64/libopenjpeg-dotnet-x86_64.so and b/bin/lib64/libopenjpeg-dotnet-x86_64.so differ diff --git a/bin/lib64/libopenjpeg-dotnet.dylib b/bin/lib64/libopenjpeg-dotnet.dylib index dc50775..18ca868 100755 Binary files a/bin/lib64/libopenjpeg-dotnet.dylib and b/bin/lib64/libopenjpeg-dotnet.dylib differ diff --git a/bin/openjpeg-dotnet-x86_64.dll b/bin/openjpeg-dotnet-x86_64.dll index 97729ff..9e8cd21 100755 Binary files a/bin/openjpeg-dotnet-x86_64.dll and b/bin/openjpeg-dotnet-x86_64.dll differ diff --git a/bin/openjpeg-dotnet.dll b/bin/openjpeg-dotnet.dll index 64b2557..6377b8d 100755 Binary files a/bin/openjpeg-dotnet.dll and b/bin/openjpeg-dotnet.dll differ -- cgit v1.1 From f2a9d26118f87903564990ff220d642801767c25 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Sep 2012 01:40:05 +0100 Subject: Make ResendAppearanceUpdates = true by default in [Appearance] in OpenSimDefaults.ini. This resends appearance uuids to avatars in the scene once a minute. I have seen this help in the past resolve grey appearance problems where viewers have for unknown reasons sometimes ignored the packet. The overhead is very small since only the UUIDs are sent - the viewer then requests the texture only if it does not have it cached. This setting will not help with cloudy avatars which are usually due to the viewer not uploading baked texture data or uploading something that isn't valid JPEG2000 --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++ bin/OpenSimDefaults.ini | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c873cdf..e9d1d42 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -861,6 +861,8 @@ namespace OpenSim.Region.Framework.Scenes } // FIXME: Ultimately this should be in a module. + SendPeriodicAppearanceUpdates = true; + IConfig appearanceConfig = m_config.Configs["Appearance"]; if (appearanceConfig != null) { diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index ef4f578..315ffbe 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -673,8 +673,7 @@ ; If true, avatar appearance information is resent to other avatars in the simulator every 60 seconds. ; This may help with some situations where avatars are persistently grey, though it will not help ; in other situations (e.g. appearance baking failures where the avatar only appears as a cloud to others). - ; This setting is experimental. - ResendAppearanceUpdates = false + ResendAppearanceUpdates = true [Attachments] -- cgit v1.1 From a74167bb0684eb6977aef08247144dc0e4aa6b3f Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 19 Sep 2012 12:47:23 +0100 Subject: Documentation of OnPluginConsole --- OpenSim/Region/Framework/Scenes/EventManager.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e1c9c8e..1025943 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -184,6 +184,22 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnPluginConsoleDelegate(string[] args); + /// + /// Triggered after + /// has been called for all + /// loaded via . + /// Handlers for this event are typically used to parse the arguments + /// from in order to process or + /// filter the arguments and pass them onto + /// + /// + /// Triggered by in + /// via + /// via + /// via + /// via + /// + /// public event OnPluginConsoleDelegate OnPluginConsole; /// -- cgit v1.1 From 61f4523e01b11ac116ab0c1a86075126039f481b Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 19 Sep 2012 15:00:02 +0100 Subject: Documentation of object-related events --- OpenSim/Region/Framework/Scenes/EventManager.cs | 39 ++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 1025943..7024bd6 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -238,12 +238,34 @@ namespace OpenSim.Region.Framework.Scenes /// /// Fired when an object is touched/grabbed. /// + /// /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of /// the root part. + /// Triggerd in response to + /// via + /// in + /// public event ObjectGrabDelegate OnObjectGrab; public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); + /// + /// Triggered when an object is being touched/grabbed continuously. + /// + /// + /// Triggered in response to + /// via + /// in + /// public event ObjectGrabDelegate OnObjectGrabbing; + + /// + /// Triggered when an object stops being touched/grabbed. + /// + /// + /// Triggered in response to + /// via + /// in + /// public event ObjectDeGrabDelegate OnObjectDeGrab; public event ScriptResetDelegate OnScriptReset; @@ -453,12 +475,27 @@ namespace OpenSim.Region.Framework.Scenes /// /// Triggered when an object is added to the scene. /// + /// + /// Triggered by + /// in , + /// , + /// + /// public event Action OnObjectAddedToScene; /// - /// Triggered when an object is removed from the scene. + /// Delegate for /// + /// The object being removed from the scene public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); + + /// + /// Triggered when an object is removed from the scene. + /// + /// + /// Triggered by + /// in + /// public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; public delegate void NoticeNoLandDataFromStorage(); -- cgit v1.1 From 49e2872f9ee3c5c11145a43ec91bac2dab324f42 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 19 Sep 2012 20:26:57 +0100 Subject: Documentation of agent-related events --- OpenSim/Region/Framework/Scenes/EventManager.cs | 35 ++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 7024bd6..48a85a2 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -214,6 +214,18 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnSetRootAgentSceneDelegate(UUID agentID, Scene scene); + /// + /// Triggered before the grunt work for adding a root agent to a + /// scene has been performed (resuming attachment scripts, physics, + /// animations etc.) + /// + /// + /// Triggered before + /// by + /// in + /// via + /// and + /// public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; /// @@ -429,15 +441,36 @@ namespace OpenSim.Region.Framework.Scenes public event ScriptColliding OnScriptLandColliderEnd; public delegate void OnMakeChildAgentDelegate(ScenePresence presence); + + /// + /// Triggered when an agent has been made a child agent of a scene. + /// + /// + /// Triggered by + /// in + /// via , + /// , + /// + /// public event OnMakeChildAgentDelegate OnMakeChildAgent; public delegate void OnSaveNewWindlightProfileDelegate(); public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); /// + /// Triggered after the grunt work for adding a root agent to a + /// scene has been performed (resuming attachment scripts, physics, + /// animations etc.) + /// + /// /// This event is on the critical path for transferring an avatar from one region to another. Try and do /// as little work on this event as possible, or do work asynchronously. - /// + /// Triggered after + /// by + /// in + /// via + /// and + /// public event Action OnMakeRootAgent; public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; -- cgit v1.1 From 696b3f66c482aa6ee56b0a0d7cd3686a43e59503 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Wed, 19 Sep 2012 20:27:52 +0100 Subject: minor tweaks to existing comments for IDE goodness --- OpenSim/Region/Framework/Scenes/EventManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 48a85a2..e415e09 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -496,9 +496,10 @@ namespace OpenSim.Region.Framework.Scenes public event AvatarKillData OnAvatarKilled; public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); -// public delegate void ScriptTimerEvent(uint localID, double timerinterval); - -// public event ScriptTimerEvent OnScriptTimerEvent; + /* + public delegate void ScriptTimerEvent(uint localID, double timerinterval); + public event ScriptTimerEvent OnScriptTimerEvent; + */ public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); @@ -724,7 +725,9 @@ namespace OpenSim.Region.Framework.Scenes public UUID sender; public UUID receiver; - // Always false. The SL protocol sucks. + /// + /// Always false. The SL protocol sucks. + /// public bool authenticated = false; public int amount; -- cgit v1.1 From d667f9d260808a27e91acf11244dded87517ec58 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sat, 15 Sep 2012 17:32:10 +0100 Subject: Documentation of teleport-related events --- OpenSim/Region/Framework/Scenes/EventManager.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e415e09..f079e00 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -715,9 +715,28 @@ namespace OpenSim.Region.Framework.Scenes public event PrimsLoaded OnPrimsLoaded; public delegate void TeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout); + + /// + /// Triggered when a teleport starts + /// + /// + /// Triggered by + /// in + /// and + /// via + /// public event TeleportStart OnTeleportStart; public delegate void TeleportFail(IClientAPI client, bool gridLogout); + + /// + /// Trigered when a teleport fails. + /// + /// + /// Triggered by + /// in + /// via + /// public event TeleportFail OnTeleportFail; public class MoneyTransferArgs : EventArgs -- cgit v1.1 From b481a782341b721b14f30108b411a580e5f8651e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Sep 2012 02:01:01 +0100 Subject: Don't fail to create an IRC nick if nick randomization is disabled in the IRC module. Patch from http://opensimulator.org/mantis/view.php?id=6293 Thanks Starflower. --- OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index ca956fb..a014798 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs @@ -231,12 +231,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat if (m_server == null || m_baseNick == null || m_ircChannel == null || m_user == null) throw new Exception("Invalid connector configuration"); - // Generate an initial nickname if randomizing is enabled + // Generate an initial nickname if (m_randomizeNick) - { m_nick = m_baseNick + Util.RandomClass.Next(1, 99); - } + else + m_nick = m_baseNick; m_log.InfoFormat("[IRC-Connector-{0}]: Initialization complete", idn); -- cgit v1.1 From 387a1bb283c0c55178421f2c28b0d28a24dac7a1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Sep 2012 22:36:47 +0100 Subject: Add ability to turn on/off logging of outgoing HTTP requests flowing through WebUtil. This is for debugging purposes. This is controlled via the "debug http" command which can already log incoming requests. This now gains a mandatory parameter of in, out or all to control what is logged. Log messages are also shortened and labelled and HTTP IN or HTTP OUT to be consistent with existing UDP PACKET IN and PACKET OUT messages. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 10 +-- OpenSim/Framework/Servers/MainServer.cs | 87 ++++++++++++++++------ OpenSim/Framework/WebUtil.cs | 41 ++++++++-- 3 files changed, 103 insertions(+), 35 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 43a19fa..f93b3dd 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -529,7 +529,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); buffer = HandleHTTPRequest(request, response); @@ -541,7 +541,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); buffer = HandleLLSDRequests(request, response); @@ -649,7 +649,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler) { m_log.DebugFormat( - "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}", + "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3}", request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); if (DebugLevel >= 4) @@ -659,7 +659,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToContentTypeHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); if (DebugLevel >= 4) @@ -669,7 +669,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToXmlRpcHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}", + "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1}", request.HttpMethod, request.Url.PathAndQuery); if (DebugLevel >= 4) diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 7402c73..b7a133e 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -48,9 +48,11 @@ namespace OpenSim.Framework.Servers /// Control the printing of certain debug messages. /// /// - /// If DebugLevel >= 1, then short warnings are logged when receiving bad input data. - /// If DebugLevel >= 2, then long warnings are logged when receiving bad input data. - /// If DebugLevel >= 3, then short notices about all incoming non-poll HTTP requests are logged. + /// If DebugLevel >= 1 then short warnings are logged when receiving bad input data. + /// If DebugLevel >= 2 then long warnings are logged when receiving bad input data. + /// If DebugLevel >= 3 then short notices about all incoming non-poll HTTP requests are logged. + /// If DebugLevel >= 4 then the start of the body of incoming non-poll HTTP requests will be logged. + /// If DebugLevel >= 5 then the entire body of incoming non-poll HTTP requests will be logged. /// public static int DebugLevel { @@ -102,7 +104,6 @@ namespace OpenSim.Framework.Servers get { return new Dictionary(m_Servers); } } - public static void RegisterHttpConsoleCommands(ICommandConsole console) { console.Commands.AddCommand( @@ -111,15 +112,18 @@ namespace OpenSim.Framework.Servers "Show all registered http handlers", HandleShowHttpHandlersCommand); console.Commands.AddCommand( - "Debug", false, "debug http", "debug http []", - "Turn on inbound non-poll http request debugging.", - "If level <= 0, then no extra logging is done.\n" - + "If level >= 1, then short warnings are logged when receiving bad input data.\n" - + "If level >= 2, then long warnings are logged when receiving bad input data.\n" - + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" - + "If level >= 4, then a sample from the beginning of the incoming data is logged.\n" - + "If level >= 5, then the entire incoming data is logged.\n" - + "If no level is specified then the current level is returned.", + "Debug", false, "debug http", "debug http []", + "Turn on http request logging.", + "If in or all and\n" + + " level <= 0, then no extra logging is done.\n" + + " level >= 1, then short warnings are logged when receiving bad input data.\n" + + " level >= 2, then long warnings are logged when receiving bad input data.\n" + + " level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" + + " level >= 4, then a sample from the beginning of the incoming data is logged.\n" + + " level >= 5, then the entire incoming data is logged.\n" + + " no level is specified then the current level is returned.\n\n" + + "If out or all and\n" + + " level >= 3. then short notices about all outgoing requests going through WebUtil are logged.\n", HandleDebugHttpCommand); } @@ -127,24 +131,63 @@ namespace OpenSim.Framework.Servers /// Turn on some debugging values for OpenSim. /// /// - private static void HandleDebugHttpCommand(string module, string[] args) + private static void HandleDebugHttpCommand(string module, string[] cmdparams) { - if (args.Length == 3) + if (cmdparams.Length < 3) { + MainConsole.Instance.Output("Usage: debug http 0..5"); + return; + } + + bool inReqs = false; + bool outReqs = false; + bool allReqs = false; + + string subCommand = cmdparams[2]; + + if (subCommand == "in") + inReqs = true; + else if (subCommand == "out") + outReqs = true; + else + allReqs = true; + + if (cmdparams.Length >= 4) + { + string rawNewDebug = cmdparams[3]; int newDebug; - if (int.TryParse(args[2], out newDebug)) + + if (!int.TryParse(rawNewDebug, out newDebug)) + { + MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawNewDebug); + return; + } + + if (newDebug < 0 || newDebug > 5) + { + MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0..5", newDebug); + return; + } + + if (allReqs || inReqs) { MainServer.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); + MainConsole.Instance.OutputFormat("In debug level set to {0}", newDebug); + } + + if (allReqs || outReqs) + { + WebUtil.DebugLevel = newDebug; + MainConsole.Instance.OutputFormat("Out debug level set to {0}", newDebug); } - } - else if (args.Length == 2) - { - MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel); } else { - MainConsole.Instance.Output("Usage: debug http 0..5"); + if (allReqs || inReqs) + MainConsole.Instance.OutputFormat("Current in debug level is {0}", MainServer.DebugLevel); + + if (allReqs || outReqs) + MainConsole.Instance.OutputFormat("Current out debug level is {0}", WebUtil.DebugLevel); } } diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 2aa4af5..7c4e852 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -54,6 +54,14 @@ namespace OpenSim.Framework MethodBase.GetCurrentMethod().DeclaringType); /// + /// Control the printing of certain debug messages. + /// + /// + /// If DebugLevel >= 3 then short notices about outgoing HTTP requests are logged. + /// + public static int DebugLevel { get; set; } + + /// /// Request number for diagnostic purposes. /// public static int RequestNumber = 0; @@ -146,7 +154,11 @@ namespace OpenSim.Framework private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) { int reqnum = RequestNumber++; - // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); + + if (DebugLevel >= 3) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} ServiceOSD {1} {2} (timeout {3}, compressed {4})", + reqnum, method, url, timeout, compressed); string errorMessage = "unknown error"; int tickstart = Util.EnvironmentTickCount(); @@ -317,7 +329,11 @@ namespace OpenSim.Framework { int reqnum = RequestNumber++; string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown"; - // m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method); + + if (DebugLevel >= 3) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} ServiceForm {1} {2} (timeout {3})", + reqnum, method, url, timeout); string errorMessage = "unknown error"; int tickstart = Util.EnvironmentTickCount(); @@ -643,7 +659,6 @@ namespace OpenSim.Framework /// public static string[] GetPreferredImageTypes(string accept) { - if (accept == null || accept == string.Empty) return new string[0]; @@ -695,13 +710,15 @@ namespace OpenSim.Framework string requestUrl, TRequest obj, Action action) { int reqnum = WebUtil.RequestNumber++; - // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); + + if (WebUtil.DebugLevel >= 3) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} AsynchronousRequestObject {1} {2}", + reqnum, verb, requestUrl); int tickstart = Util.EnvironmentTickCount(); int tickdata = 0; - // m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl); - Type type = typeof(TRequest); WebRequest request = WebRequest.Create(requestUrl); @@ -882,7 +899,11 @@ namespace OpenSim.Framework public static string MakeRequest(string verb, string requestUrl, string obj) { int reqnum = WebUtil.RequestNumber++; - // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); + + if (WebUtil.DebugLevel >= 3) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} SynchronousRestForms {1} {2}", + reqnum, verb, requestUrl); int tickstart = Util.EnvironmentTickCount(); int tickdata = 0; @@ -998,7 +1019,11 @@ namespace OpenSim.Framework public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj) { int reqnum = WebUtil.RequestNumber++; - // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); + + if (WebUtil.DebugLevel >= 3) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} SynchronousRestObject {1} {2}", + reqnum, verb, requestUrl); int tickstart = Util.EnvironmentTickCount(); int tickdata = 0; -- cgit v1.1 From a5b3989e5db0a3b22e44b84412227a8e487bcef2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Sep 2012 23:18:19 +0100 Subject: Insert a new log level 4 for HTTP IN and HTTP OUT that will log how long the request took. This is only printed if debug http level >= 4 and the request didn't take more than the time considered 'long', in which case the existing log message is printed. This displaces the previous log levels 4 and 5 which are now 5 and 6 respectively. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 47 ++++++++++++++------- OpenSim/Framework/Servers/MainServer.cs | 48 ++++++++++++++-------- OpenSim/Framework/WebUtil.cs | 24 +++++++++++ 3 files changed, 87 insertions(+), 32 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index f93b3dd..4e04dd8 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -54,6 +54,12 @@ namespace OpenSim.Framework.Servers.HttpServer private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); + /// + /// Gets or sets the debug level. + /// + /// + /// See MainServer.DebugLevel. + /// public int DebugLevel { get; set; } private volatile int NotSocketErrors = 0; @@ -529,8 +535,8 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", + request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); buffer = HandleHTTPRequest(request, response); break; @@ -541,8 +547,8 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", + request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); buffer = HandleLLSDRequests(request, response); break; @@ -640,7 +646,18 @@ namespace OpenSim.Framework.Servers.HttpServer uriString, requestHandler != null ? requestHandler.Name : "", requestHandler != null ? requestHandler.Description : "", - request.RemoteIPEndPoint.ToString(), + request.RemoteIPEndPoint, + tickdiff); + } + else if (DebugLevel >= 4) + { + m_log.DebugFormat( + "[BASE HTTP SERVER]: HTTP IN {0} {1} {2} {3} from {4} took {5}ms", + requestMethod, + uriString, + requestHandler != null ? requestHandler.Name : "", + requestHandler != null ? requestHandler.Description : "", + request.RemoteIPEndPoint, tickdiff); } } @@ -649,30 +666,30 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3}", - request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); + "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3} from {4}", + request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description, request.RemoteIPEndPoint); - if (DebugLevel >= 4) + if (DebugLevel >= 5) LogIncomingInDetail(request); } private void LogIncomingToContentTypeHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery); + "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", + request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); - if (DebugLevel >= 4) + if (DebugLevel >= 5) LogIncomingInDetail(request); } private void LogIncomingToXmlRpcHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1}", - request.HttpMethod, request.Url.PathAndQuery); + "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1} from {2}", + request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); - if (DebugLevel >= 4) + if (DebugLevel >= 5) LogIncomingInDetail(request); } @@ -682,7 +699,7 @@ namespace OpenSim.Framework.Servers.HttpServer { string output; - if (DebugLevel == 4) + if (DebugLevel == 5) { const int sampleLength = 80; char[] sampleChars = new char[sampleLength]; diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index b7a133e..72f9cce 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -51,8 +51,9 @@ namespace OpenSim.Framework.Servers /// If DebugLevel >= 1 then short warnings are logged when receiving bad input data. /// If DebugLevel >= 2 then long warnings are logged when receiving bad input data. /// If DebugLevel >= 3 then short notices about all incoming non-poll HTTP requests are logged. - /// If DebugLevel >= 4 then the start of the body of incoming non-poll HTTP requests will be logged. - /// If DebugLevel >= 5 then the entire body of incoming non-poll HTTP requests will be logged. + /// If DebugLevel >= 4 then the time taken to fulfill the request is logged. + /// If DebugLevel >= 5 then the start of the body of incoming non-poll HTTP requests will be logged. + /// If DebugLevel >= 6 then the entire body of incoming non-poll HTTP requests will be logged. /// public static int DebugLevel { @@ -115,15 +116,17 @@ namespace OpenSim.Framework.Servers "Debug", false, "debug http", "debug http []", "Turn on http request logging.", "If in or all and\n" - + " level <= 0, then no extra logging is done.\n" - + " level >= 1, then short warnings are logged when receiving bad input data.\n" - + " level >= 2, then long warnings are logged when receiving bad input data.\n" - + " level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" - + " level >= 4, then a sample from the beginning of the incoming data is logged.\n" - + " level >= 5, then the entire incoming data is logged.\n" + + " level <= 0 then no extra logging is done.\n" + + " level >= 1 then short warnings are logged when receiving bad input data.\n" + + " level >= 2 then long warnings are logged when receiving bad input data.\n" + + " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n" + + " level >= 4 then the time taken to fulfill the request is logged.\n" + + " level >= 5 then a sample from the beginning of the incoming data is logged.\n" + + " level >= 6 then the entire incoming data is logged.\n" + " no level is specified then the current level is returned.\n\n" + "If out or all and\n" - + " level >= 3. then short notices about all outgoing requests going through WebUtil are logged.\n", + + " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n" + + " level >= 4 then the time taken to fulfill the request is logged.\n", HandleDebugHttpCommand); } @@ -135,7 +138,7 @@ namespace OpenSim.Framework.Servers { if (cmdparams.Length < 3) { - MainConsole.Instance.Output("Usage: debug http 0..5"); + MainConsole.Instance.Output("Usage: debug http 0..6"); return; } @@ -145,12 +148,23 @@ namespace OpenSim.Framework.Servers string subCommand = cmdparams[2]; - if (subCommand == "in") + if (subCommand.ToLower() == "in") + { inReqs = true; - else if (subCommand == "out") + } + else if (subCommand.ToLower() == "out") + { outReqs = true; - else + } + else if (subCommand.ToLower() == "all") + { allReqs = true; + } + else + { + MainConsole.Instance.Output("You must specify in, out or all"); + return; + } if (cmdparams.Length >= 4) { @@ -172,22 +186,22 @@ namespace OpenSim.Framework.Servers if (allReqs || inReqs) { MainServer.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("In debug level set to {0}", newDebug); + MainConsole.Instance.OutputFormat("IN debug level set to {0}", newDebug); } if (allReqs || outReqs) { WebUtil.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("Out debug level set to {0}", newDebug); + MainConsole.Instance.OutputFormat("OUT debug level set to {0}", newDebug); } } else { if (allReqs || inReqs) - MainConsole.Instance.OutputFormat("Current in debug level is {0}", MainServer.DebugLevel); + MainConsole.Instance.OutputFormat("Current IN debug level is {0}", MainServer.DebugLevel); if (allReqs || outReqs) - MainConsole.Instance.OutputFormat("Current out debug level is {0}", WebUtil.DebugLevel); + MainConsole.Instance.OutputFormat("Current OUT debug level is {0}", WebUtil.DebugLevel); } } diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 7c4e852..64d61f1 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -250,6 +250,10 @@ namespace OpenSim.Framework strBuffer != null ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) : ""); + else if (DebugLevel >= 4) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", + reqnum, tickdiff, tickdata); } m_log.DebugFormat( @@ -405,6 +409,10 @@ namespace OpenSim.Framework queryString != null ? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString : ""); + else if (DebugLevel >= 4) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", + reqnum, tickdiff, tickdata); } m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); @@ -879,6 +887,12 @@ namespace OpenSim.Framework tickdata, originalRequest); } + else if (WebUtil.DebugLevel >= 4) + { + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", + reqnum, tickdiff, tickdata); + } } } @@ -995,6 +1009,10 @@ namespace OpenSim.Framework tickdiff, tickdata, obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); + else if (WebUtil.DebugLevel >= 4) + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", + reqnum, tickdiff, tickdata); return respstring; } @@ -1144,6 +1162,12 @@ namespace OpenSim.Framework tickdata, originalRequest); } + else if (WebUtil.DebugLevel >= 4) + { + m_log.DebugFormat( + "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", + reqnum, tickdiff, tickdata); + } return deserial; } -- cgit v1.1 From 3089b6d824f1d4eb25ba12c5fd037153fdc92e1e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 20 Sep 2012 15:49:22 -0700 Subject: More HG2.0: Added permission policies in HGAsset Service based on asset types. The policies are given in the config. This is only half of the story. The other half, pertaining to exports/imports made by the sim, will be done next. --- .../Framework/InventoryAccess/HGAssetMapper.cs | 34 ++++++---- .../Services/HypergridService/HGAssetService.cs | 79 +++++++++++++++++++++- bin/Robust.HG.ini.example | 10 +++ bin/config-include/StandaloneCommon.ini.example | 11 +++ 4 files changed, 116 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index eaadc1b..fcecbbc 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -93,6 +93,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (!url.EndsWith("/") && !url.EndsWith("=")) url = url + "/"; + bool success = true; // See long comment in AssetCache.AddAsset if (!asset.Temporary || asset.Local) { @@ -103,14 +104,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // not having a global naming infrastructure AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type, asset.Metadata.CreatorID); Copy(asset, asset1); - try - { - asset1.ID = url + asset.ID; - } - catch - { - m_log.Warn("[HG ASSET MAPPER]: Oops."); - } + asset1.ID = url + asset.ID; AdjustIdentifiers(asset1.Metadata); if (asset1.Metadata.Type == (sbyte)AssetType.Object) @@ -118,11 +112,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess else asset1.Data = asset.Data; - m_scene.AssetService.Store(asset1); - m_log.DebugFormat("[HG ASSET MAPPER]: Posted copy of asset {0} from local asset server to {1}", asset1.ID, url); + string id = m_scene.AssetService.Store(asset1); + if (id == UUID.Zero.ToString()) + { + m_log.DebugFormat("[HG ASSET MAPPER]: Asset server {0} did not accept {1}", url, asset.ID); + success = false; + } + else + m_log.DebugFormat("[HG ASSET MAPPER]: Posted copy of asset {0} from local asset server to {1}", asset1.ID, url); } - return true; - } + return success; + } else m_log.Warn("[HG ASSET MAPPER]: Tried to post asset to remote server, but asset not in local cache."); @@ -259,17 +259,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess Dictionary ids = new Dictionary(); HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty); uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); + bool success = false; foreach (UUID uuid in ids.Keys) { asset = m_scene.AssetService.Get(uuid.ToString()); if (asset == null) m_log.DebugFormat("[HG ASSET MAPPER]: Could not find asset {0}", uuid); else - PostAsset(userAssetURL, asset); + success = PostAsset(userAssetURL, asset); } - // maybe all pieces got there... - m_log.DebugFormat("[HG ASSET MAPPER]: Successfully posted item {0} to asset server {1}", assetID, userAssetURL); + // maybe all pieces got there... + if (!success) + m_log.DebugFormat("[HG ASSET MAPPER]: Problems posting item {0} to asset server {1}", assetID, userAssetURL); + else + m_log.DebugFormat("[HG ASSET MAPPER]: Successfully posted item {0} to asset server {1}", assetID, userAssetURL); } else diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs index db98166..d6541c4 100644 --- a/OpenSim/Services/HypergridService/HGAssetService.cs +++ b/OpenSim/Services/HypergridService/HGAssetService.cs @@ -58,6 +58,9 @@ namespace OpenSim.Services.HypergridService private UserAccountCache m_Cache; + private bool[] m_DisallowGET, m_DisallowPOST; + private string[] m_AssetTypeNames; + public HGAssetService(IConfigSource config, string configName) : base(config, configName) { m_log.Debug("[HGAsset Service]: Starting"); @@ -80,6 +83,34 @@ namespace OpenSim.Services.HypergridService m_HomeURL = assetConfig.GetString("HomeURI", m_HomeURL); m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); + + // Permissions + Type enumType = typeof(AssetType); + m_AssetTypeNames = Enum.GetNames(enumType); + for (int i = 0; i < m_AssetTypeNames.Length; i++) + m_AssetTypeNames[i] = m_AssetTypeNames[i].ToLower(); + int n = Enum.GetValues(enumType).Length; + m_DisallowGET = new bool[n]; + m_DisallowPOST = new bool[n]; + + LoadPermsFromConfig(assetConfig, "DisallowGET", m_DisallowGET); + LoadPermsFromConfig(assetConfig, "DisallowPOST", m_DisallowPOST); + + } + + private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray) + { + string perms = assetConfig.GetString(variable, String.Empty); + string[] parts = perms.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in parts) + { + int index = Array.IndexOf(m_AssetTypeNames, s.Trim().ToLower()); + if (index >= 0) + bitArray[index] = true; + else + m_log.WarnFormat("[HGAsset Service]: Invalid AssetType {0}", s); + } + } #region IAssetService overrides @@ -90,6 +121,9 @@ namespace OpenSim.Services.HypergridService if (asset == null) return null; + if (!AllowedGet(asset.Type)) + return null; + if (asset.Metadata.Type == (sbyte)AssetType.Object) asset.Data = AdjustIdentifiers(asset.Data); ; @@ -112,16 +146,27 @@ namespace OpenSim.Services.HypergridService public override byte[] GetData(string id) { - byte[] data = base.GetData(id); + AssetBase asset = Get(id); - if (data == null) + if (asset == null) return null; - return AdjustIdentifiers(data); + if (!AllowedGet(asset.Type)) + return null; + + return asset.Data; } //public virtual bool Get(string id, Object sender, AssetRetrieved handler) + public override string Store(AssetBase asset) + { + if (!AllowedPost(asset.Type)) + return UUID.Zero.ToString(); + + return base.Store(asset); + } + public override bool Delete(string id) { // NOGO @@ -130,6 +175,34 @@ namespace OpenSim.Services.HypergridService #endregion + protected bool AllowedGet(sbyte type) + { + string assetTypeName = ((AssetType)type).ToString(); + + int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); + if (index >= 0 && m_DisallowGET[index]) + { + m_log.DebugFormat("[HGAsset Service]: GET denied: service does not allow export of AssetType {0}", assetTypeName); + return false; + } + + return true; + } + + protected bool AllowedPost(sbyte type) + { + string assetTypeName = ((AssetType)type).ToString(); + + int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); + if (index >= 0 && m_DisallowPOST[index]) + { + m_log.DebugFormat("[HGAsset Service]: POST denied: service does not allow import of AssetType {0}", assetTypeName); + return false; + } + + return true; + } + protected void AdjustIdentifiers(AssetMetadata meta) { if (meta == null || m_Cache == null) diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index fad399d..8218b14 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -437,6 +437,16 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService" HomeURI = "http://127.0.0.1:8002" + ;; The asset types that other grids can get from / post to this service. + ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: + ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh + ;; + ;; Leave blank or commented if you don't want to apply any restrictions. + ;; A more strict, but still reasonable, policy may be to disallow the exchange + ;; of scripts, like so: + ; DisallowGET ="LSLText" + ; DisallowPOST ="LSLBytecode" + [HGFriendsService] LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGFriendsService" UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index e4bc548..d8ecba8 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -53,6 +53,17 @@ [HGAssetService] HomeURI = "http://127.0.0.1:9000" + ;; The asset types that other grids can get from / post to this service. + ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: + ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh + ;; + ;; Leave blank or commented if you don't want to apply any restrictions. + ;; A more strict, but still reasonable, policy may be to disallow the exchange + ;; of scripts, like so: + ; DisallowGET ="LSLText" + ; DisallowPOST ="LSLBytecode" + + [HGInventoryAccessModule] HomeURI = "http://127.0.0.1:9000" Gatekeeper = "http://127.0.0.1:9000" -- cgit v1.1 From e29d563557bbe3a5a8f3aaf883ca92770a586e10 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Sep 2012 00:09:17 +0100 Subject: Add request number counting to incoming HTTP requests in the same way that this was already being done for outgoing HTTP requests. This allows us to associate debug logging messages with the right request. It also allows us to put a request number on 'long request' logging even if other debug logging is not enabled, which gives us some idea of whether every request is suffering this problem or only some. This is a separate internal number not associated with any incoming number in the opensim-request-id header, this will be clarified when logging of this incoming request number is re-enabled. This commit also adds port number to HTTP IN logging to allow us to distinguish between different request numbers on different ports. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 59 +++++++++++++++------- OpenSim/Framework/WebUtil.cs | 2 +- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 4e04dd8..05c2d53 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -62,6 +62,15 @@ namespace OpenSim.Framework.Servers.HttpServer /// public int DebugLevel { get; set; } + /// + /// Request number for diagnostic purposes. + /// + /// + /// This is an internal number. In some debug situations an external number may also be supplied in the + /// opensim-request-id header but we are not currently logging this. + /// + public int RequestNumber { get; private set; } + private volatile int NotSocketErrors = 0; public volatile bool HTTPDRunning = false; @@ -302,6 +311,8 @@ namespace OpenSim.Framework.Servers.HttpServer private void OnRequest(object source, RequestEventArgs args) { + RequestNumber++; + try { IHttpClientContext context = (IHttpClientContext)source; @@ -411,7 +422,6 @@ namespace OpenSim.Framework.Servers.HttpServer string requestMethod = request.HttpMethod; string uriString = request.RawUrl; -// string reqnum = "unknown"; int requestStartTick = Environment.TickCount; // Will be adjusted later on. @@ -535,8 +545,8 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); + "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}", + RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); buffer = HandleHTTPRequest(request, response); break; @@ -547,8 +557,8 @@ namespace OpenSim.Framework.Servers.HttpServer if (DebugLevel >= 3) m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); + "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}", + RequestNumber, Port, request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); buffer = HandleLLSDRequests(request, response); break; @@ -641,7 +651,8 @@ namespace OpenSim.Framework.Servers.HttpServer if (tickdiff > 3000) { m_log.InfoFormat( - "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms", + "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", + RequestNumber, requestMethod, uriString, requestHandler != null ? requestHandler.Name : "", @@ -652,12 +663,9 @@ namespace OpenSim.Framework.Servers.HttpServer else if (DebugLevel >= 4) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} {1} {2} {3} from {4} took {5}ms", - requestMethod, - uriString, - requestHandler != null ? requestHandler.Name : "", - requestHandler != null ? requestHandler.Description : "", - request.RemoteIPEndPoint, + "[BASE HTTP SERVER]: HTTP IN {0} :{1} took {2}ms", + RequestNumber, + Port, tickdiff); } } @@ -666,8 +674,14 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN stream handler {0} {1} {2} {3} from {4}", - request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description, request.RemoteIPEndPoint); + "[BASE HTTP SERVER]: HTTP IN {0} :{1} stream handler {2} {3} {4} {5} from {6}", + RequestNumber, + Port, + request.HttpMethod, + request.Url.PathAndQuery, + requestHandler.Name, + requestHandler.Description, + request.RemoteIPEndPoint); if (DebugLevel >= 5) LogIncomingInDetail(request); @@ -676,8 +690,13 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToContentTypeHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN {0} content type handler {1} {2} from {3}", - request.ContentType, request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); + "[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}", + RequestNumber, + Port, + request.ContentType, + request.HttpMethod, + request.Url.PathAndQuery, + request.RemoteIPEndPoint); if (DebugLevel >= 5) LogIncomingInDetail(request); @@ -686,8 +705,12 @@ namespace OpenSim.Framework.Servers.HttpServer private void LogIncomingToXmlRpcHandler(OSHttpRequest request) { m_log.DebugFormat( - "[BASE HTTP SERVER]: HTTP IN assumed generic XMLRPC request {0} {1} from {2}", - request.HttpMethod, request.Url.PathAndQuery, request.RemoteIPEndPoint); + "[BASE HTTP SERVER]: HTTP IN {0} :{1} assumed generic XMLRPC request {2} {3} from {4}", + RequestNumber, + Port, + request.HttpMethod, + request.Url.PathAndQuery, + request.RemoteIPEndPoint); if (DebugLevel >= 5) LogIncomingInDetail(request); diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 64d61f1..e095402 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -64,7 +64,7 @@ namespace OpenSim.Framework /// /// Request number for diagnostic purposes. /// - public static int RequestNumber = 0; + public static int RequestNumber { get; internal set; } /// /// this is the header field used to communicate the local request id -- cgit v1.1 From 1b0abf8f0cd417e2a37cffc96379274ad98183f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Sep 2012 00:29:13 +0100 Subject: Comment out the long unused afaik HTTP agent handlers. As far as I know, this was only used by the IBM Rest modules, much of which has been commented out for a very long time now. Other similar code uses HTTP or stream handlers instead. So commenting this out to reduce code complexity and the need to make this facility consistent with the others where it may not be used anyway. If this facility is actually being used then please notify me or uncomment it if you are core. --- .../Rest/Inventory/RestHandler.cs | 30 +++-- OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | 14 +- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 146 ++++++++++----------- .../Servers/HttpServer/Interfaces/IHttpServer.cs | 22 ++-- OpenSim/Framework/Servers/MainServer.cs | 6 +- 5 files changed, 112 insertions(+), 106 deletions(-) diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs index cb88695..072bd6f 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs @@ -312,14 +312,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // Now that everything is setup we can proceed to // add THIS agent to the HTTP server's handler list - if (!AddAgentHandler(Rest.Name,this)) - { - Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId); - foreach (IRest handler in handlers) - { - handler.Close(); - } - } + // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will + // have to be handled through the AddHttpHandler interface. +// if (!AddAgentHandler(Rest.Name,this)) +// { +// Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId); +// foreach (IRest handler in handlers) +// { +// handler.Close(); +// } +// } } catch (Exception e) @@ -342,11 +344,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId); - try - { - RemoveAgentHandler(Rest.Name, this); - } - catch (KeyNotFoundException){} + // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will + // have to be handled through the AddHttpHandler interface. +// try +// { +// RemoveAgentHandler(Rest.Name, this); +// } +// catch (KeyNotFoundException){} foreach (IRest handler in handlers) { diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs index eb16750..a2425b5 100644 --- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs @@ -297,7 +297,9 @@ namespace OpenSim.ApplicationPlugins.Rest { if (!IsEnabled) return false; _agents.Add(agentName, handler); - return _httpd.AddAgentHandler(agentName, handler); +// return _httpd.AddAgentHandler(agentName, handler); + + return false; } /// @@ -316,7 +318,7 @@ namespace OpenSim.ApplicationPlugins.Rest if (_agents[agentName] == handler) { _agents.Remove(agentName); - return _httpd.RemoveAgentHandler(agentName, handler); +// return _httpd.RemoveAgentHandler(agentName, handler); } return false; } @@ -358,10 +360,10 @@ namespace OpenSim.ApplicationPlugins.Rest _httpd.RemoveStreamHandler(h.HttpMethod, h.Path); } _handlers = null; - foreach (KeyValuePair h in _agents) - { - _httpd.RemoveAgentHandler(h.Key, h.Value); - } +// foreach (KeyValuePair h in _agents) +// { +// _httpd.RemoveAgentHandler(h.Key, h.Value); +// } _agents = null; } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 05c2d53..8c29ad4 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -82,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer protected Dictionary m_llsdHandlers = new Dictionary(); protected Dictionary m_streamHandlers = new Dictionary(); protected Dictionary m_HTTPHandlers = new Dictionary(); - protected Dictionary m_agentHandlers = new Dictionary(); +// protected Dictionary m_agentHandlers = new Dictionary(); protected Dictionary m_pollHandlers = new Dictionary(); @@ -260,29 +260,29 @@ namespace OpenSim.Framework.Servers.HttpServer return new List(m_pollHandlers.Keys); } - // Note that the agent string is provided simply to differentiate - // the handlers - it is NOT required to be an actual agent header - // value. - public bool AddAgentHandler(string agent, IHttpAgentHandler handler) - { - lock (m_agentHandlers) - { - if (!m_agentHandlers.ContainsKey(agent)) - { - m_agentHandlers.Add(agent, handler); - return true; - } - } - - //must already have a handler for that path so return false - return false; - } - - public List GetAgentHandlerKeys() - { - lock (m_agentHandlers) - return new List(m_agentHandlers.Keys); - } +// // Note that the agent string is provided simply to differentiate +// // the handlers - it is NOT required to be an actual agent header +// // value. +// public bool AddAgentHandler(string agent, IHttpAgentHandler handler) +// { +// lock (m_agentHandlers) +// { +// if (!m_agentHandlers.ContainsKey(agent)) +// { +// m_agentHandlers.Add(agent, handler); +// return true; +// } +// } +// +// //must already have a handler for that path so return false +// return false; +// } +// +// public List GetAgentHandlerKeys() +// { +// lock (m_agentHandlers) +// return new List(m_agentHandlers.Keys); +// } public bool AddLLSDHandler(string path, LLSDMethod handler) { @@ -438,22 +438,22 @@ namespace OpenSim.Framework.Servers.HttpServer Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); - // This is the REST agent interface. We require an agent to properly identify - // itself. If the REST handler recognizes the prefix it will attempt to - // satisfy the request. If it is not recognizable, and no damage has occurred - // the request can be passed through to the other handlers. This is a low - // probability event; if a request is matched it is normally expected to be - // handled - IHttpAgentHandler agentHandler; - - if (TryGetAgentHandler(request, response, out agentHandler)) - { - if (HandleAgentRequest(agentHandler, request, response)) - { - requestEndTick = Environment.TickCount; - return; - } - } +// // This is the REST agent interface. We require an agent to properly identify +// // itself. If the REST handler recognizes the prefix it will attempt to +// // satisfy the request. If it is not recognizable, and no damage has occurred +// // the request can be passed through to the other handlers. This is a low +// // probability event; if a request is matched it is normally expected to be +// // handled +// IHttpAgentHandler agentHandler; +// +// if (TryGetAgentHandler(request, response, out agentHandler)) +// { +// if (HandleAgentRequest(agentHandler, request, response)) +// { +// requestEndTick = Environment.TickCount; +// return; +// } +// } //response.KeepAlive = true; response.SendChunked = false; @@ -830,24 +830,24 @@ namespace OpenSim.Framework.Servers.HttpServer } } - private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) - { - agentHandler = null; - - lock (m_agentHandlers) - { - foreach (IHttpAgentHandler handler in m_agentHandlers.Values) - { - if (handler.Match(request, response)) - { - agentHandler = handler; - return true; - } - } - } - - return false; - } +// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler) +// { +// agentHandler = null; +// +// lock (m_agentHandlers) +// { +// foreach (IHttpAgentHandler handler in m_agentHandlers.Values) +// { +// if (handler.Match(request, response)) +// { +// agentHandler = handler; +// return true; +// } +// } +// } +// +// return false; +// } /// /// Try all the registered xmlrpc handlers when an xmlrpc request is received. @@ -1772,21 +1772,21 @@ namespace OpenSim.Framework.Servers.HttpServer m_pollHandlers.Remove(path); } - public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) - { - lock (m_agentHandlers) - { - IHttpAgentHandler foundHandler; - - if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler) - { - m_agentHandlers.Remove(agent); - return true; - } - } - - return false; - } +// public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) +// { +// lock (m_agentHandlers) +// { +// IHttpAgentHandler foundHandler; +// +// if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler) +// { +// m_agentHandlers.Remove(agent); +// return true; +// } +// } +// +// return false; +// } public void RemoveXmlRPCHandler(string method) { diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index db58f6f..0bd3aae 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -41,10 +41,10 @@ namespace OpenSim.Framework.Servers.HttpServer uint Port { get; } bool UseSSL { get; } - // Note that the agent string is provided simply to differentiate - // the handlers - it is NOT required to be an actual agent header - // value. - bool AddAgentHandler(string agent, IHttpAgentHandler handler); +// // Note that the agent string is provided simply to differentiate +// // the handlers - it is NOT required to be an actual agent header +// // value. +// bool AddAgentHandler(string agent, IHttpAgentHandler handler); /// /// Add a handler for an HTTP request. @@ -106,13 +106,13 @@ namespace OpenSim.Framework.Servers.HttpServer bool SetDefaultLLSDHandler(DefaultLLSDMethod handler); - /// - /// Remove the agent if it is registered. - /// - /// - /// - /// - bool RemoveAgentHandler(string agent, IHttpAgentHandler handler); +// /// +// /// Remove the agent if it is registered. +// /// +// /// +// /// +// /// +// bool RemoveAgentHandler(string agent, IHttpAgentHandler handler); /// /// Remove an HTTP handler diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 72f9cce..4b61b18 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -231,9 +231,9 @@ namespace OpenSim.Framework.Servers foreach (String s in httpServer.GetHTTPHandlerKeys()) handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); - handlers.AppendFormat("* Agent:\n"); - foreach (String s in httpServer.GetAgentHandlerKeys()) - handlers.AppendFormat("\t{0}\n", s); +// handlers.AppendFormat("* Agent:\n"); +// foreach (String s in httpServer.GetAgentHandlerKeys()) +// handlers.AppendFormat("\t{0}\n", s); handlers.AppendFormat("* LLSD:\n"); foreach (String s in httpServer.GetLLSDHandlerKeys()) -- cgit v1.1 From bceef401fa9f7b9d56c5d1173ca5204aead0a57c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Sep 2012 01:36:23 +0100 Subject: Simplify UuidGatherer by performing asset fetch synchronously rather than using the async call but waiting for completion anyway! --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 84 +++++++++++++------------ 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index efb68a2..af99090 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -57,17 +57,17 @@ namespace OpenSim.Region.Framework.Scenes /// Asset cache used for gathering assets /// protected IAssetService m_assetCache; - - /// - /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate - /// asset was found by the asset service. - /// - private AssetBase m_requestedObjectAsset; - /// - /// Signal whether we are currently waiting for the asset service to deliver an asset. - /// - private bool m_waitingForObjectAsset; +// /// +// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate +// /// asset was found by the asset service. +// /// +// private AssetBase m_requestedObjectAsset; +// +// /// +// /// Signal whether we are currently waiting for the asset service to deliver an asset. +// /// +// private bool m_waitingForObjectAsset; public UuidGatherer(IAssetService assetCache) { @@ -195,18 +195,18 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// The callback made when we request the asset for an object from the asset service. - /// - private void AssetReceived(string id, Object sender, AssetBase asset) - { - lock (this) - { - m_requestedObjectAsset = asset; - m_waitingForObjectAsset = false; - Monitor.Pulse(this); - } - } +// /// +// /// The callback made when we request the asset for an object from the asset service. +// /// +// private void AssetReceived(string id, Object sender, AssetBase asset) +// { +// lock (this) +// { +// m_requestedObjectAsset = asset; +// m_waitingForObjectAsset = false; +// Monitor.Pulse(this); +// } +// } /// /// Get an asset synchronously, potentially using an asynchronous callback. If the @@ -216,25 +216,29 @@ namespace OpenSim.Region.Framework.Scenes /// protected virtual AssetBase GetAsset(UUID uuid) { - m_waitingForObjectAsset = true; - m_assetCache.Get(uuid.ToString(), this, AssetReceived); - - // The asset cache callback can either - // - // 1. Complete on the same thread (if the asset is already in the cache) or - // 2. Come in via a different thread (if we need to go fetch it). - // - // The code below handles both these alternatives. - lock (this) - { - if (m_waitingForObjectAsset) - { - Monitor.Wait(this); - m_waitingForObjectAsset = false; - } - } + return m_assetCache.Get(uuid.ToString()); - return m_requestedObjectAsset; + // XXX: Switching to do this synchronously where the call was async before but we always waited for it + // to complete anyway! +// m_waitingForObjectAsset = true; +// m_assetCache.Get(uuid.ToString(), this, AssetReceived); +// +// // The asset cache callback can either +// // +// // 1. Complete on the same thread (if the asset is already in the cache) or +// // 2. Come in via a different thread (if we need to go fetch it). +// // +// // The code below handles both these alternatives. +// lock (this) +// { +// if (m_waitingForObjectAsset) +// { +// Monitor.Wait(this); +// m_waitingForObjectAsset = false; +// } +// } +// +// return m_requestedObjectAsset; } /// -- cgit v1.1 From 632a42e2b1e9a649be812ed57de1189778a370c9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Sep 2012 01:57:13 +0100 Subject: Rename UuidGather.m_assetCache to m_assetService. If HGUuidGatherer hasn't been instantiated with an assetServerURL then call down to overriden UuidGatherer.GetAsset() instead of calling m_assetService.GetAsset() itself - these two codepaths are now identical. --- .../CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs | 4 ++-- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs index fcb544f..c7e1ef4 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess protected string m_assetServerURL; protected HGAssetMapper m_assetMapper; - public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetCache, string assetServerURL) : base(assetCache) + public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetService, string assetServerURL) : base(assetService) { m_assetMapper = assMap; m_assetServerURL = assetServerURL; @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess protected override AssetBase GetAsset(UUID uuid) { if (string.Empty == m_assetServerURL) - return m_assetCache.Get(uuid.ToString()); + return base.GetAsset(uuid); else return m_assetMapper.FetchAsset(m_assetServerURL, uuid); } diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index af99090..dc4a082 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -52,11 +52,8 @@ namespace OpenSim.Region.Framework.Scenes public class UuidGatherer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - /// - /// Asset cache used for gathering assets - /// - protected IAssetService m_assetCache; + + protected IAssetService m_assetService; // /// // /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate @@ -71,7 +68,7 @@ namespace OpenSim.Region.Framework.Scenes public UuidGatherer(IAssetService assetCache) { - m_assetCache = assetCache; + m_assetService = assetCache; } /// @@ -216,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes /// protected virtual AssetBase GetAsset(UUID uuid) { - return m_assetCache.Get(uuid.ToString()); + return m_assetService.Get(uuid.ToString()); // XXX: Switching to do this synchronously where the call was async before but we always waited for it // to complete anyway! -- cgit v1.1 From 80f486c7782e195d8cf3eb11adaca66f6e648af1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 Sep 2012 01:59:28 +0100 Subject: minor: Make slow outgoing request log messages consistent with other log messages --- OpenSim/Framework/WebUtil.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index e095402..1d9e2ce 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -241,7 +241,7 @@ namespace OpenSim.Framework int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); if (tickdiff > LongCallTime) m_log.InfoFormat( - "[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", + "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing, {5}", reqnum, method, url, @@ -257,7 +257,7 @@ namespace OpenSim.Framework } m_log.DebugFormat( - "[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage); + "[WEB UTIL]: ServiceOSD request {0} {1} {2} FAILED: {3}", reqnum, url, method, errorMessage); return ErrorResponseMap(errorMessage); } @@ -400,7 +400,7 @@ namespace OpenSim.Framework int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); if (tickdiff > LongCallTime) m_log.InfoFormat( - "[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", + "[WEB UTIL]: Slow ServiceForm request {0} {1} {2} took {3}ms, {4}ms writing, {5}", reqnum, method, url, @@ -415,7 +415,7 @@ namespace OpenSim.Framework reqnum, tickdiff, tickdata); } - m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); + m_log.WarnFormat("[WEB UTIL]: ServiceForm request {0} {1} {2} failed: {2}", reqnum, method, url, errorMessage); return ErrorResponseMap(errorMessage); } @@ -879,7 +879,7 @@ namespace OpenSim.Framework } m_log.InfoFormat( - "[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", + "[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", reqnum, verb, requestUrl, @@ -1002,7 +1002,7 @@ namespace OpenSim.Framework int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); if (tickdiff > WebUtil.LongCallTime) m_log.InfoFormat( - "[FORMS]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", + "[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", reqnum, verb, requestUrl, @@ -1154,7 +1154,7 @@ namespace OpenSim.Framework } m_log.InfoFormat( - "[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}", + "[SynchronousRestObjectRequester]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", reqnum, verb, requestUrl, -- cgit v1.1 From e379566e6e3bed0d7001f099a5ea8dfd648d76cf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 20 Sep 2012 19:50:57 -0700 Subject: Improvement over last commit: refactor the asset permissions code, so that it can be used by both the HG Asset Service and the simulator. Also renamed the config vars to something more intuitive --- OpenSim/Framework/AssetPermissions.cs | 81 ++++++++++++++++++++++ .../Services/HypergridService/HGAssetService.cs | 63 ++--------------- bin/Robust.HG.ini.example | 10 +-- bin/config-include/StandaloneCommon.ini.example | 10 +-- 4 files changed, 98 insertions(+), 66 deletions(-) create mode 100644 OpenSim/Framework/AssetPermissions.cs diff --git a/OpenSim/Framework/AssetPermissions.cs b/OpenSim/Framework/AssetPermissions.cs new file mode 100644 index 0000000..d276def --- /dev/null +++ b/OpenSim/Framework/AssetPermissions.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Reflection; + +using Nini.Config; +using log4net; + +using OpenMetaverse; + +namespace OpenSim.Framework +{ + public class AssetPermissions + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private bool[] m_DisallowExport, m_DisallowImport; + private string[] m_AssetTypeNames; + + public AssetPermissions(IConfig config) + { + Type enumType = typeof(AssetType); + m_AssetTypeNames = Enum.GetNames(enumType); + for (int i = 0; i < m_AssetTypeNames.Length; i++) + m_AssetTypeNames[i] = m_AssetTypeNames[i].ToLower(); + int n = Enum.GetValues(enumType).Length; + m_DisallowExport = new bool[n]; + m_DisallowImport = new bool[n]; + + LoadPermsFromConfig(config, "DisallowExport", m_DisallowExport); + LoadPermsFromConfig(config, "DisallowImport", m_DisallowImport); + + } + + private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray) + { + string perms = assetConfig.GetString(variable, String.Empty); + string[] parts = perms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in parts) + { + int index = Array.IndexOf(m_AssetTypeNames, s.Trim().ToLower()); + if (index >= 0) + bitArray[index] = true; + else + m_log.WarnFormat("[Asset Permissions]: Invalid AssetType {0}", s); + } + + } + + public bool AllowedExport(sbyte type) + { + string assetTypeName = ((AssetType)type).ToString(); + + int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); + if (index >= 0 && m_DisallowExport[index]) + { + m_log.DebugFormat("[Asset Permissions]: Export denied: configuration does not allow export of AssetType {0}", assetTypeName); + return false; + } + + return true; + } + + public bool AllowedImport(sbyte type) + { + string assetTypeName = ((AssetType)type).ToString(); + + int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); + if (index >= 0 && m_DisallowImport[index]) + { + m_log.DebugFormat("[Asset Permissions]: Import denied: configuration does not allow import of AssetType {0}", assetTypeName); + return false; + } + + return true; + } + + + } +} diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs index d6541c4..f1275a0 100644 --- a/OpenSim/Services/HypergridService/HGAssetService.cs +++ b/OpenSim/Services/HypergridService/HGAssetService.cs @@ -58,8 +58,7 @@ namespace OpenSim.Services.HypergridService private UserAccountCache m_Cache; - private bool[] m_DisallowGET, m_DisallowPOST; - private string[] m_AssetTypeNames; + private AssetPermissions m_AssetPerms; public HGAssetService(IConfigSource config, string configName) : base(config, configName) { @@ -85,31 +84,7 @@ namespace OpenSim.Services.HypergridService m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); // Permissions - Type enumType = typeof(AssetType); - m_AssetTypeNames = Enum.GetNames(enumType); - for (int i = 0; i < m_AssetTypeNames.Length; i++) - m_AssetTypeNames[i] = m_AssetTypeNames[i].ToLower(); - int n = Enum.GetValues(enumType).Length; - m_DisallowGET = new bool[n]; - m_DisallowPOST = new bool[n]; - - LoadPermsFromConfig(assetConfig, "DisallowGET", m_DisallowGET); - LoadPermsFromConfig(assetConfig, "DisallowPOST", m_DisallowPOST); - - } - - private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray) - { - string perms = assetConfig.GetString(variable, String.Empty); - string[] parts = perms.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries); - foreach (string s in parts) - { - int index = Array.IndexOf(m_AssetTypeNames, s.Trim().ToLower()); - if (index >= 0) - bitArray[index] = true; - else - m_log.WarnFormat("[HGAsset Service]: Invalid AssetType {0}", s); - } + m_AssetPerms = new AssetPermissions(assetConfig); } @@ -121,7 +96,7 @@ namespace OpenSim.Services.HypergridService if (asset == null) return null; - if (!AllowedGet(asset.Type)) + if (!m_AssetPerms.AllowedExport(asset.Type)) return null; if (asset.Metadata.Type == (sbyte)AssetType.Object) @@ -151,7 +126,7 @@ namespace OpenSim.Services.HypergridService if (asset == null) return null; - if (!AllowedGet(asset.Type)) + if (!m_AssetPerms.AllowedExport(asset.Type)) return null; return asset.Data; @@ -161,7 +136,7 @@ namespace OpenSim.Services.HypergridService public override string Store(AssetBase asset) { - if (!AllowedPost(asset.Type)) + if (!m_AssetPerms.AllowedImport(asset.Type)) return UUID.Zero.ToString(); return base.Store(asset); @@ -175,34 +150,6 @@ namespace OpenSim.Services.HypergridService #endregion - protected bool AllowedGet(sbyte type) - { - string assetTypeName = ((AssetType)type).ToString(); - - int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); - if (index >= 0 && m_DisallowGET[index]) - { - m_log.DebugFormat("[HGAsset Service]: GET denied: service does not allow export of AssetType {0}", assetTypeName); - return false; - } - - return true; - } - - protected bool AllowedPost(sbyte type) - { - string assetTypeName = ((AssetType)type).ToString(); - - int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower()); - if (index >= 0 && m_DisallowPOST[index]) - { - m_log.DebugFormat("[HGAsset Service]: POST denied: service does not allow import of AssetType {0}", assetTypeName); - return false; - } - - return true; - } - protected void AdjustIdentifiers(AssetMetadata meta) { if (meta == null || m_Cache == null) diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 8218b14..399779d 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -437,15 +437,17 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService" HomeURI = "http://127.0.0.1:8002" - ;; The asset types that other grids can get from / post to this service. + ;; The asset types that this service can export to / import from other grids. + ;; Comma separated. ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: - ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh + ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, + ;; LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh ;; ;; Leave blank or commented if you don't want to apply any restrictions. ;; A more strict, but still reasonable, policy may be to disallow the exchange ;; of scripts, like so: - ; DisallowGET ="LSLText" - ; DisallowPOST ="LSLBytecode" + ; DisallowExport ="LSLText" + ; DisallowImport ="LSLBytecode" [HGFriendsService] LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGFriendsService" diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index d8ecba8..d5eb50d 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -53,15 +53,17 @@ [HGAssetService] HomeURI = "http://127.0.0.1:9000" - ;; The asset types that other grids can get from / post to this service. + ;; The asset types that this service can export to / import from other grids. + ;; Comma separated. ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: - ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh + ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, + ;; LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh ;; ;; Leave blank or commented if you don't want to apply any restrictions. ;; A more strict, but still reasonable, policy may be to disallow the exchange ;; of scripts, like so: - ; DisallowGET ="LSLText" - ; DisallowPOST ="LSLBytecode" + ; DisallowExport ="LSLText" + ; DisallowImport ="LSLBytecode" [HGInventoryAccessModule] -- cgit v1.1 From 5f97b3e1d9775a88c1d952f1d599254969a262d2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 06:41:32 -0700 Subject: Minor: change the return value of unsuccessful posts to string.Empty. --- OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 2 +- OpenSim/Services/HypergridService/HGAssetService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index fcecbbc..144cc87 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess asset1.Data = asset.Data; string id = m_scene.AssetService.Store(asset1); - if (id == UUID.Zero.ToString()) + if (id == string.Empty) { m_log.DebugFormat("[HG ASSET MAPPER]: Asset server {0} did not accept {1}", url, asset.ID); success = false; diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs index f1275a0..84dec8d 100644 --- a/OpenSim/Services/HypergridService/HGAssetService.cs +++ b/OpenSim/Services/HypergridService/HGAssetService.cs @@ -137,7 +137,7 @@ namespace OpenSim.Services.HypergridService public override string Store(AssetBase asset) { if (!m_AssetPerms.AllowedImport(asset.Type)) - return UUID.Zero.ToString(); + return string.Empty; return base.Store(asset); } -- cgit v1.1 From b542622b3a841e73f071aab563ba1e211c5a87e3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 07:44:18 -0700 Subject: HG 2.0: added asset import/export policies at the sim too. --- .../ServiceConnectorsOut/Asset/HGAssetBroker.cs | 23 ++++++++++++++-------- bin/Robust.HG.ini.example | 2 +- bin/config-include/GridCommon.ini.example | 20 +++++++++++++++++++ bin/config-include/StandaloneCommon.ini.example | 2 +- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 008465f..0456852 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -56,6 +56,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset private bool m_Enabled = false; + private AssetPermissions m_AssetPerms; + public Type ReplaceableInterface { get { return null; } @@ -128,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (m_LocalAssetServiceURI != string.Empty) m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); + IConfig hgConfig = source.Configs["HGAssetService"]; + m_AssetPerms = new AssetPermissions(hgConfig); + m_Enabled = true; m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); } @@ -206,14 +211,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset asset = m_HGService.Get(id); if (asset != null) { - // Now store it locally - // For now, let me just do it for textures and scripts - if (((AssetType)asset.Type == AssetType.Texture) || - ((AssetType)asset.Type == AssetType.LSLBytecode) || - ((AssetType)asset.Type == AssetType.LSLText)) - { + // Now store it locally, if allowed + if (m_AssetPerms.AllowedImport(asset.Type)) m_GridService.Store(asset); - } + else + return null; } } else @@ -328,7 +330,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset string id = string.Empty; if (IsHG(asset.ID)) - id = m_HGService.Store(asset); + { + if (m_AssetPerms.AllowedExport(asset.Type)) + id = m_HGService.Store(asset); + else + return String.Empty; + } else id = m_GridService.Store(asset); diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 399779d..afb3f6f 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -437,7 +437,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService" HomeURI = "http://127.0.0.1:8002" - ;; The asset types that this service can export to / import from other grids. + ;; The asset types that this grid can export to / import from other grids. ;; Comma separated. ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example index 8d7f6fc..79f7ed6 100644 --- a/bin/config-include/GridCommon.ini.example +++ b/bin/config-include/GridCommon.ini.example @@ -137,6 +137,26 @@ ;; uncomment the next line. You may want to do this on sims that have licensed content. ; OutboundPermission = False +[HGAssetService] + ; + ; === HG ONLY === + ; Change this to your server + ; accessible from other grids + ; + HomeURI = "http://mygridserver.com:8002" + + ;; The asset types that this grid can export to / import from other grids. + ;; Comma separated. + ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: + ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, + ;; LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh + ;; + ;; Leave blank or commented if you don't want to apply any restrictions. + ;; A more strict, but still reasonable, policy may be to disallow the exchange + ;; of scripts, like so: + ; DisallowExport ="LSLText" + ; DisallowImport ="LSLBytecode" + [HGFriendsModule] ; User level required to be able to send friendship invitations to foreign users ;LevelHGFriends = 0; diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index d5eb50d..048710a 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -53,7 +53,7 @@ [HGAssetService] HomeURI = "http://127.0.0.1:9000" - ;; The asset types that this service can export to / import from other grids. + ;; The asset types that this grid can export to / import from other grids. ;; Comma separated. ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, -- cgit v1.1 From f931c0a86893799548d1d0f72c327c37823e4612 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 15:04:41 -0700 Subject: Minor: may avoid crashes of sims that still don't have this configuration section. --- OpenSim/Framework/AssetPermissions.cs | 3 +++ OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/AssetPermissions.cs b/OpenSim/Framework/AssetPermissions.cs index d276def..4a905c2 100644 --- a/OpenSim/Framework/AssetPermissions.cs +++ b/OpenSim/Framework/AssetPermissions.cs @@ -35,6 +35,9 @@ namespace OpenSim.Framework private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray) { + if (assetConfig == null) + return; + string perms = assetConfig.GetString(variable, String.Empty); string[] parts = perms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string s in parts) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 0456852..1e1c7d0 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); IConfig hgConfig = source.Configs["HGAssetService"]; - m_AssetPerms = new AssetPermissions(hgConfig); + m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null m_Enabled = true; m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); -- cgit v1.1 From fb2ace6fff788b18df070933f8f80ee2d2fc1679 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 15:55:58 -0700 Subject: Removed redundant asset fetches on HGAssetMapper. The UuidGatherer already downloads the assets, so we don't need to do it again... --- .../Framework/InventoryAccess/HGAssetMapper.cs | 42 ++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 144cc87..dd0ea1c 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -71,6 +71,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess #region Internal functions + public AssetMetadata FetchMetadata(string url, UUID assetID) + { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + + AssetMetadata meta = m_scene.AssetService.GetMetadata(url + assetID.ToString()); + + if (meta != null) + m_log.DebugFormat("[HG ASSET MAPPER]: Fetched metadata for asset {0} of type {1} from {2} ", assetID, meta.Type, url); + else + m_log.DebugFormat("[HG ASSET MAPPER]: Unable to fetched metadata for asset {0} from {1} ", assetID, url); + + return meta; + } + public AssetBase FetchAsset(string url, UUID assetID) { if (!url.EndsWith("/") && !url.EndsWith("=")) @@ -222,28 +237,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess public void Get(UUID assetID, UUID ownerID, string userAssetURL) { - // Get the item from the remote asset server onto the local AssetCache - // and place an entry in m_assetMap + // Get the item from the remote asset server onto the local AssetService - m_log.Debug("[HG ASSET MAPPER]: Fetching object " + assetID + " from asset server " + userAssetURL); - AssetBase asset = FetchAsset(userAssetURL, assetID); + AssetMetadata meta = FetchMetadata(userAssetURL, assetID); + if (meta == null) + return; - if (asset != null) - { - // OK, now fetch the inside. - Dictionary ids = new Dictionary(); - HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); - uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); - if (ids.ContainsKey(assetID)) - ids.Remove(assetID); - foreach (UUID uuid in ids.Keys) - FetchAsset(userAssetURL, uuid); + // The act of gathering UUIDs downloads the assets from the remote server + Dictionary ids = new Dictionary(); + HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); + uuidGatherer.GatherAssetUuids(assetID, (AssetType)meta.Type, ids); - m_log.DebugFormat("[HG ASSET MAPPER]: Successfully fetched asset {0} from asset server {1}", asset.ID, userAssetURL); + m_log.DebugFormat("[HG ASSET MAPPER]: Successfully fetched asset {0} from asset server {1}", assetID, userAssetURL); - } - else - m_log.Warn("[HG ASSET MAPPER]: Could not fetch asset from remote asset server " + userAssetURL); } -- cgit v1.1 From 5df39446078327106df5e9331f0156b149727d61 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 22 Sep 2012 00:23:25 +0100 Subject: Fix llListFindList() returning no match when there is a match with a script constant component in the source list. Adds regression test for this case. Based on http://opensimulator.org/mantis/view.php?id=6156 Thanks SignpostMarv. --- .../Shared/Api/Implementation/LSL_Api.cs | 24 ++-- .../ScriptEngine/Shared/Tests/LSL_ApiListTests.cs | 134 +++++++++++++++++++++ 2 files changed, 150 insertions(+), 8 deletions(-) create mode 100644 OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 11826bd..52d96bc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5465,27 +5465,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Returns the index of the first occurrence of test /// in src. /// - + /// Source list + /// List to search for + /// + /// The index number of the point in src where test was found if it was found. + /// Otherwise returns -1 + /// public LSL_Integer llListFindList(LSL_List src, LSL_List test) { - int index = -1; int length = src.Length - test.Length + 1; m_host.AddScriptLPS(1); // If either list is empty, do not match - if (src.Length != 0 && test.Length != 0) { for (int i = 0; i < length; i++) { - if (src.Data[i].Equals(test.Data[0])) + // Why this piece of insanity? This is because most script constants are C# value types (e.g. int) + // rather than wrapped LSL types. Such a script constant does not have int.Equal(LSL_Integer) code + // and so the comparison fails even if the LSL_Integer conceptually has the same value. + // Therefore, here we test Equals on both the source and destination objects. + // However, a future better approach may be use LSL struct script constants (e.g. LSL_Integer(1)). + if (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i])) { int j; for (j = 1; j < test.Length; j++) - if (!src.Data[i+j].Equals(test.Data[j])) + if (!(src.Data[i+j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i+j]))) break; + if (j == test.Length) { index = i; @@ -5496,19 +5505,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } return index; - } public LSL_String llGetObjectName() { m_host.AddScriptLPS(1); - return m_host.Name!=null?m_host.Name:String.Empty; + return m_host.Name !=null ? m_host.Name : String.Empty; } public void llSetObjectName(string name) { m_host.AddScriptLPS(1); - m_host.Name = name!=null?name:String.Empty; + m_host.Name = name != null ? name : String.Empty; } public LSL_String llGetDate() diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs new file mode 100644 index 0000000..dd23be8 --- /dev/null +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs @@ -0,0 +1,134 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using NUnit.Framework; +using OpenSim.Framework; +using OpenSim.Tests.Common; +using OpenSim.Region.ScriptEngine.Shared; +using OpenSim.Region.Framework.Scenes; +using Nini.Config; +using OpenSim.Region.ScriptEngine.Shared.Api; +using OpenSim.Region.ScriptEngine.Shared.ScriptBase; +using OpenMetaverse; +using OpenSim.Tests.Common.Mock; + +using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; +using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; +using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list; +using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; + +namespace OpenSim.Region.ScriptEngine.Shared.Tests +{ + [TestFixture] + public class LSL_ApiListTests + { + private LSL_Api m_lslApi; + + [SetUp] + public void SetUp() + { + IConfigSource initConfigSource = new IniConfigSource(); + IConfig config = initConfigSource.AddConfig("XEngine"); + config.Set("Enabled", "true"); + + Scene scene = new SceneHelpers().SetupScene(); + SceneObjectPart part = SceneHelpers.AddSceneObject(scene).RootPart; + + XEngine.XEngine engine = new XEngine.XEngine(); + engine.Initialise(initConfigSource); + engine.AddRegion(scene); + + m_lslApi = new LSL_Api(); + m_lslApi.Initialize(engine, part, null); + } + + [Test] + public void TestllListFindList() + { + TestHelpers.InMethod(); + + LSL_List src = new LSL_List(new LSL_Integer(1), new LSL_Integer(2), new LSL_Integer(3)); + + { + // Test for a single item that should be found + int result = m_lslApi.llListFindList(src, new LSL_List(new LSL_Integer(4))); + Assert.That(result, Is.EqualTo(-1)); + } + + { + // Test for a single item that should be found + int result = m_lslApi.llListFindList(src, new LSL_List(new LSL_Integer(2))); + Assert.That(result, Is.EqualTo(1)); + } + + { + // Test for a constant that should be found + int result = m_lslApi.llListFindList(src, new LSL_List(ScriptBaseClass.AGENT)); + Assert.That(result, Is.EqualTo(0)); + } + + { + // Test for a list that should be found + int result = m_lslApi.llListFindList(src, new LSL_List(new LSL_Integer(2), new LSL_Integer(3))); + Assert.That(result, Is.EqualTo(1)); + } + + { + // Test for a single item not in the list + int result = m_lslApi.llListFindList(src, new LSL_List(new LSL_Integer(4))); + Assert.That(result, Is.EqualTo(-1)); + } + + { + // Test for something that should not be cast + int result = m_lslApi.llListFindList(src, new LSL_List(new LSL_String("4"))); + Assert.That(result, Is.EqualTo(-1)); + } + + { + // Test for a list not in the list + int result + = m_lslApi.llListFindList( + src, new LSL_List(new LSL_Integer(2), new LSL_Integer(3), new LSL_Integer(4))); + Assert.That(result, Is.EqualTo(-1)); + } + + { + LSL_List srcWithConstants + = new LSL_List(new LSL_Integer(3), ScriptBaseClass.AGENT, ScriptBaseClass.OS_NPC_LAND_AT_TARGET); + + // Test for constants that appears in the source list that should be found + int result + = m_lslApi.llListFindList(srcWithConstants, new LSL_List(new LSL_Integer(1), new LSL_Integer(2))); + + Assert.That(result, Is.EqualTo(1)); + } + } + } + } \ No newline at end of file -- cgit v1.1 From cfa022700d3d099eee7cd25d18da875639506ea8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 16:45:16 -0700 Subject: Moved the small HGUuidGatherer class to the file where its parent class is. No need to keep 2 separate files. --- .../Framework/InventoryAccess/HGAssetMapper.cs | 19 +------- .../Framework/InventoryAccess/HGUuidGatherer.cs | 57 ---------------------- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 36 ++++++++++++++ 3 files changed, 38 insertions(+), 74 deletions(-) delete mode 100644 OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index dd0ea1c..6f62856 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -86,21 +86,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return meta; } - public AssetBase FetchAsset(string url, UUID assetID) - { - if (!url.EndsWith("/") && !url.EndsWith("=")) - url = url + "/"; - - AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString()); - - if (asset != null) - { - m_log.DebugFormat("[HG ASSET MAPPER]: Copied asset {0} from {1} to local asset server. ", asset.ID, url); - return asset; - } - return null; - } - public bool PostAsset(string url, AssetBase asset) { if (asset != null) @@ -245,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // The act of gathering UUIDs downloads the assets from the remote server Dictionary ids = new Dictionary(); - HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); + HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); uuidGatherer.GatherAssetUuids(assetID, (AssetType)meta.Type, ids); m_log.DebugFormat("[HG ASSET MAPPER]: Successfully fetched asset {0} from asset server {1}", assetID, userAssetURL); @@ -263,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (asset != null) { Dictionary ids = new Dictionary(); - HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, string.Empty); + HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); bool success = false; foreach (UUID uuid in ids.Keys) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs deleted file mode 100644 index c7e1ef4..0000000 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGUuidGatherer.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; - -using OpenSim.Framework; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Services.Interfaces; -using OpenMetaverse; - -namespace OpenSim.Region.CoreModules.Framework.InventoryAccess -{ - public class HGUuidGatherer : UuidGatherer - { - protected string m_assetServerURL; - protected HGAssetMapper m_assetMapper; - - public HGUuidGatherer(HGAssetMapper assMap, IAssetService assetService, string assetServerURL) : base(assetService) - { - m_assetMapper = assMap; - m_assetServerURL = assetServerURL; - } - - protected override AssetBase GetAsset(UUID uuid) - { - if (string.Empty == m_assetServerURL) - return base.GetAsset(uuid); - else - return m_assetMapper.FetchAsset(m_assetServerURL, uuid); - } - } -} diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index dc4a082..383604d 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -366,4 +366,40 @@ namespace OpenSim.Region.Framework.Scenes } } } + + public class HGUuidGatherer : UuidGatherer + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected string m_assetServerURL; + + public HGUuidGatherer(IAssetService assetService, string assetServerURL) + : base(assetService) + { + m_assetServerURL = assetServerURL; + } + + protected override AssetBase GetAsset(UUID uuid) + { + if (string.Empty == m_assetServerURL) + return base.GetAsset(uuid); + else + return FetchAsset(m_assetServerURL, uuid); + } + + public AssetBase FetchAsset(string url, UUID assetID) + { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + + AssetBase asset = m_assetService.Get(url + assetID.ToString()); + + if (asset != null) + { + m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server. ", asset.ID, url); + return asset; + } + return null; + } + } } -- cgit v1.1 From 8d7b1f8aa08efbb2d0087abee22178c36cbc2f98 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 21 Sep 2012 23:32:41 +0100 Subject: Documenting non-LSL script-related events --- OpenSim/Region/Framework/Scenes/EventManager.cs | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index f079e00..96e9797 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -279,6 +279,16 @@ namespace OpenSim.Region.Framework.Scenes /// in /// public event ObjectDeGrabDelegate OnObjectDeGrab; + + /// + /// Triggered when a script resets. + /// + /// + /// Triggered by + /// in + /// via + /// via + /// public event ScriptResetDelegate OnScriptReset; public event OnPermissionErrorDelegate OnPermissionError; @@ -288,17 +298,50 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// Occurs after OnNewScript. + /// Triggered by + /// in /// public event NewRezScript OnRezScript; public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); public delegate void RemoveScript(uint localID, UUID itemID); + + /// + /// Triggered when a script is removed from an object. + /// + /// + /// Triggered by + /// in , + /// , + /// , + /// + /// public event RemoveScript OnRemoveScript; public delegate void StartScript(uint localID, UUID itemID); + + /// + /// Triggered when a script starts. + /// + /// + /// Triggered by + /// in + /// via , + /// via + /// public event StartScript OnStartScript; public delegate void StopScript(uint localID, UUID itemID); + + /// + /// Triggered when a script stops. + /// + /// + /// Triggered by , + /// in , + /// , + /// + /// public event StopScript OnStopScript; public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta); @@ -349,6 +392,9 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// Occurs before OnRezScript + /// Triggered by + /// in , + /// /// public event NewScript OnNewScript; @@ -383,6 +429,12 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset. + /// Triggered by + /// in + /// via + /// via + /// via + /// via /// public event UpdateScript OnUpdateScript; -- cgit v1.1 From a6f73282165b6e216c87da59e57f7e5eba71c6ef Mon Sep 17 00:00:00 2001 From: Michelle Argus Date: Fri, 3 Aug 2012 20:01:10 +0200 Subject: Remove deprecated parameters for region_id. Remove deprecated parameters for region_id as anounced in january 2012. --- .../RemoteController/RemoteAdminPlugin.cs | 74 ---------------------- 1 file changed, 74 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index a5e56f9..5d80ba9 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -728,7 +728,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController responseData["success"] = true; responseData["region_name"] = region.RegionName; responseData["region_id"] = region.RegionID.ToString(); - responseData["region_uuid"] = region.RegionID.ToString(); //Deprecate July 2012 m_log.Info("[RADMIN]: CreateRegion: request complete"); } @@ -1881,29 +1880,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { return; } - #region Deprecate July 2012 - //region_ID, regionid, region_uuid will be deprecated in July 2012!!!!!! - else if (requestData.ContainsKey("regionid") && - !String.IsNullOrEmpty((string)requestData["regionid"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead"); - } - else if (requestData.ContainsKey("region_ID") && - !String.IsNullOrEmpty((string)requestData["region_ID"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead"); - } - else if (requestData.ContainsKey("regionID") && - !String.IsNullOrEmpty((string)requestData["regionID"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead"); - } - else if (requestData.ContainsKey("region_uuid") && - !String.IsNullOrEmpty((string)requestData["region_uuid"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead"); - } - #endregion else { responseData["accepted"] = false; @@ -1925,56 +1901,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController throw new Exception(String.Format("Region ID {0} not found", regionID)); } } - #region Deprecate July 2012 - else if (requestData.ContainsKey("regionid") && - !String.IsNullOrEmpty((string)requestData["regionid"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead"); - - UUID regionID = (UUID)(string)requestData["regionid"]; - if (!m_application.SceneManager.TryGetScene(regionID, out scene)) - { - responseData["error"] = String.Format("Region ID {0} not found", regionID); - throw new Exception(String.Format("Region ID {0} not found", regionID)); - } - } - else if (requestData.ContainsKey("region_ID") && - !String.IsNullOrEmpty((string)requestData["region_ID"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead"); - - UUID regionID = (UUID)(string)requestData["region_ID"]; - if (!m_application.SceneManager.TryGetScene(regionID, out scene)) - { - responseData["error"] = String.Format("Region ID {0} not found", regionID); - throw new Exception(String.Format("Region ID {0} not found", regionID)); - } - } - else if (requestData.ContainsKey("regionID") && - !String.IsNullOrEmpty((string)requestData["regionID"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead"); - - UUID regionID = (UUID)(string)requestData["regionID"]; - if (!m_application.SceneManager.TryGetScene(regionID, out scene)) - { - responseData["error"] = String.Format("Region ID {0} not found", regionID); - throw new Exception(String.Format("Region ID {0} not found", regionID)); - } - } - else if (requestData.ContainsKey("region_uuid") && - !String.IsNullOrEmpty((string)requestData["region_uuid"])) - { - m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead"); - - UUID regionID = (UUID)(string)requestData["region_uuid"]; - if (!m_application.SceneManager.TryGetScene(regionID, out scene)) - { - responseData["error"] = String.Format("Region ID {0} not found", regionID); - throw new Exception(String.Format("Region ID {0} not found", regionID)); - } - } - #endregion else if (requestData.ContainsKey("region_name") && !String.IsNullOrEmpty((string)requestData["region_name"])) { -- cgit v1.1 From 21a6ef5bb63e56612b8e03002dbee9ff1fcdc4c0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 17:58:44 -0700 Subject: This fixes HG attachments' missing assets (textures, etc). Also, further improvements on HGUuidGatherer: if the assets are already in this grid don't fetch them again. --- .../EntityTransfer/HGEntityTransferModule.cs | 28 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 27 +++++++++++++-------- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 0b386d3..a6698e6 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -150,6 +150,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (m_Enabled) scene.RegisterModuleInterface(this); + + scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; + } + + void OnIncomingSceneObject(SceneObjectGroup so) + { + if (!so.IsAttachment) + return; + + if (so.Scene.UserManagementModule.IsLocalGridUser(so.AttachedAvatar)) + return; + + // foreign user + AgentCircuitData aCircuit = so.Scene.AuthenticateHandler.GetAgentCircuitData(so.AttachedAvatar); + if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) + { + if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) + { + string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); + m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Incoming attachement {0} for HG user {1} with asset server {2}", so.Name, so.AttachedAvatar, url); + Dictionary ids = new Dictionary(); + HGUuidGatherer uuidGatherer = new HGUuidGatherer(so.Scene.AssetService, url); + uuidGatherer.GatherAssetUuids(so, ids); + + foreach (KeyValuePair kvp in ids) + uuidGatherer.FetchAsset(kvp.Key); + } + } } protected override void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 383604d..28cd09f 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -377,6 +377,8 @@ namespace OpenSim.Region.Framework.Scenes : base(assetService) { m_assetServerURL = assetServerURL; + if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("=")) + m_assetServerURL = m_assetServerURL + "/"; } protected override AssetBase GetAsset(UUID uuid) @@ -384,22 +386,27 @@ namespace OpenSim.Region.Framework.Scenes if (string.Empty == m_assetServerURL) return base.GetAsset(uuid); else - return FetchAsset(m_assetServerURL, uuid); + return FetchAsset(uuid); } - public AssetBase FetchAsset(string url, UUID assetID) + public AssetBase FetchAsset(UUID assetID) { - if (!url.EndsWith("/") && !url.EndsWith("=")) - url = url + "/"; - AssetBase asset = m_assetService.Get(url + assetID.ToString()); - - if (asset != null) + // Test if it's already here + AssetBase asset = m_assetService.Get(assetID.ToString()); + if (asset == null) { - m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server. ", asset.ID, url); - return asset; + // It's not, so fetch it from abroad + asset = m_assetService.Get(m_assetServerURL + assetID.ToString()); + if (asset != null) + m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server", assetID, m_assetServerURL); + else + m_log.DebugFormat("[HGUUIDGatherer]: Failed to fetch asset {0} from {1}", assetID, m_assetServerURL); } - return null; + //else + // m_log.DebugFormat("[HGUUIDGatherer]: Asset {0} from {1} was already here", assetID, m_assetServerURL); + + return asset; } } } -- cgit v1.1 From 48f4b32d7f23c2d7a52db355017c8b2bb57b55fa Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 21 Sep 2012 21:03:14 -0700 Subject: More HG 2.0: access control at the Gatekeeper. \o/ --- .../Services/HypergridService/GatekeeperService.cs | 62 +++++++++++++++++++--- bin/Robust.HG.ini.example | 12 +++++ bin/config-include/StandaloneCommon.ini.example | 11 +++- 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 47d22b9..0f7d7c6 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -58,9 +58,11 @@ namespace OpenSim.Services.HypergridService private static IUserAgentService m_UserAgentService; private static ISimulationService m_SimulationService; - protected string m_AllowedClients = string.Empty; - protected string m_DeniedClients = string.Empty; + private static string m_AllowedClients = string.Empty; + private static string m_DeniedClients = string.Empty; private static bool m_ForeignAgentsAllowed = true; + private static List m_ForeignsAllowedExceptions = new List(); + private static List m_ForeignsDisallowedExceptions = new List(); private static UUID m_ScopeID; private static bool m_AllowTeleportsToAnyRegion; @@ -113,6 +115,9 @@ namespace OpenSim.Services.HypergridService m_DeniedClients = serverConfig.GetString("DeniedClients", string.Empty); m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); + LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); + LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_ForeignsDisallowedExceptions); + if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); @@ -125,6 +130,15 @@ namespace OpenSim.Services.HypergridService { } + protected void LoadDomainExceptionsFromConfig(IConfig config, string variable, List exceptions) + { + string value = config.GetString(variable, string.Empty); + string[] parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + + foreach (string s in parts) + exceptions.Add(s.Trim()); + } + public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason) { regionID = UUID.Zero; @@ -260,14 +274,25 @@ namespace OpenSim.Services.HypergridService m_log.DebugFormat("[GATEKEEPER SERVICE]: User is ok"); // - // Foreign agents allowed + // Foreign agents allowed? Exceptions? // - if (account == null && !m_ForeignAgentsAllowed) + if (account == null) { - reason = "Unauthorized"; - m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agents are not permitted {0} {1}. Refusing service.", - aCircuit.firstname, aCircuit.lastname); - return false; + bool allowed = m_ForeignAgentsAllowed; + + if (m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsAllowedExceptions)) + allowed = false; + + if (!m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsDisallowedExceptions)) + allowed = true; + + if (!allowed) + { + reason = "Destination does not allow visitors from your world"; + m_log.InfoFormat("[GATEKEEPER SERVICE]: Foreign agents are not permitted {0} {1} @ {2}. Refusing service.", + aCircuit.firstname, aCircuit.lastname, aCircuit.ServiceURLs["HomeURI"]); + return false; + } } // May want to authorize @@ -393,6 +418,27 @@ namespace OpenSim.Services.HypergridService #region Misc + private bool IsException(AgentCircuitData aCircuit, List exceptions) + { + bool exception = false; + if (exceptions.Count > 0) // we have exceptions + { + // Retrieve the visitor's origin + string userURL = aCircuit.ServiceURLs["HomeURI"].ToString(); + if (!userURL.EndsWith("/")) + userURL += "/"; + + if (exceptions.Find(delegate(string s) + { + if (!s.EndsWith("/")) + s += "/"; + return s == userURL; + }) != null) + exception = true; + } + + return exception; + } #endregion } diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index afb3f6f..1bafdbd 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -396,6 +396,18 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ;AllowedClients = "" ;DeniedClients = "" + ;; Are foreign visitors allowed? + ;ForeignAgentsAllowed = true + ;; + ;; If ForeignAgentsAllowed is true, make exceptions using AllowExcept. + ;; Leave blank or commented for no exceptions. + ; AllowExcept = "http://griefer.com:8002, http://enemy.com:8002" + ;; + ;; If ForeignAgentsAllowed is false, make exceptions using DisallowExcept + ;; Leave blank or commented for no exceptions. + ; DisallowExcept = "http://myfriendgrid.com:8002, http://myboss.com:8002" + + [UserAgentService] LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" ;; for the service diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index 048710a..4339cb1 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -164,8 +164,17 @@ ;AllowedClients = "" ;DeniedClients = "" - ;; Are foreign visitors allowed + ;; Are foreign visitors allowed? ;ForeignAgentsAllowed = true + ;; + ;; If ForeignAgentsAllowed is true, make exceptions using AllowExcept. + ;; Leave blank or commented for no exceptions. + ; AllowExcept = "http://griefer.com:8002, http://enemy.com:8002" + ;; + ;; If ForeignAgentsAllowed is false, make exceptions using DisallowExcept + ;; Leave blank or commented for no exceptions. + ; DisallowExcept = "http://myfriendgrid.com:8002, http://myboss.com:8002" + [FreeswitchService] ;; If FreeSWITCH is not being used then you don't need to set any of these parameters -- cgit v1.1 From fb6d6e5cca8e283025ef80cfd29a97bc5882550d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 22 Sep 2012 11:11:48 -0700 Subject: HG 2.0: User Agent Service now can also control where the local users can go. Domain-name and user-level based. \o/ --- .../Services/HypergridService/UserAgentService.cs | 103 ++++++++++++++++++++- bin/Robust.HG.ini.example | 18 ++++ bin/config-include/StandaloneCommon.ini.example | 19 +++- 3 files changed, 136 insertions(+), 4 deletions(-) diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 49c7f89..a6fc731 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -77,6 +77,10 @@ namespace OpenSim.Services.HypergridService protected static bool m_BypassClientVerification; + private static Dictionary m_ForeignTripsAllowed = new Dictionary(); + private static Dictionary> m_TripsAllowedExceptions = new Dictionary>(); + private static Dictionary> m_TripsDisallowedExceptions = new Dictionary>(); + public UserAgentService(IConfigSource config) : this(config, null) { } @@ -121,6 +125,12 @@ namespace OpenSim.Services.HypergridService m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); m_UserAccountService = ServerUtils.LoadPlugin(userAccountService, args); + m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0); + + LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed"); + LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions); + LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions); + m_GridName = serverConfig.GetString("ExternalName", string.Empty); if (m_GridName == string.Empty) { @@ -130,10 +140,43 @@ namespace OpenSim.Services.HypergridService if (!m_GridName.EndsWith("/")) m_GridName = m_GridName + "/"; - m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0); } } + protected void LoadTripPermissionsFromConfig(IConfig config, string variable) + { + foreach (string keyName in config.GetKeys()) + { + if (keyName.StartsWith(variable + "_Level_")) + { + int level = 0; + if (Int32.TryParse(keyName.Replace(variable + "_Level_", ""), out level)) + m_ForeignTripsAllowed.Add(level, config.GetBoolean(keyName, true)); + } + } + } + + protected void LoadDomainExceptionsFromConfig(IConfig config, string variable, Dictionary> exceptions) + { + foreach (string keyName in config.GetKeys()) + { + if (keyName.StartsWith(variable + "_Level_")) + { + int level = 0; + if (Int32.TryParse(keyName.Replace(variable + "_Level_", ""), out level) && !exceptions.ContainsKey(level)) + { + exceptions.Add(level, new List()); + string value = config.GetString(keyName, string.Empty); + string[] parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + + foreach (string s in parts) + exceptions[level].Add(s.Trim()); + } + } + } + } + + public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) { position = new Vector3(128, 128, 0); lookAt = Vector3.UnitY; @@ -166,13 +209,39 @@ namespace OpenSim.Services.HypergridService m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); - if (m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID) == null) + string gridName = gatekeeper.ServerURI; + + UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID); + if (account == null) { m_log.WarnFormat("[USER AGENT SERVICE]: Someone attempted to lauch a foreign user from here {0} {1}", agentCircuit.firstname, agentCircuit.lastname); reason = "Forbidden to launch your agents from here"; return false; } + // Is this user allowed to go there? + if (m_GridName != gridName) + { + if (m_ForeignTripsAllowed.ContainsKey(account.UserLevel)) + { + bool allowed = m_ForeignTripsAllowed[account.UserLevel]; + + if (m_ForeignTripsAllowed[account.UserLevel] && IsException(gridName, account.UserLevel, m_TripsAllowedExceptions)) + allowed = false; + + if (!m_ForeignTripsAllowed[account.UserLevel] && IsException(gridName, account.UserLevel, m_TripsDisallowedExceptions)) + allowed = true; + + if (!allowed) + { + reason = "Your world does not allow you to visit the destination"; + m_log.InfoFormat("[USER AGENT SERVICE]: Agents not permitted to visit {0}. Refusing service.", gridName); + return false; + } + } + } + + // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); region.ServerURI = gatekeeper.ServerURI; @@ -189,7 +258,6 @@ namespace OpenSim.Services.HypergridService bool success = false; string myExternalIP = string.Empty; - string gridName = gatekeeper.ServerURI; m_log.DebugFormat("[USER AGENT SERVICE]: this grid: {0}, desired grid: {1}", m_GridName, gridName); @@ -588,6 +656,35 @@ namespace OpenSim.Services.HypergridService else return UUID.Zero; } + + #region Misc + + private bool IsException(string dest, int level, Dictionary> exceptions) + { + if (!exceptions.ContainsKey(level)) + return false; + + bool exception = false; + if (exceptions[level].Count > 0) // we have exceptions + { + string destination = dest; + if (!destination.EndsWith("/")) + destination += "/"; + + if (exceptions[level].Find(delegate(string s) + { + if (!s.EndsWith("/")) + s += "/"; + return s == destination; + }) != null) + exception = true; + } + + return exception; + } + + #endregion + } class TravelingAgentInfo diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 1bafdbd..18094b7 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -428,6 +428,24 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; User level required to be contacted from other grids ;LevelOutsideContacts = 0 + ;; Restrictions on destinations of local users. + ;; Are local users allowed to visit other grids? + ;; What user level? Use variables of this forrm: + ;; ForeignTripsAllowed_Level_ = true | false + ;; (the default is true) + ;; For example: + ; ForeignTripsAllowed_Level_0 = false + ; ForeignTripsAllowed_Level_200 = true ; true is default, no need to say it + ;; + ;; If ForeignTripsAllowed is false, make exceptions using DisallowExcept + ;; Leave blank or commented for no exceptions. + ; DisallowExcept_Level_0 = "http://myothergrid.com:8002, http://boss.com:8002" + ;; + ;; If ForeignTripsAllowed is true, make exceptions using AllowExcept. + ;; Leave blank or commented for no exceptions. + ; AllowExcept_Level_200 = "http://griefer.com:8002, http://enemy.com:8002" + + ; * The interface that local users get when they are in other grids. ; * This restricts the inventory operations while in other grids. ; * Still not completely safe, especially if users perform inventory operations diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index 4339cb1..84de0ec 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -280,5 +280,22 @@ ; Region_Test_1 = "DisallowForeigners" [UserAgentService] - ; User level required to be contacted from other grids + ;; User level required to be contacted from other grids ;LevelOutsideContacts = 0 + + ;; Restrictions on destinations of local users. + ;; Are local users allowed to visit other grids? + ;; What user level? Use variables of this forrm: + ;; ForeignTripsAllowed_Level_ = true | false + ;; (the default is true) + ;; For example: + ; ForeignTripsAllowed_Level_0 = false + ; ForeignTripsAllowed_Level_200 = true ; true is default, no need to say it + ;; + ;; If ForeignTripsAllowed is false, make exceptions using DisallowExcept + ;; Leave blank or commented for no exceptions. + ; DisallowExcept_Level_0 = "http://myothergrid.com:8002, http://boss.com:8002" + ;; + ;; If ForeignTripsAllowed is true, make exceptions using AllowExcept. + ;; Leave blank or commented for no exceptions. + ; AllowExcept_Level_200 = "http://griefer.com:8002, http://enemy.com:8002" -- cgit v1.1 From 772aedc7318209f9c0a2e69ed03b2d8aac4f39ef Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 22 Sep 2012 14:01:07 -0700 Subject: Make BaseHttpServer throws say something useful. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 8c29ad4..d139235 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -636,11 +636,11 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.StackTrace), e); } catch (Exception e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.StackTrace), e); SendHTML500(response); } finally -- cgit v1.1 From 87d810217e2675880bec68891431bd5d422cb1b8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 22 Sep 2012 14:01:51 -0700 Subject: Guard against inventory get failures. --- OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d6ad07e..c74584c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -859,6 +859,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID); item = m_scene.InventoryService.GetItem(item); + if (item == null) + return; + bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); if (changed && m_scene.AvatarFactory != null) { -- cgit v1.1 From 1c4233738123f1bcf3f9b45a527422cb09a43bcc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 22 Sep 2012 14:41:19 -0700 Subject: HG Rez object: warn the user if the item or asset cannot be found. --- .../Framework/InventoryAccess/HGInventoryAccessModule.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index a0cad40..80257bd 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -263,8 +263,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess //} // OK, we're done fetching. Pass it up to the default RezObject - return base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, - RezSelected, RemoveItem, fromTaskID, attachment); + SceneObjectGroup sog = base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, + RezSelected, RemoveItem, fromTaskID, attachment); + + if (sog == null) + remoteClient.SendAgentAlertMessage("Unable to rez: problem accessing inventory or locating assets", false); + + return sog; } -- cgit v1.1