aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs92
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs143
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs24
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs3
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs9
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
16 files changed, 198 insertions, 165 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 60bfaa5..032104d 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -29,9 +29,11 @@ using System;
29using System.Timers; 29using System.Timers;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Collections.Specialized;
32using System.IO; 33using System.IO;
33using System.Reflection; 34using System.Reflection;
34using System.Text; 35using System.Text;
36using System.Web;
35 37
36using OpenMetaverse; 38using OpenMetaverse;
37using OpenMetaverse.StructuredData; 39using OpenMetaverse.StructuredData;
@@ -125,6 +127,8 @@ namespace OpenSim.Region.ClientStack.Linden
125 127
126 private bool m_AllowCapHomeLocation = true; 128 private bool m_AllowCapHomeLocation = true;
127 private bool m_AllowCapGroupMemberData = true; 129 private bool m_AllowCapGroupMemberData = true;
130 private IUserManagement m_UserManager;
131
128 132
129 private enum FileAgentInventoryState : int 133 private enum FileAgentInventoryState : int
130 { 134 {
@@ -196,6 +200,9 @@ namespace OpenSim.Region.ClientStack.Linden
196 200
197 m_assetService = m_Scene.AssetService; 201 m_assetService = m_Scene.AssetService;
198 m_regionName = m_Scene.RegionInfo.RegionName; 202 m_regionName = m_Scene.RegionInfo.RegionName;
203 m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>();
204 if (m_UserManager == null)
205 m_log.Error("[CAPS]: GetDisplayNames disabled because user management component not found");
199 206
200 RegisterHandlers(); 207 RegisterHandlers();
201 208
@@ -229,6 +236,7 @@ namespace OpenSim.Region.ClientStack.Linden
229 236
230 RegisterRegionServiceHandlers(); 237 RegisterRegionServiceHandlers();
231 RegisterInventoryServiceHandlers(); 238 RegisterInventoryServiceHandlers();
239 RegisterOtherHandlers();
232 } 240 }
233 241
234 public void RegisterRegionServiceHandlers() 242 public void RegisterRegionServiceHandlers()
@@ -314,6 +322,22 @@ namespace OpenSim.Region.ClientStack.Linden
314 } 322 }
315 } 323 }
316 324
325 public void RegisterOtherHandlers()
326 {
327 try
328 {
329 if (m_UserManager != null)
330 {
331 IRequestHandler GetDisplayNamesHandler = new RestStreamHandler(
332 "GET", GetNewCapPath(), GetDisplayNames, "GetDisplayNames", null);
333 m_HostCapsObj.RegisterHandler("GetDisplayNames", GetDisplayNamesHandler);
334 }
335 }
336 catch (Exception e)
337 {
338 m_log.Error("[CAPS]: " + e.ToString());
339 }
340 }
317 /// <summary> 341 /// <summary>
318 /// Construct a client response detailing all the capabilities this server can provide. 342 /// Construct a client response detailing all the capabilities this server can provide.
319 /// </summary> 343 /// </summary>
@@ -1022,6 +1046,7 @@ namespace OpenSim.Region.ClientStack.Linden
1022 prim.OwnerID = owner_id; 1046 prim.OwnerID = owner_id;
1023 prim.GroupID = UUID.Zero; 1047 prim.GroupID = UUID.Zero;
1024 prim.LastOwnerID = creatorID; 1048 prim.LastOwnerID = creatorID;
1049 prim.RezzerID = creatorID;
1025 prim.CreationDate = Util.UnixTimeSinceEpoch(); 1050 prim.CreationDate = Util.UnixTimeSinceEpoch();
1026 1051
1027 if (grp == null) 1052 if (grp == null)
@@ -1069,6 +1094,7 @@ namespace OpenSim.Region.ClientStack.Linden
1069 { 1094 {
1070 grp = new SceneObjectGroup(prim); 1095 grp = new SceneObjectGroup(prim);
1071 grp.LastOwnerID = creatorID; 1096 grp.LastOwnerID = creatorID;
1097 grp.RezzerID = creatorID;
1072 } 1098 }
1073 else 1099 else
1074 grp.AddPart(prim); 1100 grp.AddPart(prim);
@@ -1794,6 +1820,72 @@ namespace OpenSim.Region.ClientStack.Linden
1794 response = OSDParser.SerializeLLSDXmlString(resp); 1820 response = OSDParser.SerializeLLSDXmlString(resp);
1795 return response; 1821 return response;
1796 } 1822 }
1823
1824 public string GetDisplayNames(string request, string path,
1825 string param, IOSHttpRequest httpRequest,
1826 IOSHttpResponse httpResponse)
1827 {
1828 httpResponse.StatusCode = (int)System.Net.HttpStatusCode.Gone;
1829 httpResponse.ContentType = "text/plain";
1830
1831 ScenePresence sp = m_Scene.GetScenePresence(m_AgentID);
1832 if(sp == null || sp.IsDeleted)
1833 return "";
1834
1835 if(sp.IsInTransit)
1836 {
1837 httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable;
1838 httpResponse.AddHeader("Retry-After","30");
1839 return "";
1840 }
1841
1842 NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
1843 string[] ids = query.GetValues("ids");
1844
1845
1846 Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids);
1847
1848 OSDMap osdReply = new OSDMap();
1849 OSDArray agents = new OSDArray();
1850
1851 osdReply["agents"] = agents;
1852 foreach (KeyValuePair<UUID,string> kvp in names)
1853 {
1854 if (string.IsNullOrEmpty(kvp.Value))
1855 continue;
1856 if(kvp.Key == UUID.Zero)
1857 continue;
1858
1859 string[] parts = kvp.Value.Split(new char[] {' '});
1860 OSDMap osdname = new OSDMap();
1861 if(parts[0] == "Unknown")
1862 {
1863 osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1));
1864 osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2));
1865 }
1866 else
1867 {
1868 osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8));
1869 osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1));
1870 }
1871 osdname["display_name"] = OSD.FromString(kvp.Value);
1872 osdname["legacy_first_name"] = parts[0];
1873 osdname["legacy_last_name"] = parts[1];
1874 osdname["username"] = OSD.FromString(kvp.Value);
1875 osdname["id"] = OSD.FromUUID(kvp.Key);
1876 osdname["is_display_name_default"] = OSD.FromBoolean(true);
1877
1878 agents.Add(osdname);
1879 }
1880
1881 // Full content request
1882 httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK;
1883 //httpResponse.ContentLength = ??;
1884 httpResponse.ContentType = "application/llsd+xml";
1885
1886 string reply = OSDParser.SerializeLLSDXmlString(osdReply);
1887 return reply;
1888 }
1797 } 1889 }
1798 1890
1799 public class AssetUploader 1891 public class AssetUploader
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs
deleted file mode 100644
index bf559d3..0000000
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs
+++ /dev/null
@@ -1,143 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Specialized;
31using System.Drawing;
32using System.Drawing.Imaging;
33using System.Reflection;
34using System.IO;
35using System.Web;
36using log4net;
37using Nini.Config;
38using Mono.Addins;
39using OpenMetaverse;
40using OpenMetaverse.StructuredData;
41using OpenMetaverse.Imaging;
42using OpenSim.Framework;
43using OpenSim.Framework.Servers;
44using OpenSim.Framework.Servers.HttpServer;
45using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Region.Framework.Scenes;
47using OpenSim.Services.Interfaces;
48using Caps = OpenSim.Framework.Capabilities.Caps;
49using OpenSim.Capabilities.Handlers;
50
51namespace OpenSim.Region.ClientStack.Linden
52{
53
54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetDisplayNamesModule")]
55 public class GetDisplayNamesModule : INonSharedRegionModule
56 {
57 private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59
60 protected Scene m_scene;
61 protected IUserManagement m_UserManager;
62
63 protected bool m_Enabled = false;
64
65 protected string m_URL;
66
67 #region ISharedRegionModule Members
68
69 public virtual void Initialise(IConfigSource source)
70 {
71 IConfig config = source.Configs["ClientStack.LindenCaps"];
72 if (config == null)
73 return;
74
75 m_URL = config.GetString("Cap_GetDisplayNames", string.Empty);
76 if (m_URL != string.Empty)
77 m_Enabled = true;
78 }
79
80 public virtual void AddRegion(Scene s)
81 {
82 if (!m_Enabled)
83 return;
84
85 m_scene = s;
86 }
87
88 public virtual void RemoveRegion(Scene s)
89 {
90 if (!m_Enabled)
91 return;
92
93 m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
94 m_scene = null;
95 }
96
97 public virtual void RegionLoaded(Scene s)
98 {
99 if (!m_Enabled)
100 return;
101
102 m_UserManager = m_scene.RequestModuleInterface<IUserManagement>();
103 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
104 }
105
106 public virtual void PostInitialise()
107 {
108 }
109
110 public virtual void Close() { }
111
112 public virtual string Name { get { return "GetDisplayNamesModule"; } }
113
114 public virtual Type ReplaceableInterface
115 {
116 get { return null; }
117 }
118
119 #endregion
120
121 public virtual void RegisterCaps(UUID agentID, Caps caps)
122 {
123 if (m_URL == "localhost")
124 {
125 string capUrl = "/CAPS/" + UUID.Random() + "/";
126// m_log.DebugFormat("[GET_DISPLAY_NAMES]: {0} in region {1}", capUrl, m_scene.RegionInfo.RegionName);
127 caps.RegisterHandler(
128 "GetDisplayNames",
129 new GetDisplayNamesHandler(capUrl, m_UserManager, "GetDisplayNames", agentID.ToString()));
130 }
131 else
132 {
133// m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
134 IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
135 if (handler != null)
136 handler.RegisterExternalUserCapsHandler(agentID,caps,"GetDisplayNames", m_URL);
137 else
138 caps.RegisterHandler("GetDisplayNames", m_URL);
139 }
140 }
141
142 }
143}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index 769fe28..713125c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -284,6 +284,7 @@ namespace OpenSim.Region.ClientStack.Linden
284 prim.OwnerID = AgentId; 284 prim.OwnerID = AgentId;
285 prim.GroupID = obj.GroupID; 285 prim.GroupID = obj.GroupID;
286 prim.LastOwnerID = prim.OwnerID; 286 prim.LastOwnerID = prim.OwnerID;
287 prim.RezzerID = AgentId;
287 prim.CreationDate = Util.UnixTimeSinceEpoch(); 288 prim.CreationDate = Util.UnixTimeSinceEpoch();
288 prim.Name = obj.Name; 289 prim.Name = obj.Name;
289 prim.Description = ""; 290 prim.Description = "";
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 27b7376..9954749 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
337 if (UUID.TryParse(friendID, out id)) 337 if (UUID.TryParse(friendID, out id))
338 return base.FriendshipMessage(friendID); 338 return base.FriendshipMessage(friendID);
339 339
340 return "Please confirm this friendship you made while you were away."; 340 return "Please confirm this friendship you made while you where on another HG grid";
341 } 341 }
342 342
343 protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID) 343 protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID)
@@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
456 { 456 {
457 // local grid users 457 // local grid users
458 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); 458 m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
459 DeletePreviousHGRelations(agentID, friendID);
459 base.StoreFriendships(agentID, friendID); 460 base.StoreFriendships(agentID, friendID);
460 return; 461 return;
461 } 462 }
@@ -624,6 +625,45 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
624 } 625 }
625 } 626 }
626 627
628 private void DeletePreviousHGRelations(UUID a1, UUID a2)
629 {
630 // Delete any previous friendship relations
631 FriendInfo[] finfos = null;
632 finfos = GetFriendsFromCache(a1);
633 if (finfos != null)
634 {
635 foreach (FriendInfo f in finfos)
636 {
637 if (f.TheirFlags == -1)
638 {
639 if (f.Friend.StartsWith(a2.ToString()))
640 {
641 FriendsService.Delete(a1, f.Friend);
642 // and also the converse
643 FriendsService.Delete(f.Friend, a1.ToString());
644 }
645 }
646 }
647 }
648
649 finfos = GetFriendsFromCache(a1);
650 if (finfos != null)
651 {
652 foreach (FriendInfo f in finfos)
653 {
654 if (f.TheirFlags == -1)
655 {
656 if (f.Friend.StartsWith(a1.ToString()))
657 {
658 FriendsService.Delete(a2, f.Friend);
659 // and also the converse
660 FriendsService.Delete(f.Friend, a2.ToString());
661 }
662 }
663 }
664 }
665 }
666
627 protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) 667 protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
628 { 668 {
629 Boolean agentIsLocal = true; 669 Boolean agentIsLocal = true;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 33aa7ad..a7105e2 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -2093,19 +2093,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2093 spScene.SimulationService.UpdateAgent(neighbour, agentpos); 2093 spScene.SimulationService.UpdateAgent(neighbour, agentpos);
2094 } 2094 }
2095 } 2095 }
2096 catch (ArgumentOutOfRangeException)
2097 {
2098 m_log.ErrorFormat(
2099 "[ENTITY TRANSFER MODULE]: Neighbour Regions response included the current region in the neighbour list. The following region will not display to the client: {0} for region {1} ({2}, {3}).",
2100 neighbour.ExternalHostName,
2101 neighbour.RegionHandle,
2102 neighbour.RegionLocX,
2103 neighbour.RegionLocY);
2104 }
2105 catch (Exception e) 2096 catch (Exception e)
2106 { 2097 {
2107 m_log.ErrorFormat( 2098 m_log.ErrorFormat(
2108 "[ENTITY TRANSFER MODULE]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", 2099 "[ENTITY TRANSFER MODULE]: Error creating child agent at {0} ({1} ({2}, {3}). {4}",
2109 neighbour.ExternalHostName, 2100 neighbour.ExternalHostName,
2110 neighbour.RegionHandle, 2101 neighbour.RegionHandle,
2111 neighbour.RegionLocX, 2102 neighbour.RegionLocX,
@@ -2279,24 +2270,28 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2279 /// <param name="a"></param> 2270 /// <param name="a"></param>
2280 /// <param name="regionHandle"></param> 2271 /// <param name="regionHandle"></param>
2281 /// <param name="endPoint"></param> 2272 /// <param name="endPoint"></param>
2282 private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData a, GridRegion reg, 2273 private void InformClientOfNeighbourAsync(ScenePresence sp, AgentCircuitData agentCircData, GridRegion reg,
2283 IPEndPoint endPoint, bool newAgent) 2274 IPEndPoint endPoint, bool newAgent)
2284 { 2275 {
2285 2276
2286 if (newAgent) 2277 if (newAgent)
2287 { 2278 {
2279 // we may already had lost this sp
2280 if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
2281 return;
2282
2288 Scene scene = sp.Scene; 2283 Scene scene = sp.Scene;
2289 2284
2290 m_log.DebugFormat( 2285 m_log.DebugFormat(
2291 "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})", 2286 "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
2292 sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY); 2287 sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
2293 2288
2294 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); 2289 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(agentCircData.CapsPath);
2295 2290
2296 string reason = String.Empty; 2291 string reason = String.Empty;
2297 2292
2298 EntityTransferContext ctx = new EntityTransferContext(); 2293 EntityTransferContext ctx = new EntityTransferContext();
2299 bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, a, (uint)TeleportFlags.Default, ctx, out reason); 2294 bool regionAccepted = scene.SimulationService.CreateAgent(reg, reg, agentCircData, (uint)TeleportFlags.Default, ctx, out reason);
2300 2295
2301 if (regionAccepted) 2296 if (regionAccepted)
2302 { 2297 {
@@ -2306,6 +2301,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2306 if (m_eqModule != null) 2301 if (m_eqModule != null)
2307 { 2302 {
2308 #region IP Translation for NAT 2303 #region IP Translation for NAT
2304 if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
2305 return;
2306
2309 IClientIPEndpoint ipepClient; 2307 IClientIPEndpoint ipepClient;
2310 if (sp.ClientView.TryGet(out ipepClient)) 2308 if (sp.ClientView.TryGet(out ipepClient))
2311 { 2309 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index fa7803f..771e5fe 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -981,6 +981,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
981 // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. 981 // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
982 part.LastOwnerID = part.OwnerID; 982 part.LastOwnerID = part.OwnerID;
983 part.OwnerID = remoteClient.AgentId; 983 part.OwnerID = remoteClient.AgentId;
984 part.RezzerID = remoteClient.AgentId;
984 } 985 }
985 } 986 }
986 987
@@ -1150,6 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1150 1151
1151 part.LastOwnerID = part.OwnerID; 1152 part.LastOwnerID = part.OwnerID;
1152 part.OwnerID = item.Owner; 1153 part.OwnerID = item.Owner;
1154 part.RezzerID = item.Owner;
1153 part.Inventory.ChangeInventoryOwner(item.Owner); 1155 part.Inventory.ChangeInventoryOwner(item.Owner);
1154 } 1156 }
1155 1157
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 339fc15..61ea8ac 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2624,7 +2624,8 @@ namespace OpenSim.Region.Framework.Scenes
2624 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; 2624 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
2625 } 2625 }
2626 2626
2627 group.FromPartID = sourcePart.UUID; 2627 group.RezzerID = sourcePart.UUID;
2628
2628 if( i == 0) 2629 if( i == 0)
2629 AddNewSceneObject(group, true, curpos, rot, vel); 2630 AddNewSceneObject(group, true, curpos, rot, vel);
2630 else 2631 else
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index f5f83ca..579874a 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1942,6 +1942,7 @@ namespace OpenSim.Region.Framework.Scenes
1942 else 1942 else
1943 { 1943 {
1944 part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; 1944 part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID;
1945 part.RezzerID = part.ParentGroup.RootPart.RezzerID;
1945 childParts.Add(part); 1946 childParts.Add(part);
1946 } 1947 }
1947 } 1948 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6cdbac5..e42b675 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -886,6 +886,12 @@ namespace OpenSim.Region.Framework.Scenes
886 set { m_rootPart.LastOwnerID = value; } 886 set { m_rootPart.LastOwnerID = value; }
887 } 887 }
888 888
889 public UUID RezzerID
890 {
891 get { return m_rootPart.RezzerID; }
892 set { m_rootPart.RezzerID = value; }
893 }
894
889 public UUID OwnerID 895 public UUID OwnerID
890 { 896 {
891 get { return m_rootPart.OwnerID; } 897 get { return m_rootPart.OwnerID; }
@@ -1053,7 +1059,12 @@ namespace OpenSim.Region.Framework.Scenes
1053 /// <remarks> 1059 /// <remarks>
1054 /// If not applicable will be UUID.Zero 1060 /// If not applicable will be UUID.Zero
1055 /// </remarks> 1061 /// </remarks>
1056 public UUID FromPartID { get; set; } 1062 /// obsolete use RezzerID
1063 public UUID FromPartID
1064 {
1065 get { return RezzerID; }
1066 set {RezzerID = value; }
1067 }
1057 1068
1058 /// <summary> 1069 /// <summary>
1059 /// The folder ID that this object was rezzed from, if applicable. 1070 /// The folder ID that this object was rezzed from, if applicable.
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3a06e7d..b95b5be 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -460,7 +460,7 @@ namespace OpenSim.Region.Framework.Scenes
460 m_name = "Object"; 460 m_name = "Object";
461 461
462 CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed); 462 CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
463 LastOwnerID = CreatorID = OwnerID = ownerID; 463 RezzerID = LastOwnerID = CreatorID = OwnerID = ownerID;
464 UUID = UUID.Random(); 464 UUID = UUID.Random();
465 Shape = shape; 465 Shape = shape;
466 OwnershipCost = 0; 466 OwnershipCost = 0;
@@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
484 484
485 #region XML Schema 485 #region XML Schema
486 486
487 private UUID _rezzerID;
487 private UUID _lastOwnerID; 488 private UUID _lastOwnerID;
488 private UUID _ownerID; 489 private UUID _ownerID;
489 private UUID _groupID; 490 private UUID _groupID;
@@ -1385,6 +1386,12 @@ namespace OpenSim.Region.Framework.Scenes
1385 set { _lastOwnerID = value; } 1386 set { _lastOwnerID = value; }
1386 } 1387 }
1387 1388
1389 public UUID RezzerID
1390 {
1391 get { return _rezzerID; }
1392 set { _rezzerID = value; }
1393 }
1394
1388 public uint BaseMask 1395 public uint BaseMask
1389 { 1396 {
1390 get { return _baseMask; } 1397 get { return _baseMask; }
@@ -2222,6 +2229,7 @@ namespace OpenSim.Region.Framework.Scenes
2222 2229
2223 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. 2230 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
2224 dupe.LastOwnerID = OwnerID; 2231 dupe.LastOwnerID = OwnerID;
2232 dupe.RezzerID = RezzerID;
2225 2233
2226 byte[] extraP = new byte[Shape.ExtraParams.Length]; 2234 byte[] extraP = new byte[Shape.ExtraParams.Length];
2227 Array.Copy(Shape.ExtraParams, extraP, extraP.Length); 2235 Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 7d3a168..0b7379b 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -428,6 +428,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
428 m_SOPXmlProcessors.Add("GroupID", ProcessGroupID); 428 m_SOPXmlProcessors.Add("GroupID", ProcessGroupID);
429 m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID); 429 m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID);
430 m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID); 430 m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID);
431 m_SOPXmlProcessors.Add("RezzerID", ProcessRezzerID);
431 m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask); 432 m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask);
432 m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask); 433 m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask);
433 m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask); 434 m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask);
@@ -864,6 +865,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
864 obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID"); 865 obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
865 } 866 }
866 867
868 private static void ProcessRezzerID(SceneObjectPart obj, XmlReader reader)
869 {
870 obj.RezzerID = Util.ReadUUID(reader, "RezzerID");
871 }
872
867 private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader) 873 private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader)
868 { 874 {
869 obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty); 875 obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty);
@@ -1452,6 +1458,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1452 UUID lastOwnerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.LastOwnerID; 1458 UUID lastOwnerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.LastOwnerID;
1453 WriteUUID(writer, "LastOwnerID", lastOwnerID, options); 1459 WriteUUID(writer, "LastOwnerID", lastOwnerID, options);
1454 1460
1461 UUID rezzerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.RezzerID;
1462 WriteUUID(writer, "RezzerID", rezzerID, options);
1463
1455 writer.WriteElementString("BaseMask", sop.BaseMask.ToString()); 1464 writer.WriteElementString("BaseMask", sop.BaseMask.ToString());
1456 writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString()); 1465 writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString());
1457 writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); 1466 writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index e7d461f..7a0370a 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -783,7 +783,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
783 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; 783 group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
784 } 784 }
785 785
786 group.FromPartID = host.RootPart.UUID; 786 group.RezzerID = host.RootPart.UUID;
787 m_scene.AddNewSceneObject(group, true, curpos, rot, vel); 787 m_scene.AddNewSceneObject(group, true, curpos, rot, vel);
788 788
789 UUID storeID = group.UUID; 789 UUID storeID = group.UUID;
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
index 2f97caf..51d067a 100644
--- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
+++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
@@ -718,8 +718,8 @@ namespace PrimMesher
718 } 718 }
719 719
720 newFace.v1 = 0; 720 newFace.v1 = 0;
721 newFace.v2 = numTotalVerts - numHollowVerts; 721 newFace.v2 = numTotalVerts - 1;
722 newFace.v3 = numTotalVerts - 1; 722 newFace.v3 = numTotalVerts - numHollowVerts;
723 faces.Add(newFace); 723 faces.Add(newFace);
724 } 724 }
725 } 725 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9c8d40a..71e8ca9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6303,6 +6303,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6303 IUrlModule UrlModule = World.RequestModuleInterface<IUrlModule>(); 6303 IUrlModule UrlModule = World.RequestModuleInterface<IUrlModule>();
6304 return UrlModule.ExternalHostNameForLSL; 6304 return UrlModule.ExternalHostNameForLSL;
6305 } 6305 }
6306 else if (name == "region_max_prims")
6307 {
6308 return World.RegionInfo.ObjectCapacity.ToString();
6309 }
6306 else 6310 else
6307 { 6311 {
6308 return ""; 6312 return "";
@@ -13789,6 +13793,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13789 } catch { }; 13793 } catch { };
13790 ret.Add(new LSL_Integer(invcount)); 13794 ret.Add(new LSL_Integer(invcount));
13791 break; 13795 break;
13796 case ScriptBaseClass.OBJECT_REZZER_KEY:
13797 ret.Add(new LSL_Key(id));
13798 break;
13792 case ScriptBaseClass.OBJECT_GROUP_TAG: 13799 case ScriptBaseClass.OBJECT_GROUP_TAG:
13793 ret.Add(new LSL_String(av.Grouptitle)); 13800 ret.Add(new LSL_String(av.Grouptitle));
13794 break; 13801 break;
@@ -13984,6 +13991,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13984 count += parts[i].Inventory.Count; 13991 count += parts[i].Inventory.Count;
13985 ret.Add(new LSL_Integer(count)); 13992 ret.Add(new LSL_Integer(count));
13986 break; 13993 break;
13994 case ScriptBaseClass.OBJECT_REZZER_KEY:
13995 ret.Add(new LSL_Key(obj.ParentGroup.RezzerID.ToString()));
13996 break;
13987 case ScriptBaseClass.OBJECT_GROUP_TAG: 13997 case ScriptBaseClass.OBJECT_GROUP_TAG:
13988 ret.Add(new LSL_String(String.Empty)); 13998 ret.Add(new LSL_String(String.Empty));
13989 break; 13999 break;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index a21a0ca..19f2d09 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4030,8 +4030,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4030 { 4030 {
4031 CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); 4031 CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject");
4032 m_host.AddScriptLPS(1); 4032 m_host.AddScriptLPS(1);
4033 4033 UUID rezID = m_host.ParentGroup.RezzerID;
4034 return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); 4034 if(rezID == UUID.Zero || m_host.ParentGroup.Scene.GetScenePresence(rezID) != null)
4035 return new LSL_Key(UUID.Zero.ToString());
4036 return new LSL_Key(rezID.ToString());
4035 } 4037 }
4036 4038
4037 /// <summary> 4039 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 48afcc0..734d878 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -640,6 +640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
640 public const int OBJECT_OMEGA = 29; 640 public const int OBJECT_OMEGA = 29;
641 public const int OBJECT_PRIM_COUNT = 30; 641 public const int OBJECT_PRIM_COUNT = 30;
642 public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; 642 public const int OBJECT_TOTAL_INVENTORY_COUNT = 31;
643 public const int OBJECT_REZZER_KEY = 32;
643 public const int OBJECT_GROUP_TAG = 33; 644 public const int OBJECT_GROUP_TAG = 33;
644 public const int OBJECT_TEMP_ATTACHED = 34; 645 public const int OBJECT_TEMP_ATTACHED = 34;
645 646