From 82fb737b8d655187b25267efc8b2da368cfe1e9f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 9 Dec 2016 08:20:35 +0000 Subject: HG: add missing information on GetRegion --- OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs index 2d0b2b6..6bd24db 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs @@ -125,6 +125,7 @@ namespace OpenSim.Server.Handlers.Hypergrid hash["hostname"] = regInfo.ExternalHostName; hash["http_port"] = regInfo.HttpPort.ToString(); hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); + hash["server_uri"] = regInfo.ServerURI; } if (message != null) -- cgit v1.1 From 575825193b51d13c6576aabe1bbaf1f3dda1fad8 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Fri, 9 Dec 2016 20:46:27 +0100 Subject: The new string-parameter: "region_object_bonus" for llGetEnv(string name); Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 71e8ca9..7efdc62 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6307,6 +6307,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { return World.RegionInfo.ObjectCapacity.ToString(); } + else if (name == "region_object_bonus") + { + return World.RegionInfo.RegionSettings.ObjectBonus.ToString(); + } else { return ""; -- cgit v1.1 From 66990394c9a60e596cc07c4b547291afd7447133 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 9 Dec 2016 22:56:11 +0000 Subject: avoid a null ref --- OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index d1fe3c7..fb63c6a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -216,7 +216,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // while we don't fix the hard-coded urls if (flags == 2) { - if (regionInfos.Count == 0) + if (regionInfos == null || regionInfos.Count == 0) remoteClient.SendAgentAlertMessage("No regions found with that name.", true); // else if (regionInfos.Count == 1) // remoteClient.SendAgentAlertMessage("Region found!", false); -- cgit v1.1 From a3e2a42f0d7b1e146892de3d5ddb7b5a96df0d4d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 10 Dec 2016 01:00:48 +0000 Subject: HG regions URI need to include also the default ports for compatibility --- OpenSim/Services/GridService/HypergridLinker.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index e00025b..ceb2c6e 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -255,11 +255,8 @@ namespace OpenSim.Services.GridService regionName = parts[2]; } - if(port == 80) - serverURI = "http://"+ host + "/"; - else - serverURI = "http://"+ host +":"+ port.ToString() + "/"; - } + serverURI = "http://"+ host +":"+ port.ToString() + "/"; + } } else { @@ -301,6 +298,10 @@ namespace OpenSim.Services.GridService if(!string.IsNullOrEmpty(regionName)) regionName = regionName.Trim(new char[] { '"', ' ' }); serverURI = uri.AbsoluteUri; + if(uri.Port == 80) + serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; + else if(uri.Port == 443) + serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; return true; } -- cgit v1.1 From f57403909f36fe6cc46d2ee4cc8c9cd59e6aacf3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 10 Dec 2016 02:03:00 +0000 Subject: do not try xbakes on HG --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2cf0e9d..d501b7f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2125,11 +2125,12 @@ namespace OpenSim.Region.Framework.Scenes if (!gotCrossUpdate && !isNPC) Scene.SendLayerData(ControllingClient); - // HG delay - if((m_teleportFlags & TeleportFlags.ViaHGLogin) != 0) + // HG + bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; + if(isHGTP) { - Thread.Sleep(500); - m_log.DebugFormat("[CompleteMovement] HG delay: {0}ms", Util.EnvironmentTickCountSubtract(ts)); +// ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); + m_log.DebugFormat("[CompleteMovement] HG"); } m_previusParcelHide = false; @@ -2151,7 +2152,7 @@ namespace OpenSim.Region.Framework.Scenes cachedbaked = true; else { - if (m_scene.AvatarFactory != null) + if (m_scene.AvatarFactory != null && !isHGTP) cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); // not sure we need this -- cgit v1.1 From d49a5374c37967110a8bf11844893f62951878ee Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Sat, 10 Dec 2016 18:03:05 +0000 Subject: Make it more unlikely that a script teleport will be caught by default region landing point. --- .../Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ad094b4..58d6cf2 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -456,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } // Check Default Location (Also See ScenePresence.CompleteMovement) - if (position.X == 128f && position.Y == 128f) + if (position.X == 128f && position.Y == 128f && position.Z == 22.5f) position = sp.Scene.RegionInfo.DefaultLandingPoint; // TODO: Get proper AVG Height diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d501b7f..463f6c8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2044,7 +2044,7 @@ namespace OpenSim.Region.Framework.Scenes } // Check Default Location (Also See EntityTransferModule.TeleportAgentWithinRegion) - if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f) + if (AbsolutePosition.X == 128f && AbsolutePosition.Y == 128f && AbsolutePosition.Z == 22.5f) AbsolutePosition = Scene.RegionInfo.DefaultLandingPoint; if (!MakeRootAgent(AbsolutePosition, flying, ref look)) -- cgit v1.1 From 5ad8bceb1da94244c7f3b569e0b342b9c386a4aa Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 10 Dec 2016 18:36:10 +0000 Subject: Fix OpenSim bombing when a MySQL connection string doesn't contain a password. Passwordless connection is perfectly legal and makes sense within a container. --- OpenSim/Framework/Util.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 01a06cd..a6fd99f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1685,6 +1685,8 @@ namespace OpenSim.Framework // hide the password in the connection string passPosition = connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase); + if (passPosition == -1) + return connectionString; passPosition = connectionString.IndexOf("=", passPosition); if (passPosition < connectionString.Length) passPosition += 1; -- cgit v1.1 From 5b7986e6beb3d452a2845fa367b26c818098aba5 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Sat, 10 Dec 2016 21:15:22 +0100 Subject: Setting precise date of creation in NPC's profile. Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 1 + OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 7 +++++++ OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 5be8556..7d68299 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1009,7 +1009,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles if (p != null && p.isNPC) { - remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, "5/25/1977", + remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16, UUID.Zero, UUID.Zero, "", UUID.Zero); remoteClient.SendAvatarInterestsReply(avatarID, 0, "", diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index 1310358..dd4226c 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -59,6 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces UUID ActiveGroupId { get; set; } UUID Owner { get; } string profileAbout { get; set; } + string Born { get; set; } } public interface INPCModule diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 1096eae..b904353 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -70,6 +70,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC private readonly UUID m_ownerID; private UUID m_hostGroupID; private string m_profileAbout = ""; + private string m_born; public List SelectedObjects {get; private set;} public NPCAvatar( @@ -611,6 +612,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC set { } } + public string Born + { + get { return m_born; } + set { m_born = value; } + } + public bool IsGroupMember(UUID groupID) { return (m_hostGroupID == groupID); diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 8462661..ced82e6 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -168,6 +168,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC AvatarAppearance appearance) { NPCAvatar npcAvatar = null; + string born = DateTime.UtcNow.ToString(); try { @@ -222,6 +223,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC ScenePresence sp; if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) { + npcAvatar.Born = born; npcAvatar.ActiveGroupId = groupID; sp.CompleteMovement(npcAvatar, false); sp.Grouptitle = groupTitle; -- cgit v1.1 From ba61b64c424abed18052a68955f996d9eb81d9b7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 11 Dec 2016 20:50:17 +0000 Subject: If a region address is resolveable to a single address, resolve it on startup and use that address This change facilitates running opensim within containers and VMs where the external address isn't that of the VM/container but that of the host. --- OpenSim/Framework/RegionInfo.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ca17793..f764a34 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -708,7 +708,11 @@ namespace OpenSim.Framework } else { - m_externalHostName = externalName; + IPAddress[] addrs = Dns.GetHostAddresses(externalName); + if (addrs.Length != 1) // If it is ambiguous or not resolveable, use it literally + m_externalHostName = externalName; + else + m_externalHostName = addrs[0].ToString(); } // RegionType -- cgit v1.1 From 4d1536f1ecde8ed03e1f2e69f45207eb9dddfa7c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 00:07:36 +0000 Subject: Allow OpenSim to respond to Unix signals. This may need work to be properly ignoed on Windows. Windows devs, please test and check for platform flags if this causes issues in Windows --- OpenSim/Region/Application/OpenSim.cs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index cf2bf33..203fe5e 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -26,6 +26,7 @@ */ using System; +using System.Threading; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -74,7 +75,7 @@ namespace OpenSim private string m_timedScript = "disabled"; private int m_timeInterval = 1200; - private Timer m_scriptTimer; + private System.Timers.Timer m_scriptTimer; public OpenSim(IConfigSource configSource) : base(configSource) { @@ -125,6 +126,25 @@ namespace OpenSim m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod); } + private static Mono.Unix.UnixSignal[] signals = new Mono.Unix.UnixSignal[] + { +// new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT), + new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) + }; + + private Thread signal_thread = new Thread (delegate () + { + System.Console.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); + while (true) + { + // Wait for a signal to be delivered + int index = Mono.Unix.UnixSignal.WaitAny (signals, -1); + + //Mono.Unix.Native.Signum signal = signals [index].Signum; + MainConsole.Instance.RunCommand("shutdown"); + } + }); + /// /// Performs initialisation of the scene, such as loading configuration from disk. /// @@ -134,6 +154,7 @@ namespace OpenSim m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); + signal_thread.Start(); //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; @@ -217,7 +238,7 @@ namespace OpenSim // Start timer script (run a script every xx seconds) if (m_timedScript != "disabled") { - m_scriptTimer = new Timer(); + m_scriptTimer = new System.Timers.Timer(); m_scriptTimer.Enabled = true; m_scriptTimer.Interval = m_timeInterval*1000; m_scriptTimer.Elapsed += RunAutoTimerScript; -- cgit v1.1 From da2c1e8aadd3de2821e1aa1e002259876077d271 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 12 Dec 2016 00:54:41 +0000 Subject: don't do unix signals on windows --- OpenSim/Region/Application/OpenSim.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 203fe5e..aba09e0 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -126,11 +126,8 @@ namespace OpenSim m_log.Info("[OPENSIM MAIN]: Using async_call_method " + Util.FireAndForgetMethod); } - private static Mono.Unix.UnixSignal[] signals = new Mono.Unix.UnixSignal[] - { -// new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT), - new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) - }; + private static Mono.Unix.UnixSignal[] signals; + private Thread signal_thread = new Thread (delegate () { @@ -154,7 +151,16 @@ namespace OpenSim m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); - signal_thread.Start(); + if(!Util.IsWindows()) + { + // linux mac os specifics + signals = new Mono.Unix.UnixSignal[] + { +// new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT), + new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) + }; + signal_thread.Start(); + } //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; -- cgit v1.1 From cdfdf6322defc614a1261a38c710bf3f73cd4dc7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 09:26:12 +0000 Subject: Applying a modified version of TomTheDragon's patch to prevent the sim from crashing when signals are unavailable. --- OpenSim/Region/Application/OpenSim.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index aba09e0..3cb999b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -131,7 +131,6 @@ namespace OpenSim private Thread signal_thread = new Thread (delegate () { - System.Console.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); while (true) { // Wait for a signal to be delivered @@ -153,13 +152,21 @@ namespace OpenSim if(!Util.IsWindows()) { - // linux mac os specifics - signals = new Mono.Unix.UnixSignal[] + try { -// new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT), - new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) - }; - signal_thread.Start(); + // linux mac os specifics + signals = new Mono.Unix.UnixSignal[] + { + new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) + }; + signal_thread.Start(); + } + catch (Exception e) + { + m_log.Info("Could not set up UNIX signal handlers. SIGTERM will not"); + m_log.InfoFormat("shut down gracefully: {0}", e.Message); + m_log.Debug("Exception was: ", e); + } } //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx -- cgit v1.1 From 9ef9dde0f3ea9185bb9aca03d173e5312e1ba308 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 10:08:31 +0000 Subject: Make resolving the IP on startup optional. Adds ResolveAddress boolean to regions.ini --- OpenSim/Framework/RegionInfo.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index f764a34..d7a51ec 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -147,6 +147,7 @@ namespace OpenSim.Framework public string RemotingAddress; public UUID ScopeID = UUID.Zero; private UUID m_maptileStaticUUID = UUID.Zero; + private bool m_resolveAddress = false; public uint WorldLocX = 0; public uint WorldLocY = 0; @@ -686,6 +687,20 @@ namespace OpenSim.Framework config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); } + // ResolveAddress + // + allKeys.Remove("ResolveAddress"); + if (config.Contains("ResolveAddress")) + { + m_resolveAddress = config.GetBoolean("ResolveAddress", false); + } + else + { + m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False")); + + config.Set("ResolveAddress", m_resolveAddress.ToString()); + } + // ExternalHostName // allKeys.Remove("ExternalHostName"); @@ -706,6 +721,10 @@ namespace OpenSim.Framework "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", m_externalHostName, name); } + else if (!m_resolveAddress) + { + m_externalHostName = externalName; + } else { IPAddress[] addrs = Dns.GetHostAddresses(externalName); -- cgit v1.1 From bebfbd0600671a34e87303dc6ba34e994182f993 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 10:14:16 +0000 Subject: Only ask for the new parameter when starting from scratch. It is set to false implicitly on existing regions. --- OpenSim/Framework/RegionInfo.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index d7a51ec..adffe13 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -545,7 +545,7 @@ namespace OpenSim.Framework private void ReadNiniConfig(IConfigSource source, string name) { -// bool creatingNew = false; + bool creatingNew = false; if (source.Configs.Count == 0) { @@ -569,7 +569,7 @@ namespace OpenSim.Framework source.AddConfig(name); -// creatingNew = true; + creatingNew = true; } if (name == String.Empty) @@ -696,7 +696,8 @@ namespace OpenSim.Framework } else { - m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False")); + if (creatingNew) + m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False")); config.Set("ResolveAddress", m_resolveAddress.ToString()); } -- cgit v1.1 From 1388ac2ef7d774b4d25f18d237fdad89d7ac43ac Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 11:09:38 +0000 Subject: Rename charterMember to membershipType to show what it actually is. This field started out as a simple flag in the protocol to indicate a user being a SL charter member. It has since then taken on additional functionality that means that the name is no longer appropriate. --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 4 ++-- .../Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | 4 ++-- .../CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 12 ++++++------ .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | 8 ++++---- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f1290b9..c4de81e 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1293,7 +1293,7 @@ namespace OpenSim.Framework void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks); void SendViewerTime(int phase); - void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout, + void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID); void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ce7ee98..a69b670 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2704,7 +2704,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(packet, ThrottleOutPacketType.Task); } - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) { @@ -2716,7 +2716,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP else avatarReply.PropertiesData.AboutText = Utils.EmptyBytes; avatarReply.PropertiesData.BornOn = Util.StringToBytes256(bornOn); - avatarReply.PropertiesData.CharterMember = charterMember; + avatarReply.PropertiesData.CharterMember = membershipType; if (flAbout != null) avatarReply.PropertiesData.FLAboutText = Util.StringToBytes256(flAbout); else diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index 2bb24ae..0b1dbc7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs @@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile name = account.FirstName + " " + account.LastName; created = account.Created; } - Byte[] charterMember = Utils.StringToBytes(name); + Byte[] membershipType = Utils.StringToBytes(name); profileUrl = "No profile data"; aboutText = string.Empty; @@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile remoteClient.SendAvatarProperties(avatarID, aboutText, Util.ToDateTime(created).ToString( "M/d/yyyy", CultureInfo.InvariantCulture), - charterMember, firstLifeAboutText, + membershipType, firstLifeAboutText, (uint)(0 & 0xff), firstLifeImage, image, profileUrl, partner); diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 7d68299..ce5816b 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1032,7 +1032,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles userInfo = new Dictionary(); } - Byte[] charterMember = new Byte[1]; + Byte[] membershipType = new Byte[1]; string born = String.Empty; uint flags = 0x00; @@ -1040,11 +1040,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { if (account.UserTitle == "") { - charterMember[0] = (Byte)((account.UserFlags & 0xf00) >> 8); + membershipType[0] = (Byte)((account.UserFlags & 0xf00) >> 8); } else { - charterMember = Utils.StringToBytes(account.UserTitle); + membershipType = Utils.StringToBytes(account.UserTitle); } born = Util.ToDateTime(account.Created).ToString( @@ -1057,11 +1057,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { if ((string)userInfo["user_title"] == "") { - charterMember[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8); + membershipType[0] = (Byte)(((Byte)userInfo["user_flags"] & 0xf00) >> 8); } else { - charterMember = Utils.StringToBytes((string)userInfo["user_title"]); + membershipType = Utils.StringToBytes((string)userInfo["user_title"]); } int val_born = (int)userInfo["user_created"]; @@ -1085,7 +1085,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles return; } - remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, charterMember , props.FirstLifeText, flags, + remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags, props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 15d31bd..8b8ebe0 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1247,7 +1247,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) { } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index b904353..a929e80 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -981,7 +981,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) { diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index 8fc766d..17f4fc6 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs @@ -308,11 +308,11 @@ namespace OpenSim.Services.Connectors.SimianGrid about = new OSDMap(0); // Check if this user is a grid operator - byte[] charterMember; + byte[] membershipType; if (user["AccessLevel"].AsInteger() >= 200) - charterMember = Utils.StringToBytes("Operator"); + membershipType = Utils.StringToBytes("Operator"); else - charterMember = Utils.EmptyBytes; + membershipType = Utils.EmptyBytes; // Check if the user is online if (client.Scene is Scene) @@ -327,7 +327,7 @@ namespace OpenSim.Services.Connectors.SimianGrid flags |= ProfileFlags.Identified; client.SendAvatarProperties(avatarID, about["About"].AsString(), user["CreationDate"].AsDate().ToString("M/d/yyyy", - System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, + System.Globalization.CultureInfo.InvariantCulture), membershipType, about["FLAbout"].AsString(), (uint)flags, about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); OSDMap interests = null; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9251c4f..f407e5a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -990,7 +990,7 @@ namespace OpenSim.Tests.Common { } - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) { -- cgit v1.1 From fe3303dc110b4932717031278d64ab2e6900e99b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 12 Dec 2016 17:53:40 +0000 Subject: ubOde simple spheres and boxes with type convex have no holes on physics(long forgotten fix) --- .../Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index a977473..5a3008d 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs @@ -239,7 +239,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_scene.haveActor(repData.actor)) { - if (needsMeshing(repData.pbs)) // no need for pbs now? + if (needsMeshing(repData)) // no need for pbs now? { repData.comand = meshWorkerCmnds.changefull; createqueue.Enqueue(repData); @@ -284,8 +284,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde /// /// /// - public bool needsMeshing(PrimitiveBaseShape pbs) + public bool needsMeshing(ODEPhysRepData repData) { + PrimitiveBaseShape pbs = repData.pbs; // check sculpts or meshs if (pbs.SculptEntry) { @@ -301,6 +302,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (forceSimplePrimMeshing) return true; + // convex shapes have no holes + ushort profilehollow = pbs.ProfileHollow; + if(repData.shapetype == 2) + profilehollow = 0; + // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) @@ -309,7 +315,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 - && pbs.ProfileHollow == 0 + && profilehollow == 0 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 && pbs.PathBegin == 0 && pbs.PathEnd == 0 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0 @@ -326,7 +332,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int iPropertiesNotSupportedDefault = 0; - if (pbs.ProfileHollow != 0) + if (profilehollow != 0) iPropertiesNotSupportedDefault++; if ((pbs.PathBegin != 0) || pbs.PathEnd != 0) @@ -407,7 +413,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde PhysicsActor actor = repData.actor; PrimitiveBaseShape pbs = repData.pbs; - if (!needsMeshing(pbs)) + if (!needsMeshing(repData)) { repData.meshState = MeshState.noNeed; repData.hasOBB = false; @@ -417,16 +423,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde IMesh mesh = null; Vector3 size = repData.size; - byte shapetype = repData.shapetype; - - bool convex; int clod = (int)LevelOfDetail.High; + bool convex; + byte shapetype = repData.shapetype; if (shapetype == 0) convex = false; else { convex = true; + // sculpts pseudo convex if (pbs.SculptType != (byte)SculptType.Mesh) clod = (int)LevelOfDetail.Low; } @@ -483,7 +489,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde repData.mesh = null; repData.hasOBB = false; - if (!needsMeshing(pbs)) + if (!needsMeshing(repData)) { repData.meshState = MeshState.noNeed; return; -- cgit v1.1 From 7d8cb244d1148d70b43c51add04e095bd1160cd7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 12 Dec 2016 19:16:51 +0000 Subject: ubOde other convex type objects other than mesh and sculpt also don't have holes --- OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 2 +- OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index 5a3008d..bb661e5 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs @@ -433,7 +433,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { convex = true; // sculpts pseudo convex - if (pbs.SculptType != (byte)SculptType.Mesh) + if (pbs.SculptEntry && pbs.SculptType != (byte)SculptType.Mesh) clod = (int)LevelOfDetail.Low; } diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 2ae0881..7f0713a 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -349,7 +349,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } else { - if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, lod, out coords, out faces)) + if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, lod, convex, out coords, out faces)) return null; } @@ -942,7 +942,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing /// Faces are added to this list by the method. /// true if coords and faces were successfully generated, false if not private bool GenerateCoordsAndFacesFromPrimShapeData( - string primName, PrimitiveBaseShape primShape, float lod, out List coords, out List faces) + string primName, PrimitiveBaseShape primShape, float lod, bool convex, + out List coords, out List faces) { PrimMesh primMesh; coords = new List(); @@ -970,7 +971,9 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing profileBegin = profileEnd - 0.02f; float profileHollow = (float)primShape.ProfileHollow * 2.0e-5f; - if (profileHollow > 0.95f) + if(convex) + profileHollow = 0.0f; + else if (profileHollow > 0.95f) profileHollow = 0.95f; int sides = 4; -- cgit v1.1 From ee58beddece251f58e3befb0b6aa7f78d5ab372b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 13 Dec 2016 14:43:10 +0000 Subject: Make sure sims on Linux can be restarted without waiting on a 2 mintue socket timeout --- OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 4d726b4..fffd02c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -217,10 +217,6 @@ namespace OpenMetaverse SocketType.Dgram, ProtocolType.Udp); - // OpenSim may need this but in AVN, this messes up automated - // sim restarts badly - //m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); - try { if (m_udpSocket.Ttl < 128) @@ -248,7 +244,13 @@ namespace OpenMetaverse // we never want two regions to listen on the same port as they cannot demultiplex each other's messages, // leading to a confusing bug. // By default, Windows does not allow two sockets to bind to the same port. - m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); + // + // Unfortunately, this also causes a crashed sim to leave the socket in a state + // where it appears to be in use but is really just hung from the old process + // crashing rather than closing it. While this protects agains misconfiguration, + // allowing crashed sims to be started up again right away, rather than having to + // wait 2 minutes for the socket to clear is more valuable. Commented 12/13/2016 + // m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); if (recvBufferSize != 0) m_udpSocket.ReceiveBufferSize = recvBufferSize; -- cgit v1.1 From 69776aa70ce662ccd0ad3d9f2ecefb86671bbcb3 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 13 Dec 2016 19:47:26 +0000 Subject: Remove the AllowAlternatePorts option. It wasn't implemented anyway. Instead, handle the port being 0 as "any port" and assign a random port for regions in that case. --- OpenSim/Framework/RegionInfo.cs | 34 ++-------------------- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 11 ++++--- .../ClientStack/Linden/UDP/OpenSimUDPBase.cs | 8 +++++ OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs | 4 +-- OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | 4 +-- 5 files changed, 21 insertions(+), 40 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index adffe13..8f754a5 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -138,8 +138,6 @@ namespace OpenSim.Framework protected uint m_httpPort; protected string m_serverURI; protected string m_regionName = String.Empty; - protected bool Allow_Alternate_Ports; - public bool m_allow_alternate_ports; protected string m_externalHostName; protected IPEndPoint m_internalEndPoint; protected uint m_remotingPort; @@ -673,20 +671,6 @@ namespace OpenSim.Framework } m_internalEndPoint = new IPEndPoint(address, port); - // AllowAlternatePorts - // - allKeys.Remove("AllowAlternatePorts"); - if (config.Contains("AllowAlternatePorts")) - { - m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true); - } - else - { - m_allow_alternate_ports = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Allow alternate ports", "False")); - - config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); - } - // ResolveAddress // allKeys.Remove("ResolveAddress"); @@ -925,8 +909,6 @@ namespace OpenSim.Framework config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); config.Set("InternalPort", m_internalEndPoint.Port); - config.Set("AllowAlternatePorts", m_allow_alternate_ports.ToString()); - config.Set("ExternalHostName", m_externalHostName); if (m_nonphysPrimMin > 0) @@ -1019,10 +1001,6 @@ namespace OpenSim.Framework configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", m_internalEndPoint.Port.ToString(), true); - configMember.addConfigurationOption("allow_alternate_ports", - ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Allow sim to find alternate UDP ports when ports are in use?", - m_allow_alternate_ports.ToString(), true); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", m_externalHostName, true); @@ -1092,9 +1070,6 @@ namespace OpenSim.Framework configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", ConfigSettings.DefaultRegionHttpPort.ToString(), false); - configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Allow sim to find alternate UDP ports when ports are in use?", - "false", true); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); @@ -1165,9 +1140,6 @@ namespace OpenSim.Framework case "internal_ip_port": m_internalEndPoint.Port = (int) configuration_result; break; - case "allow_alternate_ports": - m_allow_alternate_ports = (bool) configuration_result; - break; case "external_host_name": if ((string) configuration_result != "SYSTEMIP") { @@ -1244,7 +1216,6 @@ namespace OpenSim.Framework if ((RemotingAddress != null) && !RemotingAddress.Equals("")) args["remoting_address"] = OSD.FromString(RemotingAddress); args["remoting_port"] = OSD.FromString(RemotingPort.ToString()); - args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports); if ((proxyUrl != null) && !proxyUrl.Equals("")) args["proxy_url"] = OSD.FromString(proxyUrl); if (RegionType != String.Empty) @@ -1299,8 +1270,6 @@ namespace OpenSim.Framework RemotingAddress = args["remoting_address"].AsString(); if (args["remoting_port"] != null) UInt32.TryParse(args["remoting_port"].AsString(), out m_remotingPort); - if (args["allow_alt_ports"] != null) - m_allow_alternate_ports = args["allow_alt_ports"].AsBoolean(); if (args["proxy_url"] != null) proxyUrl = args["proxy_url"].AsString(); if (args["region_type"] != null) @@ -1338,7 +1307,8 @@ namespace OpenSim.Framework kvp["http_port"] = HttpPort.ToString(); kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); kvp["internal_port"] = InternalEndPoint.Port.ToString(); - kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); + // TODO: Remove in next major version + kvp["alternate_ports"] = "False"; kvp["server_uri"] = ServerURI; return kvp; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index a868e3a..cedb9b4 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP uint port = (uint)scene.RegionInfo.InternalEndPoint.Port; IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address; - Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler); + Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, m_Config, scene.AuthenticateHandler); scene.RegionInfo.InternalEndPoint.Port = (int)port; AddScene(scene); @@ -98,9 +98,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) + public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager) { - m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); + m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager); } public virtual void AddScene(IScene scene) @@ -430,12 +430,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP public JobEngine OqrEngine { get; protected set; } public LLUDPServer( - IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, + IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager) : base(listenIP, (int)port) { #region Environment.TickCount Measurement + // Update the port with the one we actually got + port = (uint)Port; + // Measure the resolution of Environment.TickCount TickCountResolution = 0f; for (int i = 0; i < 10; i++) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index fffd02c..831381e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -107,6 +107,11 @@ namespace OpenMetaverse /// public float AverageReceiveTicksForLastSamplePeriod { get; private set; } + public int Port + { + get { return m_udpPort; } + } + #region PacketDropDebugging /// /// For debugging purposes only... random number generator for dropping @@ -257,6 +262,9 @@ namespace OpenMetaverse m_udpSocket.Bind(ipep); + if (m_udpPort == 0) + m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port; + IsRunningInbound = true; // kick off an async receive. The Start() method will return, the diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs index 33cd8a2..df9f6f2 100644 --- a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs @@ -86,10 +86,10 @@ namespace OpenSim.Tests.Common uint port = 0; AgentCircuitManager acm = scene.AuthenticateHandler; - TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm); + TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, configSource, acm); udpServer.AddScene(scene); return udpServer; } } -} \ No newline at end of file +} diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs index 26887c9..b2c6a8c 100644 --- a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs @@ -43,8 +43,8 @@ namespace OpenSim.Tests.Common { public List PacketsSent { get; private set; } - public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) - : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) + public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager) + : base(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager) { PacketsSent = new List(); } -- cgit v1.1 From ec883d0f1504e8573f763882231cb1da06bdc2a1 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Wed, 14 Dec 2016 01:14:23 +0100 Subject: New OSSL function: osNpcSetProfileImage(LSL_Key npc, string image); This patch gives possibility to set image in created NPC's profile. You can use UUID of the texture or name of texture included in prim's inventory. Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Avatar/UserProfiles/UserProfileModule.cs | 2 +- OpenSim/Region/Framework/Interfaces/INPCModule.cs | 1 + .../Region/OptionalModules/World/NPC/NPCAvatar.cs | 8 ++++++ .../Shared/Api/Implementation/OSSL_Api.cs | 29 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 ++++ 6 files changed, 45 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index ce5816b..5314927 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1011,7 +1011,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 16, - UUID.Zero, UUID.Zero, "", UUID.Zero); + UUID.Zero, ((INPC)(p.ControllingClient)).profileImage, "", UUID.Zero); remoteClient.SendAvatarInterestsReply(avatarID, 0, "", 0, "Getting into trouble", "Droidspeak"); return; diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index dd4226c..813be4f 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs @@ -59,6 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces UUID ActiveGroupId { get; set; } UUID Owner { get; } string profileAbout { get; set; } + UUID profileImage { get; set; } string Born { get; set; } } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index a929e80..0cabe47 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -70,6 +70,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC private readonly UUID m_ownerID; private UUID m_hostGroupID; private string m_profileAbout = ""; + private UUID m_profileImage = UUID.Zero; private string m_born; public List SelectedObjects {get; private set;} @@ -110,6 +111,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC m_profileAbout = value; } } + + public UUID profileImage + { + get { return m_profileImage; } + set { m_profileImage = value; } + } + public IScene Scene { get { return m_scene; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b101cf9..dd4da0a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void osNpcSetProfileImage(LSL_Key npc, string image) + { + CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + m_host.AddScriptLPS(1); + + INPCModule module = World.RequestModuleInterface(); + if (module != null) + { + UUID npcId = new UUID(npc.m_string); + + if (!module.CheckPermissions(npcId, m_host.OwnerID)) + return; + + UUID ImageID = new UUID(); + + ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture); + + if (ImageID == null || ImageID == UUID.Zero) + { + if (!UUID.TryParse(image, out ImageID)) + return; + } + + ScenePresence sp = World.GetScenePresence(npcId); + if (sp != null) + ((INPC)(sp.ControllingClient)).profileImage = ImageID; + } + } + public void osNpcSay(LSL_Key npc, string message) { osNpcSay(npc, 0, message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 87b0967..cf3e6df 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -344,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osNpcSetRot(LSL_Key npc, rotation rot); void osNpcStopMoveToTarget(LSL_Key npc); void osNpcSetProfileAbout(LSL_Key npc, string about); + void osNpcSetProfileImage(LSL_Key npc, string image); void osNpcSay(key npc, string message); void osNpcSay(key npc, int channel, string message); void osNpcShout(key npc, int channel, string message); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 5bc998e..2e8a76c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -642,6 +642,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osNpcSetProfileAbout(npc, about); } + public void osNpcSetProfileImage(LSL_Key npc, string image) + { + m_OSSL_Functions.osNpcSetProfileImage(npc, image); + } + public void osNpcSay(key npc, string message) { m_OSSL_Functions.osNpcSay(npc, message); -- cgit v1.1 From a75c16e1bfee8679f61e513426e876635b3345cf Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 14 Dec 2016 01:00:48 +0000 Subject: Fox threat level line on SetProfileImage. It is ALWAYS the name of the function! Low is justified because setting an image requires having a NPC in the first place.... --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index dd4da0a..a827e30 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3020,7 +3020,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileImage(LSL_Key npc, string image) { - CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1 From 1c08b3d8f9e10ba11b70e99a92b7ca1272079a94 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 01:16:21 +0000 Subject: also fox chekc threat level on osNpcSetProfileAbout --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a827e30..bdecf72 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3001,7 +3001,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { - CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); + CheckThreatLevel(ThreatLevel.High, "osNpcSetProfileAbout"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1 From 1ffc81c8690b039a578155fb76bbbd2307ae3ebc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 01:31:16 +0000 Subject: also reduce check threat level of osNpcSetProfileAbout to Low; update osslEnable.ini --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bdecf72..9742119 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3001,7 +3001,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osNpcSetProfileAbout(LSL_Key npc, string about) { - CheckThreatLevel(ThreatLevel.High, "osNpcSetProfileAbout"); + CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout"); m_host.AddScriptLPS(1); INPCModule module = World.RequestModuleInterface(); -- cgit v1.1 From 364d58635ba4479d4eb267a4b021cc2be211bbde Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 03:02:57 +0000 Subject: avoid a null ref --- OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs index 5c791e6..eb2867d 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs @@ -268,8 +268,12 @@ namespace OpenSim.Region.DataSnapshot.Providers { XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, userOwnerUUID); - username.InnerText = account.FirstName + " " + account.LastName; + if(account != null) + username.InnerText = account.FirstName + " " + account.LastName; + else + username.InnerText = "UnKnown"; userblock.AppendChild(username); + } catch (Exception) { -- cgit v1.1 From 50842347ace4f9ada316364d08ccc0675901f84b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Dec 2016 04:00:48 +0000 Subject: fix: check for region_handle before region_id, viewers are so funny.. --- .../CoreModules/World/Land/LandManagementModule.cs | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 98f1f3b..bec5322 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -72,8 +72,6 @@ namespace OpenSim.Region.CoreModules.World.Land public const int LandUnit = 4; - private static readonly string remoteParcelRequestPath = "0009/"; - private LandChannel landChannel; private Scene m_scene; @@ -1682,12 +1680,13 @@ namespace OpenSim.Region.CoreModules.World.Land private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) { + //string capsBase = "/CAPS/" + UUID.Random(); string capsBase = "/CAPS/" + caps.CapsObjectPath; caps.RegisterHandler( "RemoteParcelRequest", new RestStreamHandler( "POST", - capsBase + remoteParcelRequestPath, + capsBase, (request, path, param, httpRequest, httpResponse) => RemoteParcelRequest(request, path, param, agentID, caps), "RemoteParcelRequest", @@ -1807,24 +1806,7 @@ namespace OpenSim.Region.CoreModules.World.Land ArrayList list = (ArrayList)hash["location"]; uint x = (uint)(double)list[0]; uint y = (uint)(double)list[1]; - if(hash.ContainsKey("region_id")) - { - UUID regionID = (UUID)hash["region_id"]; - if (regionID == m_scene.RegionInfo.RegionID) - { - // a parcel request for a local parcel => no need to query the grid - parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); - } - else - { - // a parcel request for a parcel in another region. Ask the grid about the region - GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID); - if (info != null) - parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); - } - } - - else if (hash.ContainsKey("region_handle")) + if (hash.ContainsKey("region_handle")) { // if you do a "About Landmark" on a landmark a second time, the viewer sends the // region_handle it got earlier via RegionHandleRequest @@ -1847,6 +1829,24 @@ namespace OpenSim.Region.CoreModules.World.Land } } } + else if(hash.ContainsKey("region_id")) + { + UUID regionID = (UUID)hash["region_id"]; + if (regionID == m_scene.RegionInfo.RegionID) + { + // a parcel request for a local parcel => no need to query the grid + parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); + } + else + { + // a parcel request for a parcel in another region. Ask the grid about the region + GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID); + if (info != null) + parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); + } + } + + } } catch (LLSD.LLSDParseException e) -- cgit v1.1