From 1b81a2bd49beda587e805281e9e0b28dce033310 Mon Sep 17 00:00:00 2001 From: ubit Date: Sun, 15 Jul 2012 23:54:24 +0200 Subject: to stash --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index bd8273d..c64b5f2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -710,7 +710,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP IClientAPI client; if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView)) { -// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); + m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); return; } @@ -718,7 +718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (!udpClient.IsConnected) { -// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet for a unConnected client in " + m_scene.RegionInfo.RegionName); + m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet for a unConnected client in " + m_scene.RegionInfo.RegionName); return; } -- cgit v1.1 From 5c145aa539b8190be994873a1bb9f32bfacdaa77 Mon Sep 17 00:00:00 2001 From: ubit Date: Mon, 16 Jul 2012 00:43:35 +0200 Subject: merge fix --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 9b9ccba..a7740b9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -726,15 +726,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If this is a pending connection, enqueue, don't process yet lock (m_pendingCache) { -<<<<<<< HEAD -<<<<<<< HEAD - m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); -======= - lock (m_pendingCache) -======= Queue queue; if (m_pendingCache.TryGetValue(address, out queue)) ->>>>>>> 15a1ad393c3748c5c911beac981945a9bd8b200d { //m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type); queue.Enqueue(buffer); @@ -742,18 +735,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } -<<<<<<< HEAD -<<<<<<< HEAD -// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); ->>>>>>> 2606484e45138adef289386509b1e27552a32aee -======= ->>>>>>> 0baa1b557af20af3590737dc04294a9bdc8e8728 -======= // Determine which agent this packet came from if (client == null || !(client is LLClientView)) { //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); ->>>>>>> 15a1ad393c3748c5c911beac981945a9bd8b200d return; } -- cgit v1.1 From 51e05dcb5be80bc93061443072fd5587f83052e6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Apr 2013 01:37:18 +0200 Subject: Gods module cleanup --- OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 9fa9be1..d2e71a7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -67,9 +67,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods protected Scene m_scene; protected IDialogModule m_dialogModule; - protected Dictionary m_capsDict = - new Dictionary(); - protected IDialogModule DialogModule { get @@ -91,7 +88,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += SubscribeToClientEvents; m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; - m_scene.EventManager.OnClientClosed += OnClientClosed; scene.EventManager.OnIncomingInstantMessage += OnIncomingInstantMessage; } @@ -127,15 +123,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods client.OnRequestGodlikePowers -= RequestGodlikePowers; } - private void OnClientClosed(UUID agentID, Scene scene) - { - m_capsDict.Remove(agentID); - } - private void OnRegisterCaps(UUID agentID, Caps caps) { string uri = "/CAPS/" + UUID.Random(); - m_capsDict[agentID] = uri; caps.RegisterHandler("UntrustedSimulatorMessage", new RestStreamHandler("POST", uri, -- cgit v1.1 From e39156c6569b10d48b0005b271f103387e16f527 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Apr 2013 01:38:21 +0200 Subject: Send 503 when throttling textures --- .../ClientStack/Linden/Caps/GetTextureModule.cs | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index d4dbfb9..a42c96c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs @@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden public PollServiceTextureEventArgs thepoll; public UUID reqID; public Hashtable request; + public bool send503; } public class aPollResponse @@ -244,7 +245,19 @@ namespace OpenSim.Region.ClientStack.Linden reqinfo.thepoll = this; reqinfo.reqID = x; reqinfo.request = y; + reqinfo.send503 = false; + lock (responses) + { + if (responses.Count > 0) + { + if (m_queue.Count >= 4) + { + // Never allow more than 4 fetches to wait + reqinfo.send503 = true; + } + } + } m_queue.Enqueue(reqinfo); }; @@ -276,6 +289,22 @@ namespace OpenSim.Region.ClientStack.Linden UUID requestID = requestinfo.reqID; + if (requestinfo.send503) + { + response = new Hashtable(); + + response["int_response_code"] = 503; + response["str_response_string"] = "Throttled"; + response["content_type"] = "text/plain"; + response["keepalive"] = false; + response["reusecontext"] = false; + + lock (responses) + responses[requestID] = new aPollResponse() {bytes = 0, response = response}; + + return; + } + // If the avatar is gone, don't bother to get the texture if (m_scene.GetScenePresence(Id) == null) { @@ -385,6 +414,9 @@ namespace OpenSim.Region.ClientStack.Linden GetTextureModule.aPollResponse response; if (responses.TryGetValue(key, out response)) { + // This is any error response + if (response.bytes == 0) + return true; // Normal if (BytesSent + response.bytes <= ThrottleBytes) @@ -411,12 +443,12 @@ namespace OpenSim.Region.ClientStack.Linden return haskey; } + public void ProcessTime() { PassTime(); } - private void PassTime() { currenttime = Util.EnvironmentTickCount(); -- cgit v1.1 From 3934b779b811cc0c6331127f03212d9bbcdc2ce9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Apr 2013 01:39:22 +0200 Subject: Adding the dynamic menu module which allows registering new menu options in compliant viewers --- .../Framework/Interfaces/IDynamicMenuModule.cs | 57 +++++ .../ViewerSupport/DynamicMenuModule.cs | 282 +++++++++++++++++++++ 2 files changed, 339 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs create mode 100644 OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs new file mode 100644 index 0000000..08b71e4 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs @@ -0,0 +1,57 @@ +/* + * 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.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Region.Framework.Interfaces +{ + public enum InsertLocation : int + { + Agent = 1, + World = 2, + Tools = 3, + Advanced = 4, + Admin = 5 + } + + public enum UserMode : int + { + Normal = 0, + God = 3 + } + + public delegate void CustomMenuHandler(string action, UUID agentID, List selection); + + public interface IDynamicMenuModule + { + void AddMenuItem(UUID agentID, string title, InsertLocation location, UserMode mode, CustomMenuHandler handler); + void AddMenuItem(string title, InsertLocation location, UserMode mode, CustomMenuHandler handler); + void RemoveMenuItem(string action); + } +} diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs new file mode 100644 index 0000000..917911f --- /dev/null +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs @@ -0,0 +1,282 @@ +// ****************************************************************** +// Copyright (c) 2008, 2009 Melanie Thielker +// +// All rights reserved +// + +using System; +using System.IO; +using System.Reflection; +using System.Text; +using System.Collections.Generic; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim; +using OpenSim.Region; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Framework; +//using OpenSim.Framework.Capabilities; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using Nini.Config; +using log4net; +using Mono.Addins; +using Caps = OpenSim.Framework.Capabilities.Caps; +using OSDMap = OpenMetaverse.StructuredData.OSDMap; + +namespace OpenSim.Region.OptionalModules.ViewerSupport +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicMenu")] + public class DynamicMenuModule : INonSharedRegionModule, IDynamicMenuModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private class MenuItemData + { + public string Title; + public UUID AgentID; + public InsertLocation Location; + public UserMode Mode; + public CustomMenuHandler Handler; + } + + private Dictionary> m_menuItems = + new Dictionary>(); + + private Scene m_scene; + + public string Name + { + get { return "DynamicMenuModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource config) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + scene.EventManager.OnRegisterCaps += OnRegisterCaps; + m_scene.RegisterModuleInterface(this); + } + + public void RegionLoaded(Scene scene) + { + ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface(); + + if (featuresModule != null) + featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; + } + + public void RemoveRegion(Scene scene) + { + } + + private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) + { + OSD menus = new OSDMap(); + if (features.ContainsKey("menus")) + menus = features["menus"]; + + OSDMap agent = new OSDMap(); + OSDMap world = new OSDMap(); + OSDMap tools = new OSDMap(); + OSDMap advanced = new OSDMap(); + OSDMap admin = new OSDMap(); + if (((OSDMap)menus).ContainsKey("agent")) + agent = (OSDMap)((OSDMap)menus)["agent"]; + if (((OSDMap)menus).ContainsKey("world")) + world = (OSDMap)((OSDMap)menus)["world"]; + if (((OSDMap)menus).ContainsKey("tools")) + tools = (OSDMap)((OSDMap)menus)["tools"]; + if (((OSDMap)menus).ContainsKey("advanced")) + advanced = (OSDMap)((OSDMap)menus)["advanced"]; + if (((OSDMap)menus).ContainsKey("admin")) + admin = (OSDMap)((OSDMap)menus)["admin"]; + + if (m_menuItems.ContainsKey(UUID.Zero)) + { + foreach (MenuItemData d in m_menuItems[UUID.Zero]) + { + if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) + continue; + + OSDMap loc = null; + switch (d.Location) + { + case InsertLocation.Agent: + loc = agent; + break; + case InsertLocation.World: + loc = world; + break; + case InsertLocation.Tools: + loc = tools; + break; + case InsertLocation.Advanced: + loc = advanced; + break; + case InsertLocation.Admin: + loc = admin; + break; + } + + if (loc == null) + continue; + + loc[d.Title] = OSD.FromString(d.Title); + } + } + + if (m_menuItems.ContainsKey(agentID)) + { + foreach (MenuItemData d in m_menuItems[agentID]) + { + if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) + continue; + + OSDMap loc = null; + switch (d.Location) + { + case InsertLocation.Agent: + loc = agent; + break; + case InsertLocation.World: + loc = world; + break; + case InsertLocation.Tools: + loc = tools; + break; + case InsertLocation.Advanced: + loc = advanced; + break; + case InsertLocation.Admin: + loc = admin; + break; + } + + if (loc == null) + continue; + + loc[d.Title] = OSD.FromString(d.Title); + } + } + + + ((OSDMap)menus)["agent"] = agent; + ((OSDMap)menus)["world"] = world; + ((OSDMap)menus)["tools"] = tools; + ((OSDMap)menus)["advanced"] = advanced; + ((OSDMap)menus)["admin"] = admin; + + features["menus"] = menus; + } + + private void OnRegisterCaps(UUID agentID, Caps caps) + { + string capUrl = "/CAPS/" + UUID.Random() + "/"; + + capUrl = "/CAPS/" + UUID.Random() + "/"; + caps.RegisterHandler("CustomMenuAction", new MenuActionHandler(capUrl, "CustomMenuAction", agentID, this, m_scene)); + } + + internal void HandleMenuSelection(string action, UUID agentID, List selection) + { + if (m_menuItems.ContainsKey(agentID)) + { + foreach (MenuItemData d in m_menuItems[agentID]) + { + if (d.Title == action) + d.Handler(action, agentID, selection); + } + } + + if (m_menuItems.ContainsKey(UUID.Zero)) + { + foreach (MenuItemData d in m_menuItems[UUID.Zero]) + { + if (d.Title == action) + d.Handler(action, agentID, selection); + } + } + } + + public void AddMenuItem(string title, InsertLocation location, UserMode mode, CustomMenuHandler handler) + { + AddMenuItem(UUID.Zero, title, location, mode, handler); + } + + public void AddMenuItem(UUID agentID, string title, InsertLocation location, UserMode mode, CustomMenuHandler handler) + { + if (!m_menuItems.ContainsKey(agentID)) + m_menuItems[agentID] = new List(); + + m_menuItems[agentID].Add(new MenuItemData() { Title = title, AgentID = agentID, Location = location, Mode = mode, Handler = handler }); + } + + public void RemoveMenuItem(string action) + { + foreach (KeyValuePair> kvp in m_menuItems) + { + List pendingDeletes = new List(); + foreach (MenuItemData d in kvp.Value) + { + if (d.Title == action) + pendingDeletes.Add(d); + } + + foreach (MenuItemData d in pendingDeletes) + kvp.Value.Remove(d); + } + } + } + + public class MenuActionHandler : BaseStreamHandler + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private UUID m_agentID; + private Scene m_scene; + private DynamicMenuModule m_module; + + public MenuActionHandler(string path, string name, UUID agentID, DynamicMenuModule module, Scene scene) + :base("POST", path, name, agentID.ToString()) + { + m_agentID = agentID; + m_scene = scene; + m_module = module; + } + + public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + { + StreamReader reader = new StreamReader(request); + string requestBody = reader.ReadToEnd(); + + OSD osd = OSDParser.DeserializeLLSDXml(requestBody); + + string action = ((OSDMap)osd)["action"].AsString(); + OSDArray selection = (OSDArray)((OSDMap)osd)["selection"]; + List sel = new List(); + for (int i = 0 ; i < selection.Count ; i++) + sel.Add(selection[i].AsUInteger()); + + Util.FireAndForget(x => { m_module.HandleMenuSelection(action, m_agentID, sel); }); + + Encoding encoding = Encoding.UTF8; + return encoding.GetBytes(OSDParser.SerializeLLSDXmlString(new OSD())); + } + } +} -- cgit v1.1 From 2093d87e20956b9b6bad34668ae230fdafeeaeda Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 24 Apr 2013 19:00:41 -0700 Subject: Make the kicked user's avie truly disappear when it's god-kicked. --- OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index d2e71a7..fa8c3f3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -278,8 +278,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods if (sp.IsChildAgent) return; sp.ControllingClient.Kick(reason); - sp.MakeChildAgent(); - sp.ControllingClient.Close(); + sp.Scene.IncomingCloseAgent(sp.UUID, true); } private void OnIncomingInstantMessage(GridInstantMessage msg) -- cgit v1.1 From 40036ca05f3a34ef7f0728ed52878068a66bc502 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Apr 2013 21:35:18 +0100 Subject: Change EconomyDataRequest signature to use an IClientAPI rather than UUID. This is needed because recent LL viewer codebases call this earlier in login when the client is not yet established in the sim and can't be found by UUID. Sending the reply requires having the IClientAPI. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- .../World/MoneyModule/SampleMoneyModule.cs | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 4979be8..98160c9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -9860,7 +9860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; if (handlerEconomoyDataRequest != null) { - handlerEconomoyDataRequest(AgentId); + handlerEconomoyDataRequest(this); } return true; } diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 57d9217..be020e4 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -688,19 +688,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule /// Event called Economy Data Request handler. /// /// - public void EconomyDataRequestHandler(UUID agentId) + public void EconomyDataRequestHandler(IClientAPI user) { - IClientAPI user = LocateClientObject(agentId); + Scene s = LocateSceneClientIn(user.AgentId); - if (user != null) - { - Scene s = LocateSceneClientIn(user.AgentId); - - user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, - PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, - PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, - TeleportMinPrice, TeleportPriceExponent); - } + user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, + PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, + PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, + TeleportMinPrice, TeleportPriceExponent); } private void ValidateLandBuy(Object osender, EventManager.LandBuyArgs e) -- cgit v1.1 From 3fcac2ba7b7aa64a7fbd26e451f49933b0859527 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 27 Apr 2013 01:20:03 +0200 Subject: Controller module for dynamic floaters (WIP) --- .../Framework/Interfaces/IDynamicFloaterModule.cs | 51 +++++ .../ViewerSupport/DynamicFloaterModule.cs | 228 +++++++++++++++++++++ 2 files changed, 279 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs create mode 100644 OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs new file mode 100644 index 0000000..5e633e6 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -0,0 +1,51 @@ +/* + * 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.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.Framework.Interfaces +{ + public delegate bool HandlerDelegate(IClientAPI client, FloaterData data, string[] msg); + + public abstract class FloaterData + { + public abstract int Channel { get; } + public abstract string FloaterName { get; } + public virtual string XmlName { get; set; } + public virtual HandlerDelegate Handler { get; set; } + } + + + public interface IDynamicFloaterModule + { + void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration); + void FloaterControl(ScenePresence sp, FloaterData d, string msg); + } +} diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs new file mode 100644 index 0000000..7919fef --- /dev/null +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs @@ -0,0 +1,228 @@ +/* + * 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.IO; +using System.Reflection; +using System.Text; +using System.Collections.Generic; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim; +using OpenSim.Region; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using Nini.Config; +using log4net; +using Mono.Addins; +using Caps = OpenSim.Framework.Capabilities.Caps; +using OSDMap = OpenMetaverse.StructuredData.OSDMap; + +namespace OpenSim.Region.OptionalModules.ViewerSupport +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicFloater")] + public class DynamicFloaterModule : INonSharedRegionModule, IDynamicFloaterModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private Scene m_scene; + + private Dictionary> m_floaters = new Dictionary>(); + + public string Name + { + get { return "DynamicFloaterModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource config) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientClosed += OnClientClosed; + m_scene.RegisterModuleInterface(this); + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + + private void OnNewClient(IClientAPI client) + { + client.OnChatFromClient += OnChatFromClient; + } + + private void OnClientClosed(UUID agentID, Scene scene) + { + m_floaters.Remove(agentID); + } + + private void SendToClient(ScenePresence sp, string msg) + { + sp.ControllingClient.SendChatMessage(msg, + (byte)ChatTypeEnum.Owner, + sp.AbsolutePosition, + "Server", + UUID.Zero, + UUID.Zero, + (byte)ChatSourceType.Object, + (byte)ChatAudibleLevel.Fully); + } + + public void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration) + { + ScenePresence sp = m_scene.GetScenePresence(agentID); + if (sp == null || sp.IsChildAgent) + return; + + if (!m_floaters.ContainsKey(agentID)) + m_floaters[agentID] = new Dictionary(); + + m_floaters[agentID].Add(dialogData.Channel, dialogData); + + string xml; + using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) + { + using (StreamReader sr = new StreamReader(fs)) + xml = sr.ReadToEnd().Replace("\n", ""); + } + + List xparts = new List(); + + while (xml.Length > 0) + { + string x = xml; + if (x.Length > 600) + { + x = x.Substring(0, 600); + xml = xml.Substring(600); + } + else + { + xml = String.Empty; + } + + xparts.Add(x); + } + + for (int i = 0 ; i < xparts.Count ; i++) + SendToClient(sp, String.Format("># floater {2} create {0}/{1} " + xparts[i], i + 1, xparts.Count, dialogData.FloaterName)); + + SendToClient(sp, String.Format("># floater {0} {{notify:1}} {{channel: {1}}} {{node:cancel {{notify:1}}}} {{node:ok {{notify:1}}}} {2}", dialogData.FloaterName, (uint)dialogData.Channel, configuration)); + } + + private void OnChatFromClient(object sender, OSChatMessage msg) + { + if (msg.Sender == null) + return; + + //m_log.DebugFormat("chan {0} msg {1}", msg.Channel, msg.Message); + + IClientAPI client = msg.Sender; + + if (!m_floaters.ContainsKey(client.AgentId)) + return; + + string[] parts = msg.Message.Split(new char[] {':'}); + if (parts.Length == 0) + return; + + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null || sp.IsChildAgent) + return; + + Dictionary d = m_floaters[client.AgentId]; + + // Work around a viewer bug - VALUE from any + // dialog can appear on this channel and needs to + // be dispatched to ALL open dialogs for the user + if (msg.Channel == 427169570) + { + if (parts[0] == "VALUE") + { + foreach (FloaterData dd in d.Values) + { + if(dd.Handler(client, dd, parts)) + { + m_floaters[client.AgentId].Remove(dd.Channel); + SendToClient(sp, String.Format("># floater {0} destroy", dd.FloaterName)); + break; + } + } + } + return; + } + + if (!d.ContainsKey(msg.Channel)) + return; + + FloaterData data = d[msg.Channel]; + + if (parts[0] == "NOTIFY") + { + if (parts[1] == "cancel" || parts[1] == data.FloaterName) + { + m_floaters[client.AgentId].Remove(data.Channel); + SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName)); + } + } + + if (data.Handler(client, data, parts)) + { + m_floaters[client.AgentId].Remove(data.Channel); + SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName)); + } + } + + public void FloaterControl(ScenePresence sp, FloaterData d, string msg) + { + string sendData = String.Format("># floater {0} {1}", d.FloaterName, msg); + SendToClient(sp, sendData); + + } + } +} -- cgit v1.1 From 5a4cb539d2e685d604b00419040da4a752e074aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 17:14:44 +0100 Subject: Fix bug where an agent that declined an inventory offer and subsequently emptied their trash would make the item invalid in the giver's inventory This was because the original item/folder ID was sent in the session slot of the offer IM rather than the copy. --- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index ae58dfd..f122d00 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -213,7 +213,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer user.ControllingClient.SendBulkUpdateInventory(folderCopy); // HACK!! - im.imSessionID = folderID.Guid; + // Insert the ID of the copied item into the IM so that we know which item to move to trash if it + // is rejected. + // XXX: This is probably a misuse of the session ID slot. + im.imSessionID = copyID.Guid; } else { @@ -243,7 +246,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer user.ControllingClient.SendBulkUpdateInventory(itemCopy); // HACK!! - im.imSessionID = itemID.Guid; + // Insert the ID of the copied item into the IM so that we know which item to move to trash if it + // is rejected. + // XXX: This is probably a misuse of the session ID slot. + im.imSessionID = copyID.Guid; } im.offline = 0; -- cgit v1.1 From 0af1d8fe196e403c066f7fc3dbc9f4b897b4da2c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 30 Apr 2013 23:35:59 +0200 Subject: Fix CAPS to work like they should - do not send caps to the viewer if they're not in the requested caps list. The previous wrong behavior caused the debug setting "UseHTTPInventory" to fail on all viewers when turned off. UDB inventory would not be correctly used in that case. --- .../ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 13 ++++++++++++- .../Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 921d3bf..59b9585 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -355,11 +355,22 @@ namespace OpenSim.Region.ClientStack.Linden return string.Empty; } - Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true); + OSDArray capsRequested = (OSDArray)OSDParser.DeserializeLLSDXml(request); + List validCaps = new List(); + + foreach (OSD c in capsRequested) + validCaps.Add(c.AsString()); + + Hashtable caps = m_HostCapsObj.CapsHandlers.GetCapsDetails(true, validCaps); // Add the external too foreach (KeyValuePair kvp in m_HostCapsObj.ExternalCapsHandlers) + { + if (!validCaps.Contains(kvp.Key)) + continue; + caps[kvp.Key] = kvp.Value; + } string result = LLSDHelpers.SerialiseLLSDReply(caps); diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 2eb9bfb..fff86d5 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs @@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Framework { caps.AppendFormat("** Circuit {0}:\n", kvp.Key); - for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false).GetEnumerator(); kvp2.MoveNext(); ) + for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) { Uri uri = new Uri(kvp2.Value.ToString()); caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); -- cgit v1.1 From d982d249387adee9faf1dd7452ad03abac4d84b1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 1 May 2013 21:35:50 +0100 Subject: Fix the long standing bug of items being delivered to lost and found or trash when takig copy. This bug was recently aggravated through the perms changes required for the export permission. --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 5aad7f0..43c7e7d 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -676,11 +676,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } else { - if (remoteClient == null || so.OwnerID != remoteClient.AgentId) + if (remoteClient == null || so.RootPart.OwnerID != remoteClient.AgentId) { // Taking copy of another person's item. Take to // Objects folder. folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); + so.FromFolderID = UUID.Zero; } else { @@ -696,7 +697,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) { - if (so.FromFolderID != UUID.Zero && userID == remoteClient.AgentId) + if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) { InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID); if (f != null) -- cgit v1.1 From 4904d4013803b0128c52b2f9bdd5e94972b05c2f Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 4 May 2013 00:44:47 +0200 Subject: Add llGetPhysicsMaterial --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 12 ++++++++++++ OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 1 + OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++++ 3 files changed, 18 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bc35272..bb89ac1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7851,6 +7851,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public LSL_List llGetPhysicsMaterial() + { + LSL_List result = new LSL_List(); + + result.Add(new LSL_Float(m_host.GravityModifier)); + result.Add(new LSL_Float(m_host.Restitution)); + result.Add(new LSL_Float(m_host.Friction)); + result.Add(new LSL_Float(m_host.Density)); + + return result; + } + private void SetPhysicsMaterial(SceneObjectPart part, int material_bits, float material_density, float material_friction, float material_restitution, float material_gravity_modifier) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 9bf6f9b..bc8d321 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -433,5 +433,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc); void llSetKeyframedMotion(LSL_List frames, LSL_List options); LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); + LSL_List llGetPhysicsMaterial(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 8ecc4f8..b6bb5d8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -2009,5 +2009,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_LSL_Functions.llSetPhysicsMaterial(material_bits, material_gravity_modifier, material_restitution, material_friction, material_density); } + + public LSL_List llGetPhysicsMaterial() + { + return m_LSL_Functions.llGetPhysicsMaterial(); + } } } -- cgit v1.1 From 23324539745848f28308f3de28aa0278b662e1b5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 4 May 2013 00:45:27 +0200 Subject: Add RegionManager level and the ability to use literal XML to the dynamic floater module --- .../Region/Framework/Interfaces/IDynamicFloaterModule.cs | 1 + OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs | 1 + .../OptionalModules/ViewerSupport/DynamicFloaterModule.cs | 13 ++++++++++--- .../OptionalModules/ViewerSupport/DynamicMenuModule.cs | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs index 5e633e6..65c42ff 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -39,6 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces public abstract int Channel { get; } public abstract string FloaterName { get; } public virtual string XmlName { get; set; } + public virtual string XmlText { get; set; } public virtual HandlerDelegate Handler { get; set; } } diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs index 08b71e4..4d000b6 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs @@ -43,6 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces public enum UserMode : int { Normal = 0, + RegionManager = 2, God = 3 } diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs index 7919fef..4524a05 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs @@ -125,10 +125,17 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport m_floaters[agentID].Add(dialogData.Channel, dialogData); string xml; - using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) + if (dialogData.XmlText != null && dialogData.XmlText != String.Empty) { - using (StreamReader sr = new StreamReader(fs)) - xml = sr.ReadToEnd().Replace("\n", ""); + xml = dialogData.XmlText; + } + else + { + using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) + { + using (StreamReader sr = new StreamReader(fs)) + xml = sr.ReadToEnd().Replace("\n", ""); + } } List xparts = new List(); diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs index 917911f..c68fe99 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs @@ -110,8 +110,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport { foreach (MenuItemData d in m_menuItems[UUID.Zero]) { - if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) - continue; + if (!m_scene.Permissions.IsGod(agentID)) + { + if (d.Mode == UserMode.RegionManager && (!m_scene.Permissions.IsAdministrator(agentID))) + continue; + } OSDMap loc = null; switch (d.Location) -- cgit v1.1 From a8faed6f76e5bb7936c1bc2b4711b5eeb143173d Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 5 May 2013 22:01:07 +0200 Subject: Implement llSetContentType using the new OpenID auth support for authentication --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 51 +++++++++++++++++++++- .../Shared/Api/Implementation/LSL_Api.cs | 12 +++++ .../ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 1 + .../Shared/Api/Runtime/LSL_Constants.cs | 3 ++ .../ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++ 5 files changed, 71 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index f2922d6..2a4d440 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public UUID urlcode; public Dictionary requests; public bool isSsl; + public Scene scene; } public class RequestData @@ -66,6 +67,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public int startTime; public bool responseSent; public string uri; + public bool allowResponseType = false; + public UUID hostID; + public Scene scene; } /// @@ -171,6 +175,17 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RemoveRegion(Scene scene) { + // Drop references to that scene + foreach (KeyValuePair kvp in m_UrlMap) + { + if (kvp.Value.scene == scene) + kvp.Value.scene = null; + } + foreach (KeyValuePair kvp in m_RequestMap) + { + if (kvp.Value.scene == scene) + kvp.Value.scene = null; + } } public void Close() @@ -198,6 +213,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp urlData.urlcode = urlcode; urlData.isSsl = false; urlData.requests = new Dictionary(); + urlData.scene = host.ParentGroup.Scene; m_UrlMap[url] = urlData; @@ -316,6 +332,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp if (!urlData.requests[request].responseSent) { string responseBody = body; + + // If we have no OpenID from built-in browser, disable this + if (!urlData.requests[request].allowResponseType) + urlData.requests[request].responseType = "text/plain"; + if (urlData.requests[request].responseType.Equals("text/plain")) { string value; @@ -532,7 +553,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp //put response response["int_response_code"] = requestData.responseCode; response["str_response_string"] = requestData.responseBody; - response["content_type"] = "text/plain"; + response["content_type"] = requestData.responseType; response["keepalive"] = false; response["reusecontext"] = false; @@ -600,6 +621,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp requestData.requestDone = false; requestData.startTime = System.Environment.TickCount; requestData.uri = uri; + requestData.hostID = url.hostID; + requestData.scene = url.scene; if (requestData.headers == null) requestData.headers = new Dictionary(); @@ -608,6 +631,32 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp string key = (string)header.Key; string value = (string)header.Value; requestData.headers.Add(key, value); + if (key == "cookie") + { + string[] parts = value.Split(new char[] {'='}); + if (parts[0] == "agni_sl_session_id" && parts.Length > 1) + { + string cookie = Uri.UnescapeDataString(parts[1]); + string[] crumbs = cookie.Split(new char[] {':'}); + UUID owner; + if (crumbs.Length == 2 && UUID.TryParse(crumbs[0], out owner)) + { + if (crumbs[1].Length == 32) + { + Scene scene = requestData.scene; + if (scene != null) + { + SceneObjectPart host = scene.GetSceneObjectPart(requestData.hostID); + if (host != null) + { + if (host.OwnerID == owner) + requestData.allowResponseType = true; + } + } + } + } + } + } } foreach (DictionaryEntry de in request) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bb89ac1..6bcb361 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13386,6 +13386,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return null; } + + public void llSetContentType(LSL_Key id, LSL_Integer content_type) + { + if (m_UrlModule != null) + { + string type = "text.plain"; + if (content_type == (int)ScriptBaseClass.CONTENT_TYPE_HTML) + type = "text/html"; + + m_UrlModule.HttpContentType(new UUID(id),type); + } + } } public class NotecardCache diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index bc8d321..daf89e5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -434,5 +434,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llSetKeyframedMotion(LSL_List frames, LSL_List options); LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); LSL_List llGetPhysicsMaterial(); + void llSetContentType(LSL_Key id, LSL_Integer content_type); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 2f8154d..c664a84 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -771,5 +771,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase /// process message parameter as regex /// public const int OS_LISTEN_REGEX_MESSAGE = 0x2; + + public const int CONTENT_TYPE_TEXT = 0; + public const int CONTENT_TYPE_HTML = 1; } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index b6bb5d8..6f3677c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -2014,5 +2014,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LSL_Functions.llGetPhysicsMaterial(); } + + public void llSetContentType(LSL_Key id, LSL_Integer content_type) + { + m_LSL_Functions.llSetContentType(id, content_type); + } } } -- cgit v1.1 From cbae04ba97e1832f25c514685e6af770c5e58d68 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 May 2013 06:15:47 +0200 Subject: Remove dumb "Region found!" message from map search --- OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 4c96a50..14deeb6 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -211,8 +211,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { if (regionInfos.Count == 0) remoteClient.SendAgentAlertMessage("No regions found with that name.", true); - else if (regionInfos.Count == 1) - remoteClient.SendAgentAlertMessage("Region found!", false); +// else if (regionInfos.Count == 1) +// remoteClient.SendAgentAlertMessage("Region found!", false); } }); } -- cgit v1.1 From 8ade6fa617f611fc3b470e279e4a5c50177bd5f0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 11 May 2013 16:15:39 +0200 Subject: Refactor to get closer to core --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 4 ++-- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b70aeb7..ed867b8 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1114,14 +1114,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer ((Scene)(client.Scene)).RequestTeleportLocation( client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); + return true; } else { // can't find the Home region: Tell viewer and abort client.SendTeleportFailed("Your home region could not be found."); - return false; } - return true; + return false; } #endregion diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 28fce53..584ffea 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3380,7 +3380,7 @@ namespace OpenSim.Region.Framework.Scenes { if (EntityTransferModule != null) { - EntityTransferModule.TeleportHome(agentId, client); + return EntityTransferModule.TeleportHome(agentId, client); } else { -- cgit v1.1 From 3f6071ce3a2a8970419186fa7d5715f2af8b53ae Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 11 May 2013 16:16:02 +0200 Subject: Guard against trying to access terrain heights out of bounds. Clamp to sim. --- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index c0ca48e..b6e0a97 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -131,7 +131,15 @@ namespace OpenSim.Region.Framework.Scenes public double this[int x, int y] { - get { return map[x, y]; } + get + { + if (x < 0) x = 0; + if (y < 0) y = 0; + if (x >= (int)Constants.RegionSize) x = (int)Constants.RegionSize - 1; + if (y >= (int)Constants.RegionSize) y = (int)Constants.RegionSize - 1; + + return map[x, y]; + } set { // Will "fix" terrain hole problems. Although not fantastically. -- cgit v1.1 From 296b43f597e830c288ed0e56d1a6b78b955a7932 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 13 May 2013 02:15:48 +0200 Subject: Small adjustments to the floater module --- OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs | 2 +- OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs index 65c42ff..7684ce3 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicFloaterModule.cs @@ -37,7 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces public abstract class FloaterData { public abstract int Channel { get; } - public abstract string FloaterName { get; } + public abstract string FloaterName { get; set; } public virtual string XmlName { get; set; } public virtual string XmlText { get; set; } public virtual HandlerDelegate Handler { get; set; } diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs index 4524a05..e76e8f2 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs @@ -122,6 +122,9 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport if (!m_floaters.ContainsKey(agentID)) m_floaters[agentID] = new Dictionary(); + if (m_floaters[agentID].ContainsKey(dialogData.Channel)) + return; + m_floaters[agentID].Add(dialogData.Channel, dialogData); string xml; @@ -218,7 +221,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport } } - if (data.Handler(client, data, parts)) + if (data.Handler != null && data.Handler(client, data, parts)) { m_floaters[client.AgentId].Remove(data.Channel); SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName)); -- cgit v1.1 From f9daf921f72e9962546fe5cfcc45db3ace8f903c Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 13 May 2013 03:29:11 +0200 Subject: Explicitly zero avatar velocity on sit --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 98160c9..d5b7ec8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5124,6 +5124,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP data.CollisionPlane.ToBytes(objectData, 0); offsetPosition.ToBytes(objectData, 16); + Vector3 velocity = new Vector3(0, 0, 0); + Vector3 acceleration = new Vector3(0, 0, 0); + velocity.ToBytes(objectData, 28); + acceleration.ToBytes(objectData, 40); // data.Velocity.ToBytes(objectData, 28); // data.Acceleration.ToBytes(objectData, 40); rotation.ToBytes(objectData, 52); -- cgit v1.1 From 799ba5aa7b2b5d82e5e2f622929042b38da3809c Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 14 May 2013 19:17:31 -0400 Subject: * Tweaks the hard cut to apply to collisions of Greater then Normal Z 0.95. This fits within Ubit's framework of multi-body collisions, just moves the reactive force to the Midboxgeom(actual detection) instead of the bigbox geom(pre detection) --- .../Region/Physics/UbitOdePlugin/ODECharacter.cs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index bea34d4..238e6e9 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -1045,12 +1045,37 @@ namespace OpenSim.Region.Physics.OdePlugin if (me == midbox) { if (Math.Abs(contact.normal.Z) > 0.95f) + { offset.Z = contact.pos.Z - _position.Z; + offset.X = (float)Math.Abs(offset.X) * 0.5f + contact.depth; + offset.Y = (float)Math.Abs(offset.Y) * 0.5f + contact.depth; + offset.Z = (float)Math.Abs(offset.Z) * 0.5f + contact.depth; + + if (reverse) + { + offset.X *= -contact.normal.X; + offset.Y *= -contact.normal.Y; + offset.Z *= -contact.normal.Z; + } + else + { + offset.X *= contact.normal.X; + offset.Y *= contact.normal.Y; + offset.Z *= contact.normal.Z; + } + + offset.X += contact.pos.X; + offset.Y += contact.pos.Y; + offset.Z += contact.pos.Z; + _position = offset; + return true; + } else offset.Z = contact.normal.Z; offset.Normalize(); + /* if (reverse) { contact.normal.X = offset.X; @@ -1063,7 +1088,8 @@ namespace OpenSim.Region.Physics.OdePlugin contact.normal.Y = -offset.Y; contact.normal.Z = -offset.Z; } - + */ + //_position.Z = offset.Z; return true; } -- cgit v1.1 From 477a5e3a35780809b1807e43f6deed8ede17f14d Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 14 May 2013 20:55:56 -0400 Subject: * This fixes the avatar stuck in objects on login and teleport by gently applying an upward motion when stuck in things on the Z * Comments describe how it filters out good, normal collisions, from 'stuck' collisions.. It's especially sensitive in feetbox collisions since this is where normal collisions happen under usual circumstances. --- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 238e6e9..e912997 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -1097,8 +1097,20 @@ namespace OpenSim.Region.Physics.OdePlugin { float h = contact.pos.Z - _position.Z; + // Only do this if the normal is sufficiently pointing in the 'up' direction if (Math.Abs(contact.normal.Z) > 0.95f) { + // We Only want to do this if we're sunk into the object a bit and we're stuck and we're trying to move and feetcollision is false + if ((contact.depth > 0.0010f && _velocity.X == 0f && _velocity.Y == 0 && _velocity.Z == 0) + && (_target_velocity.X > 0 || _target_velocity.Y > 0 || _target_velocity.Z > 0) + && (!feetcollision) ) + { + m_collisionException = true; // Stop looping, do this only once not X times Contacts + _position.Z += contact.depth + 0.01f; // Move us Up the amount that we sank in, and add 0.01 meters to gently lift avatar up. + + return true; + } + if (contact.normal.Z > 0) contact.normal.Z = 1.0f; else -- cgit v1.1 From 4cb7ee47f209ffb0c8d8d04eba462c248c4740e0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 22 May 2013 23:49:34 +0200 Subject: Let the event queue do lees work - expire every 40s as per Teravus instead of every seconds - whoever put that in.... --- .../Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 37285e3..eb40eb1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -376,7 +376,7 @@ namespace OpenSim.Region.ClientStack.Linden // TODO: Add EventQueueGet name/description for diagnostics MainServer.Instance.AddPollServiceHTTPHandler( eventQueueGetPath, - new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID, 1000)); + new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID, 40000)); // m_log.DebugFormat( // "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}", -- cgit v1.1 From 9ba35c6b7e36a675f8fd3fe1c372ec40a5b0216a Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 24 May 2013 00:45:30 +0200 Subject: Port fix from justicc - decouple pay prices on drag-copied prims --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 42644dc..261e958 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2161,6 +2161,7 @@ namespace OpenSim.Region.Framework.Scenes // safeguard actual copy is done in sog.copy dupe.KeyframeMotion = null; + dupe.PayPrice = (int[])PayPrice.Clone(); dupe.DynAttrs.CopyFrom(DynAttrs); -- cgit v1.1 From 027580935a2e524fb0fed304e519a9e5041f6e32 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 24 May 2013 01:09:07 +0200 Subject: Reset "Show in search" on parcels cut off other parcels that are in search --- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index b4f7d51..c307998 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -937,6 +937,8 @@ namespace OpenSim.Region.CoreModules.World.Land newLand.LandData.Name = newLand.LandData.Name; newLand.LandData.GlobalID = UUID.Random(); newLand.LandData.Dwell = 0; + // Clear "Show in search" on the cut out parcel to prevent double-charging + newLand.LandData.Flags &= ~(uint)ParcelFlags.ShowDirectory; newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y)); -- cgit v1.1 From 0086c3b5fb24f4a25fe2e28f9cedcaa41c70b36c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 25 May 2013 01:58:50 +0200 Subject: Update the money framework to allow sending the new style linden "serverside is now viewerside" messages regarding currency This will require all money modules to be refactored! --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 30 ++++++++++------------ .../Server/IRCClientView.cs | 7 +---- .../Avatar/XmlRpcGroups/GroupsModule.cs | 2 +- .../World/MoneyModule/SampleMoneyModule.cs | 13 +++++++--- .../Region/OptionalModules/World/NPC/NPCAvatar.cs | 7 +---- 5 files changed, 26 insertions(+), 33 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d5b7ec8..7208f08 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -354,7 +354,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // protected HashSet m_attachmentsSent; - private int m_moneyBalance; private bool m_deliverPackets = true; private int m_animationSequenceNumber = 1; private bool m_SendLogoutPacketWhenClosing = true; @@ -438,7 +437,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public string Name { get { return FirstName + " " + LastName; } } public uint CircuitCode { get { return m_circuitCode; } } - public int MoneyBalance { get { return m_moneyBalance; } } public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } /// @@ -502,7 +500,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_firstName = sessionInfo.LoginInfo.First; m_lastName = sessionInfo.LoginInfo.Last; m_startpos = sessionInfo.LoginInfo.StartPos; - m_moneyBalance = 1000; m_udpServer = udpServer; m_udpClient = udpClient; @@ -1526,7 +1523,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(tpProgress, ThrottleOutPacketType.Unknown); } - public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) { MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); money.MoneyData.AgentID = AgentId; @@ -1534,7 +1531,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP money.MoneyData.TransactionSuccess = success; money.MoneyData.Description = description; money.MoneyData.MoneyBalance = balance; - money.TransactionInfo.ItemDescription = Util.StringToBytes256("NONE"); + money.TransactionInfo.TransactionType = transactionType; + money.TransactionInfo.SourceID = sourceID; + money.TransactionInfo.IsSourceGroup = sourceIsGroup; + money.TransactionInfo.DestID = destID; + money.TransactionInfo.IsDestGroup = destIsGroup; + money.TransactionInfo.Amount = amount; + money.TransactionInfo.ItemDescription = Util.StringToBytes256(item); + OutPacket(money, ThrottleOutPacketType.Task); } @@ -2278,6 +2282,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) { + // Prepend a slash to make the message come up in the top right + // again. + // Allow special formats to be sent from aware modules. + if (!modal && !message.StartsWith("ALERT: ") && !message.StartsWith("NOTIFY: ") && message != "Home position set." && message != "You died and have been teleported to your home location") + message = "/" + message; AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); alertPack.AgentData.AgentID = AgentId; alertPack.AlertData.Message = Util.StringToBytes256(message); @@ -12217,17 +12226,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); } - public bool AddMoney(int debit) - { - if (m_moneyBalance + debit >= 0) - { - m_moneyBalance += debit; - SendMoneyBalance(UUID.Zero, true, Util.StringToBytes256("Poof Poof!"), m_moneyBalance); - return true; - } - return false; - } - protected void HandleAutopilot(Object sender, string method, List args) { float locx = 0; diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 686c605..dd72cfb 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1055,7 +1055,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server { } - public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) { } @@ -1200,11 +1200,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public bool AddMoney(int debit) - { - return true; - } - public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) { diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index d764936..d0a5989 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -764,7 +764,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group."); return UUID.Zero; } - money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); + money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, MoneyTransactionType.GroupCreate); } UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index be020e4..0c9fdb9 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -191,9 +191,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // Please do not refactor these to be just one method // Existing implementations need the distinction // - public void ApplyCharge(UUID agentID, int amount, string text) + public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData) { } + + public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type) + { + } + public void ApplyUploadCharge(UUID agentID, int amount, string text) { } @@ -322,7 +327,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule client.SendAlertMessage(e.Message + " "); } - client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds); + client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); } else { @@ -385,12 +390,12 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule { if (sender != null) { - sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); } if (receiver != null) { - receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); } } } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 7918c22..4674489 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -698,7 +698,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) { } @@ -874,11 +874,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public bool AddMoney(int debit) - { - return false; - } - public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) { } -- cgit v1.1 From a348c8e44a72bd2de0151fc6db7a229cd8ee86a2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 26 May 2013 14:11:48 +0200 Subject: Allow Linden trees to preserve their type when taken into inventory and rezzed again. Allow Linden trees to be sensed by LLSensor as PASSIVE objects. --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 15 ++++++++++++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++ .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 4 +++- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 43c7e7d..4c11135 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -387,7 +387,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess inventoryStoredPosition = objectGroup.RootPart.AttachOffset; inventoryStoredRotation = objectGroup.RootPart.AttachRotation; } - objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; + + // Trees could be attached and it's been done, but it makes + // no sense. State must be preserved because it's the tree type + if (objectGroup.RootPart.Shape.PCode != (byte)PCode.Tree && + objectGroup.RootPart.Shape.PCode != (byte)PCode.NewTree) + objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; objectGroup.AbsolutePosition = inventoryStoredPosition; objectGroup.RootPart.RotationOffset = inventoryStoredRotation; @@ -791,7 +796,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess g.RootPart.AttachPoint = g.RootPart.Shape.State; g.RootPart.AttachOffset = g.AbsolutePosition; g.RootPart.AttachRotation = g.GroupRotation; - g.RootPart.Shape.State = 0; + if (g.RootPart.Shape.PCode != (byte)PCode.NewTree && + g.RootPart.Shape.PCode != (byte)PCode.Tree) + g.RootPart.Shape.State = 0; } objlist.Add(g); @@ -825,7 +832,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess g.RootPart.AttachPoint = g.RootPart.Shape.State; g.RootPart.AttachOffset = g.AbsolutePosition; g.RootPart.AttachRotation = g.GroupRotation; - g.RootPart.Shape.State = 0; + if (g.RootPart.Shape.PCode != (byte)PCode.NewTree && + g.RootPart.Shape.PCode != (byte)PCode.Tree) + g.RootPart.Shape.State = 0; objlist.Add(g); XmlElement el = (XmlElement)n; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 69fb6df..0ea4e09 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -272,6 +272,11 @@ namespace OpenSim.Region.Framework.Scenes { AttachmentPoint = 0; + // Don't zap trees + if (RootPart.Shape.PCode == (byte)PCode.Tree || + RootPart.Shape.PCode == (byte)PCode.NewTree) + return; + // Even though we don't use child part state parameters for attachments any more, we still need to set // these to zero since having them non-zero in rezzed scene objects will crash some clients. Even if // we store them correctly, scene objects that we receive from elsewhere might not. diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 884f07c..a47e452 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -398,7 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins objtype = 0; part = ((SceneObjectGroup)ent).RootPart; - if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore + if (part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.Tree && + part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.NewTree && + part.ParentGroup.AttachmentPoint != 0) // Attached so ignore continue; if (part.Inventory.ContainsScripts()) -- cgit v1.1 From 70d5c29310492e0481b6df91edefdce729573e2e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 31 May 2013 21:55:56 +0200 Subject: Stop sending velocity to avoid snap-back --- OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index b102e48..d773ee7 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs @@ -645,7 +645,7 @@ namespace OpenSim.Region.Framework.Scenes m_nextPosition = m_group.AbsolutePosition + motionThisFrame; m_group.AbsolutePosition = m_nextPosition; - m_group.RootPart.Velocity = v; + //m_group.RootPart.Velocity = v; update = true; } -- cgit v1.1 From 9589a09eda2a08c12dc54a99fb04faa18e5c6de7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 31 May 2013 22:02:31 +0200 Subject: Fix multi-wear of alpha and tattoo layers. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7208f08..eebb8ae 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1737,7 +1737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP newBlock.CreationDate = item.CreationDate; newBlock.SalePrice = item.SalePrice; newBlock.SaleType = item.SaleType; - newBlock.Flags = item.Flags; + newBlock.Flags = item.Flags & 0xff; newBlock.CRC = Helpers.InventoryCRC(newBlock.CreationDate, newBlock.SaleType, @@ -1991,7 +1991,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP itemBlock.GroupID = item.GroupID; itemBlock.GroupOwned = item.GroupOwned; itemBlock.GroupMask = item.GroupPermissions; - itemBlock.Flags = item.Flags; + itemBlock.Flags = item.Flags & 0xff; itemBlock.SalePrice = item.SalePrice; itemBlock.SaleType = item.SaleType; itemBlock.CreationDate = item.CreationDate; @@ -2058,7 +2058,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.ItemData[0].GroupID = item.GroupID; bulkUpdate.ItemData[0].GroupOwned = item.GroupOwned; bulkUpdate.ItemData[0].GroupMask = item.GroupPermissions; - bulkUpdate.ItemData[0].Flags = item.Flags; + bulkUpdate.ItemData[0].Flags = item.Flags & 0xff; bulkUpdate.ItemData[0].SalePrice = item.SalePrice; bulkUpdate.ItemData[0].SaleType = item.SaleType; @@ -2112,7 +2112,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP InventoryReply.InventoryData[0].GroupID = Item.GroupID; InventoryReply.InventoryData[0].GroupOwned = Item.GroupOwned; InventoryReply.InventoryData[0].GroupMask = Item.GroupPermissions; - InventoryReply.InventoryData[0].Flags = Item.Flags; + InventoryReply.InventoryData[0].Flags = Item.Flags & 0xff; InventoryReply.InventoryData[0].SalePrice = Item.SalePrice; InventoryReply.InventoryData[0].SaleType = Item.SaleType; InventoryReply.InventoryData[0].CreationDate = Item.CreationDate; -- cgit v1.1 From bd87eb90d10946bb4e010ed84d9a7577d8158a07 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 2 Jun 2013 16:28:28 +0200 Subject: Implement PERMISSION_TELEPORT and the needed checks to make it work. Old auth system still works as well. --- .../Shared/Api/Implementation/LSL_Api.cs | 25 ++++++++++++++++------ .../Shared/Api/Runtime/LSL_Constants.cs | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6bcb361..5af2a8d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4641,20 +4641,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(agentId); if (presence != null && presence.PresenceType != PresenceType.Npc) { - // agent must not be a god - if (presence.GodLevel >= 200) return; - if (destination == String.Empty) destination = World.RegionInfo.RegionName; - // agent must be over the owners land - if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) + if (m_item.PermsGranter == agentId) + { + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) + { + DoLLTeleport(presence, destination, targetPos, targetLookAt); + } + } + + // agent must be wearing the object + if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) { DoLLTeleport(presence, destination, targetPos, targetLookAt); } - else // or must be wearing the prim + else { - if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) + // agent must not be a god + if (presence.GodLevel >= 200) return; + + // agent must be over the owners land + ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); + ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition); + if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID) { DoLLTeleport(presence, destination, targetPos, targetLookAt); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index c664a84..6efa73f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PERMISSION_CHANGE_PERMISSIONS = 512; public const int PERMISSION_TRACK_CAMERA = 1024; public const int PERMISSION_CONTROL_CAMERA = 2048; + public const int PERMISSION_TELEPORT = 4096; public const int AGENT_FLYING = 1; public const int AGENT_ATTACHMENTS = 2; -- cgit v1.1 From e2d4cb870ed4bccb4ee127b079742a67ec1ad752 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 2 Jun 2013 23:53:07 +0200 Subject: Unsit seated avatars when an object is deleted --- OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 584ffea..2b58795 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2440,6 +2440,14 @@ namespace OpenSim.Region.Framework.Scenes else group.StopScriptInstances(); + List avatars = group.GetSittingAvatars(); + foreach (UUID av in avatars) + { + ScenePresence p = GetScenePresence(av); + if (p != null) + p.StandUp(); + } + SceneObjectPart[] partList = group.Parts; foreach (SceneObjectPart part in partList) -- cgit v1.1 From 57c8d82c9e3d55581982a75a02d1f54bc547fb50 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 2 Jun 2013 23:53:20 +0200 Subject: Fix llTeleportAgentGlobalCoords --- .../Shared/Api/Implementation/LSL_Api.cs | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5af2a8d..5ea14c7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4679,24 +4679,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID agentId = new UUID(); - ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); + ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256); if (UUID.TryParse(agent, out agentId)) { + // This function is owner only! + if (m_host.OwnerID != agentId) + return; + ScenePresence presence = World.GetScenePresence(agentId); + + // Can't TP sitting avatars + if (presence.ParentID != 0) // Sitting + return; + if (presence != null && presence.PresenceType != PresenceType.Npc) { - // agent must not be a god - if (presence.GodLevel >= 200) return; - - // agent must be over the owners land - if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) - { - World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); - } - else // or must be wearing the prim + if (m_item.PermsGranter == agentId) { - if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) + // If attached using llAttachToAvatarTemp, cowardly refuse + if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero) + return; + + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) { World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); } -- cgit v1.1