aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs2
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAvatarData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGridUserData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLManager.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLPresenceData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLXInventoryData.cs4
-rw-r--r--OpenSim/Framework/IClientAPI.cs12
-rw-r--r--OpenSim/Framework/ILandChannel.cs (renamed from OpenSim/Region/Framework/Interfaces/ILandChannel.cs)0
-rw-r--r--OpenSim/Framework/ILandObject.cs (renamed from OpenSim/Region/Framework/Interfaces/ILandObject.cs)7
-rw-r--r--OpenSim/Framework/IPrimCounts.cs74
-rw-r--r--OpenSim/Framework/RegionInfo.cs18
-rw-r--r--OpenSim/Region/Application/OpenSim.cs2
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs9
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs65
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs735
-rw-r--r--OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs170
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs193
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs6
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs292
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs9
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs10
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs37
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
-rw-r--r--bin/config-include/GridCommon.ini.example6
-rw-r--r--bin/config-include/StandaloneCommon.ini.example5
51 files changed, 1108 insertions, 701 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 1d93382..93c6c98 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -1252,7 +1252,7 @@ namespace OpenSim.Client.MXP.ClientStack
1252 // Need to translate to MXP somehow 1252 // Need to translate to MXP somehow
1253 } 1253 }
1254 1254
1255 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 1255 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
1256 { 1256 {
1257 // Need to translate to MXP somehow 1257 // Need to translate to MXP somehow
1258 } 1258 }
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index f2b58d3..fc27f01 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -799,7 +799,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
799 throw new System.NotImplementedException(); 799 throw new System.NotImplementedException();
800 } 800 }
801 801
802 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 802 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
803 { 803 {
804 throw new System.NotImplementedException(); 804 throw new System.NotImplementedException();
805 } 805 }
diff --git a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs
index 49a6b09..301b424 100644
--- a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
43 public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>, 43 public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>,
44 IAvatarData 44 IAvatarData
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 public MSSQLAvatarData(string connectionString, string realm) : 48 public MSSQLAvatarData(string connectionString, string realm) :
49 base(connectionString, realm, "Avatar") 49 base(connectionString, realm, "Avatar")
diff --git a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
index 904366e..6a5d6eb 100644
--- a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
40{ 40{
41 public class MSSQLGenericTableHandler<T> where T : class, new() 41 public class MSSQLGenericTableHandler<T> where T : class, new()
42 { 42 {
43 private static readonly ILog m_log = 43// private static readonly ILog m_log =
44 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 protected string m_ConnectionString; 46 protected string m_ConnectionString;
47 protected MSSQLManager m_database; //used for parameter type translation 47 protected MSSQLManager m_database; //used for parameter type translation
diff --git a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
index 1870273..9e215f9 100644
--- a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
43 public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>, 43 public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>,
44 IGridUserData 44 IGridUserData
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 public MSSQLGridUserData(string connectionString, string realm) : 48 public MSSQLGridUserData(string connectionString, string realm) :
49 base(connectionString, realm, "GridUserStore") 49 base(connectionString, realm, "GridUserStore")
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs
index 575fd21..cf963e3 100644
--- a/OpenSim/Data/MSSQL/MSSQLManager.cs
+++ b/OpenSim/Data/MSSQL/MSSQLManager.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Data.MSSQL
41 /// </summary> 41 /// </summary>
42 public class MSSQLManager 42 public class MSSQLManager
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 /// <summary> 46 /// <summary>
47 /// Connection string for ADO.net 47 /// Connection string for ADO.net
@@ -180,8 +180,6 @@ namespace OpenSim.Data.MSSQL
180 return parameter; 180 return parameter;
181 } 181 }
182 182
183 private static readonly Dictionary<string, string> emptyDictionary = new Dictionary<string, string>();
184
185 /// <summary> 183 /// <summary>
186 /// Checks if we need to do some migrations to the database 184 /// Checks if we need to do some migrations to the database
187 /// </summary> 185 /// </summary>
diff --git a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs
index e7b3d9c..8068d23 100644
--- a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
43 public class MSSQLPresenceData : MSSQLGenericTableHandler<PresenceData>, 43 public class MSSQLPresenceData : MSSQLGenericTableHandler<PresenceData>,
44 IPresenceData 44 IPresenceData
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 public MSSQLPresenceData(string connectionString, string realm) : 48 public MSSQLPresenceData(string connectionString, string realm) :
49 base(connectionString, realm, "Presence") 49 base(connectionString, realm, "Presence")
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
index 739eb55..5bc4fe4 100644
--- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
40{ 40{
41 public class MSSQLXInventoryData : IXInventoryData 41 public class MSSQLXInventoryData : IXInventoryData
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger( 43// private static readonly ILog m_log = LogManager.GetLogger(
44 MethodBase.GetCurrentMethod().DeclaringType); 44// MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private MSSQLGenericTableHandler<XInventoryFolder> m_Folders; 46 private MSSQLGenericTableHandler<XInventoryFolder> m_Folders;
47 private MSSQLItemHandler m_Items; 47 private MSSQLItemHandler m_Items;
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index a6be157..5bf0b7b 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1143,7 +1143,17 @@ namespace OpenSim.Framework
1143 void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, 1143 void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags,
1144 uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner); 1144 uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner);
1145 1145
1146 void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, 1146 /// <summary>
1147 /// Send land properties to the client.
1148 /// </summary>
1149 /// <param name="sequence_id"></param>
1150 /// <param name="snap_selection"></param>
1151 /// <param name="request_result"></param>
1152 /// <param name="lo"></param></param>
1153 /// <param name="parcelObjectCapacity">/param>
1154 /// <param name="simObjectCapacity"></param>
1155 /// <param name="regionFlags"></param>
1156 void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo,
1147 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, 1157 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity,
1148 uint regionFlags); 1158 uint regionFlags);
1149 1159
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs
index 30bae16..30bae16 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ b/OpenSim/Framework/ILandChannel.cs
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Framework/ILandObject.cs
index 9c0abde..931e24a 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Framework/ILandObject.cs
@@ -27,10 +27,8 @@
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes;
32 30
33namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Framework
34{ 32{
35 public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj); 33 public delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj);
36 public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj); 34 public delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj);
@@ -90,11 +88,8 @@ namespace OpenSim.Region.Framework.Interfaces
90 bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add); 88 bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add);
91 void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client); 89 void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client);
92 void SendLandObjectOwners(IClientAPI remote_client); 90 void SendLandObjectOwners(IClientAPI remote_client);
93 void ReturnObject(SceneObjectGroup obj);
94 void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client); 91 void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client);
95 void ResetLandPrimCounts(); 92 void ResetLandPrimCounts();
96 void AddPrimToCount(SceneObjectGroup obj);
97 void RemovePrimFromCount(SceneObjectGroup obj);
98 void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); 93 void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
99 94
100 void DeedToGroup(UUID groupID); 95 void DeedToGroup(UUID groupID);
diff --git a/OpenSim/Framework/IPrimCounts.cs b/OpenSim/Framework/IPrimCounts.cs
new file mode 100644
index 0000000..3e12348
--- /dev/null
+++ b/OpenSim/Framework/IPrimCounts.cs
@@ -0,0 +1,74 @@
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 OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public interface IPrimCounts
33 {
34 /// <summary>
35 /// Parcel owner owned prims
36 /// </summary>
37 int Owner { get; }
38
39 /// <summary>
40 /// Parcel group owned prims
41 /// </summary>
42 int Group { get; }
43
44 /// <summary>
45 /// Prims owned by others (not parcel owner or parcel group).
46 /// </summary>
47 int Others { get; }
48
49 /// <summary>
50 /// Selected prims
51 /// </summary>
52 int Selected { get; }
53
54 /// <summary>
55 /// Total prims on the parcel.
56 /// </summary>
57 int Total { get; }
58
59 /// <summary>
60 /// Prims on the simulator that are owned by the parcel owner, even if they are in other parcels.
61 /// </summary>
62 int Simulator { get; }
63
64 /// <summary>
65 /// Prims per individual users.
66 /// </summary>
67 IUserPrimCounts Users { get; }
68 }
69
70 public interface IUserPrimCounts
71 {
72 int this[UUID agentID] { get; }
73 }
74} \ No newline at end of file
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 680e702..daf0a25 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -347,7 +347,6 @@ namespace OpenSim.Framework
347 347
348 public bool commFailTF = false; 348 public bool commFailTF = false;
349 public ConfigurationMember configMember; 349 public ConfigurationMember configMember;
350 public string DataStore = String.Empty;
351 public string RegionFile = String.Empty; 350 public string RegionFile = String.Empty;
352 public bool isSandbox = false; 351 public bool isSandbox = false;
353 public bool Persistent = true; 352 public bool Persistent = true;
@@ -746,10 +745,6 @@ namespace OpenSim.Framework
746 m_regionLocX = Convert.ToUInt32(locationElements[0]); 745 m_regionLocX = Convert.ToUInt32(locationElements[0]);
747 m_regionLocY = Convert.ToUInt32(locationElements[1]); 746 m_regionLocY = Convert.ToUInt32(locationElements[1]);
748 747
749
750 // Datastore (is this implemented? Omitted from example!)
751 DataStore = config.GetString("Datastore", String.Empty);
752
753 // Internal IP 748 // Internal IP
754 IPAddress address; 749 IPAddress address;
755 750
@@ -846,9 +841,6 @@ namespace OpenSim.Framework
846 string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY); 841 string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY);
847 config.Set("Location", location); 842 config.Set("Location", location);
848 843
849 if (DataStore != String.Empty)
850 config.Set("Datastore", DataStore);
851
852 config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); 844 config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
853 config.Set("InternalPort", m_internalEndPoint.Port); 845 config.Set("InternalPort", m_internalEndPoint.Port);
854 846
@@ -1025,9 +1017,6 @@ namespace OpenSim.Framework
1025 case "sim_location_y": 1017 case "sim_location_y":
1026 m_regionLocY = (uint) configuration_result; 1018 m_regionLocY = (uint) configuration_result;
1027 break; 1019 break;
1028 case "datastore":
1029 DataStore = (string) configuration_result;
1030 break;
1031 case "internal_ip_address": 1020 case "internal_ip_address":
1032 IPAddress address = (IPAddress) configuration_result; 1021 IPAddress address = (IPAddress) configuration_result;
1033 m_internalEndPoint = new IPEndPoint(address, 0); 1022 m_internalEndPoint = new IPEndPoint(address, 0);
@@ -1175,11 +1164,6 @@ namespace OpenSim.Framework
1175 return regionInfo; 1164 return regionInfo;
1176 } 1165 }
1177 1166
1178 public int getInternalEndPointPort()
1179 {
1180 return m_internalEndPoint.Port;
1181 }
1182
1183 public Dictionary<string, object> ToKeyValuePairs() 1167 public Dictionary<string, object> ToKeyValuePairs()
1184 { 1168 {
1185 Dictionary<string, object> kvp = new Dictionary<string, object>(); 1169 Dictionary<string, object> kvp = new Dictionary<string, object>();
@@ -1198,4 +1182,4 @@ namespace OpenSim.Framework
1198 return kvp; 1182 return kvp;
1199 } 1183 }
1200 } 1184 }
1201} 1185} \ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 4081888..ec1fb04 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -123,7 +123,7 @@ namespace OpenSim
123 m_log.Info("===================================================================="); 123 m_log.Info("====================================================================");
124 m_log.Info("========================= STARTING OPENSIM ========================="); 124 m_log.Info("========================= STARTING OPENSIM =========================");
125 m_log.Info("===================================================================="); 125 m_log.Info("====================================================================");
126 m_log.InfoFormat("[OPENSIM MAIN]: Running "); 126
127 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); 127 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
128 // http://msdn.microsoft.com/en-us/library/bb384202.aspx 128 // http://msdn.microsoft.com/en-us/library/bb384202.aspx
129 //GCSettings.LatencyMode = GCLatencyMode.Batch; 129 //GCSettings.LatencyMode = GCLatencyMode.Batch;
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 6405811..ea9edf6 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -860,7 +860,7 @@ namespace OpenSim
860 = MainConsole.Instance.CmdPrompt( 860 = MainConsole.Instance.CmdPrompt(
861 string.Format( 861 string.Format(
862 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 862 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
863 "no", 863 "yes",
864 new List<string>() { "yes", "no" }); 864 new List<string>() { "yes", "no" });
865 865
866 if (response == "no") 866 if (response == "no")
@@ -876,15 +876,12 @@ namespace OpenSim
876 = MainConsole.Instance.CmdPrompt( 876 = MainConsole.Instance.CmdPrompt(
877 string.Format( 877 string.Format(
878 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), 878 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
879 "None"); 879 estateNames[0]);
880
881 if (response == "None")
882 continue;
883 880
884 List<int> estateIDs = EstateDataService.GetEstates(response); 881 List<int> estateIDs = EstateDataService.GetEstates(response);
885 if (estateIDs.Count < 1) 882 if (estateIDs.Count < 1)
886 { 883 {
887 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); 884 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
888 continue; 885 continue;
889 } 886 }
890 887
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index db149a1..e9e1fa3 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4351,8 +4351,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4351 OutPacket(packet, ThrottleOutPacketType.Task); 4351 OutPacket(packet, ThrottleOutPacketType.Task);
4352 } 4352 }
4353 4353
4354 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 4354 public void SendLandProperties(
4355 int sequence_id, bool snap_selection, int request_result, ILandObject lo,
4356 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
4355 { 4357 {
4358// m_log.DebugFormat("[LLCLIENTVIEW]: Sending land properties for {0} to {1}", lo.LandData.GlobalID, Name);
4359
4360 LandData landData = lo.LandData;
4361
4356 ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage(); 4362 ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage();
4357 4363
4358 updateMessage.AABBMax = landData.AABBMax; 4364 updateMessage.AABBMax = landData.AABBMax;
@@ -4360,15 +4366,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4360 updateMessage.Area = landData.Area; 4366 updateMessage.Area = landData.Area;
4361 updateMessage.AuctionID = landData.AuctionID; 4367 updateMessage.AuctionID = landData.AuctionID;
4362 updateMessage.AuthBuyerID = landData.AuthBuyerID; 4368 updateMessage.AuthBuyerID = landData.AuthBuyerID;
4363
4364 updateMessage.Bitmap = landData.Bitmap; 4369 updateMessage.Bitmap = landData.Bitmap;
4365
4366 updateMessage.Desc = landData.Description; 4370 updateMessage.Desc = landData.Description;
4367 updateMessage.Category = landData.Category; 4371 updateMessage.Category = landData.Category;
4368 updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate); 4372 updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate);
4369 updateMessage.ClaimPrice = landData.ClaimPrice; 4373 updateMessage.ClaimPrice = landData.ClaimPrice;
4370 updateMessage.GroupID = landData.GroupID; 4374 updateMessage.GroupID = landData.GroupID;
4371 updateMessage.GroupPrims = landData.GroupPrims;
4372 updateMessage.IsGroupOwned = landData.IsGroupOwned; 4375 updateMessage.IsGroupOwned = landData.IsGroupOwned;
4373 updateMessage.LandingType = (LandingType) landData.LandingType; 4376 updateMessage.LandingType = (LandingType) landData.LandingType;
4374 updateMessage.LocalID = landData.LocalID; 4377 updateMessage.LocalID = landData.LocalID;
@@ -4389,9 +4392,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4389 updateMessage.Name = landData.Name; 4392 updateMessage.Name = landData.Name;
4390 updateMessage.OtherCleanTime = landData.OtherCleanTime; 4393 updateMessage.OtherCleanTime = landData.OtherCleanTime;
4391 updateMessage.OtherCount = 0; //TODO: Unimplemented 4394 updateMessage.OtherCount = 0; //TODO: Unimplemented
4392 updateMessage.OtherPrims = landData.OtherPrims; 4395 updateMessage.OwnerID = landData.OwnerID;
4393 updateMessage.OwnerID = landData.OwnerID;
4394 updateMessage.OwnerPrims = landData.OwnerPrims;
4395 updateMessage.ParcelFlags = (ParcelFlags) landData.Flags; 4396 updateMessage.ParcelFlags = (ParcelFlags) landData.Flags;
4396 updateMessage.ParcelPrimBonus = simObjectBonusFactor; 4397 updateMessage.ParcelPrimBonus = simObjectBonusFactor;
4397 updateMessage.PassHours = landData.PassHours; 4398 updateMessage.PassHours = landData.PassHours;
@@ -4406,10 +4407,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4406 4407
4407 updateMessage.RentPrice = 0; 4408 updateMessage.RentPrice = 0;
4408 updateMessage.RequestResult = (ParcelResult) request_result; 4409 updateMessage.RequestResult = (ParcelResult) request_result;
4409 updateMessage.SalePrice = landData.SalePrice; 4410 updateMessage.SalePrice = landData.SalePrice;
4410 updateMessage.SelectedPrims = landData.SelectedPrims;
4411 updateMessage.SelfCount = 0; //TODO: Unimplemented 4411 updateMessage.SelfCount = 0; //TODO: Unimplemented
4412 updateMessage.SequenceID = sequence_id; 4412 updateMessage.SequenceID = sequence_id;
4413
4413 if (landData.SimwideArea > 0) 4414 if (landData.SimwideArea > 0)
4414 { 4415 {
4415 int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); 4416 int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
@@ -4419,22 +4420,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4419 { 4420 {
4420 updateMessage.SimWideMaxPrims = 0; 4421 updateMessage.SimWideMaxPrims = 0;
4421 } 4422 }
4422 updateMessage.SimWideTotalPrims = landData.SimwidePrims; 4423
4423 updateMessage.SnapSelection = snap_selection; 4424 updateMessage.SnapSelection = snap_selection;
4424 updateMessage.SnapshotID = landData.SnapshotID; 4425 updateMessage.SnapshotID = landData.SnapshotID;
4425 updateMessage.Status = (ParcelStatus) landData.Status; 4426 updateMessage.Status = (ParcelStatus) landData.Status;
4426 updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + 4427 updateMessage.UserLocation = landData.UserLocation;
4427 landData.SelectedPrims; 4428 updateMessage.UserLookAt = landData.UserLookAt;
4428 updateMessage.UserLocation = landData.UserLocation; 4429
4429 updateMessage.UserLookAt = landData.UserLookAt; 4430 updateMessage.MediaType = landData.MediaType;
4430 4431 updateMessage.MediaDesc = landData.MediaDescription;
4431 updateMessage.MediaType = landData.MediaType; 4432 updateMessage.MediaWidth = landData.MediaWidth;
4432 updateMessage.MediaDesc = landData.MediaDescription; 4433 updateMessage.MediaHeight = landData.MediaHeight;
4433 updateMessage.MediaWidth = landData.MediaWidth; 4434 updateMessage.MediaLoop = landData.MediaLoop;
4434 updateMessage.MediaHeight = landData.MediaHeight; 4435 updateMessage.ObscureMusic = landData.ObscureMusic;
4435 updateMessage.MediaLoop = landData.MediaLoop; 4436 updateMessage.ObscureMedia = landData.ObscureMedia;
4436 updateMessage.ObscureMusic = landData.ObscureMusic; 4437
4437 updateMessage.ObscureMedia = landData.ObscureMedia; 4438 IPrimCounts pc = lo.PrimCounts;
4439 updateMessage.OwnerPrims = pc.Owner;
4440 updateMessage.GroupPrims = pc.Group;
4441 updateMessage.OtherPrims = pc.Others;
4442 updateMessage.SelectedPrims = pc.Selected;
4443 updateMessage.TotalPrims = pc.Total;
4444 updateMessage.SimWideTotalPrims = pc.Simulator;
4438 4445
4439 try 4446 try
4440 { 4447 {
@@ -4442,13 +4449,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4442 if (eq != null) 4449 if (eq != null)
4443 { 4450 {
4444 eq.ParcelProperties(updateMessage, this.AgentId); 4451 eq.ParcelProperties(updateMessage, this.AgentId);
4445 } else { 4452 }
4446 m_log.Warn("No EQ Interface when sending parcel data."); 4453 else
4454 {
4455 m_log.Warn("[LLCLIENTVIEW]: No EQ Interface when sending parcel data.");
4447 } 4456 }
4448 } 4457 }
4449 catch (Exception ex) 4458 catch (Exception ex)
4450 { 4459 {
4451 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); 4460 m_log.Error("[LLCLIENTVIEW]: Unable to send parcel data via eventqueue - exception: " + ex.ToString());
4452 } 4461 }
4453 } 4462 }
4454 4463
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 65a8fe3..9a8bfd3 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
149 /// <summary>Caches packed throttle information</summary> 149 /// <summary>Caches packed throttle information</summary>
150 private byte[] m_packedThrottles; 150 private byte[] m_packedThrottles;
151 151
152 private int m_defaultRTO = 3000; 152 private int m_defaultRTO = 1000; // 1sec is the recommendation in the RFC
153 private int m_maxRTO = 60000; 153 private int m_maxRTO = 60000;
154 154
155 /// <summary> 155 /// <summary>
@@ -557,7 +557,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
557 int rto = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR)); 557 int rto = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR));
558 558
559 // Clamp the retransmission timeout to manageable values 559 // Clamp the retransmission timeout to manageable values
560 rto = Utils.Clamp(RTO, m_defaultRTO, m_maxRTO); 560 rto = Utils.Clamp(rto, m_defaultRTO, m_maxRTO);
561 561
562 RTO = rto; 562 RTO = rto;
563 563
diff --git a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
index d2779ba..6eebd9d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
@@ -100,6 +100,10 @@ namespace OpenMetaverse
100 const int SIO_UDP_CONNRESET = -1744830452; 100 const int SIO_UDP_CONNRESET = -1744830452;
101 101
102 IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort); 102 IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort);
103
104 m_log.DebugFormat(
105 "[UDPBASE]: Binding UDP listener using internal IP address config {0}:{1}",
106 ipep.Address, ipep.Port);
103 107
104 m_udpSocket = new Socket( 108 m_udpSocket = new Socket(
105 AddressFamily.InterNetwork, 109 AddressFamily.InterNetwork,
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index a5fcb49..0babeb5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Nini.Config; 30using Nini.Config;
31using OpenSim.Framework;
31using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
33using OpenMetaverse; 34using OpenMetaverse;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 9b98de3..01170aa 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -77,7 +77,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
77 /// </value> 77 /// </value>
78 private Stream m_loadStream; 78 private Stream m_loadStream;
79 79
80 protected bool m_controlFileLoaded; 80 /// <summary>
81 /// FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
82 /// (I thought they weren't). We will need to bump the version number and perform this check on all
83 /// subsequent IAR versions only
84 /// </summary>
85 protected bool m_controlFileLoaded = true;
81 protected bool m_assetsLoaded; 86 protected bool m_assetsLoaded;
82 protected bool m_inventoryNodesLoaded; 87 protected bool m_inventoryNodesLoaded;
83 88
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 798547a..9fbfc34 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Xml;
31using System.Reflection; 32using System.Reflection;
32using System.Threading; 33using System.Threading;
33 34
@@ -205,11 +206,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
205 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 206 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
206 List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) 207 List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
207 { 208 {
208 // HACK: This is only working for lists containing a single item!
209 // It's just a hack to make this WIP compile and run. Nothing
210 // currently calls this with multiple items.
211 UUID ret = UUID.Zero; 209 UUID ret = UUID.Zero;
212 210
211 // The following code groups the SOG's by owner. No objects
212 // belonging to different people can be coalesced, for obvious
213 // reasons.
213 Dictionary<UUID, List<SceneObjectGroup>> deletes = 214 Dictionary<UUID, List<SceneObjectGroup>> deletes =
214 new Dictionary<UUID, List<SceneObjectGroup>>(); 215 new Dictionary<UUID, List<SceneObjectGroup>>();
215 216
@@ -221,262 +222,329 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
221 deletes[g.OwnerID].Add(g); 222 deletes[g.OwnerID].Add(g);
222 } 223 }
223 224
225 // This is pethod scoped and will be returned. It will be the
226 // last created asset id
227 UUID assetID = UUID.Zero;
228
229 // Each iteration is really a separate asset being created,
230 // with distinct destinations as well.
224 foreach (List<SceneObjectGroup> objlist in deletes.Values) 231 foreach (List<SceneObjectGroup> objlist in deletes.Values)
225 { 232 {
226 foreach (SceneObjectGroup g in objlist) 233 Dictionary<UUID, string> xmlStrings =
227 ret = DeleteToInventory(action, folderID, g, remoteClient); 234 new Dictionary<UUID, string>();
228 }
229 235
230 return ret; 236 foreach (SceneObjectGroup objectGroup in objlist)
231 } 237 {
238 Vector3 inventoryStoredPosition = new Vector3
239 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
240 ? 250
241 : objectGroup.AbsolutePosition.X)
242 ,
243 (objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
244 ? 250
245 : objectGroup.AbsolutePosition.X,
246 objectGroup.AbsolutePosition.Z);
232 247
233 private UUID DeleteToInventory(DeRezAction action, UUID folderID, 248 Vector3 originalPosition = objectGroup.AbsolutePosition;
234 SceneObjectGroup objectGroup, IClientAPI remoteClient)
235 {
236 UUID assetID = UUID.Zero;
237 249
238 Vector3 inventoryStoredPosition = new Vector3 250 objectGroup.AbsolutePosition = inventoryStoredPosition;
239 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
240 ? 250
241 : objectGroup.AbsolutePosition.X)
242 ,
243 (objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
244 ? 250
245 : objectGroup.AbsolutePosition.X,
246 objectGroup.AbsolutePosition.Z);
247 251
248 Vector3 originalPosition = objectGroup.AbsolutePosition; 252 // Make sure all bits but the ones we want are clear
253 // on take.
254 // This will be applied to the current perms, so
255 // it will do what we want.
256 objectGroup.RootPart.NextOwnerMask &=
257 ((uint)PermissionMask.Copy |
258 (uint)PermissionMask.Transfer |
259 (uint)PermissionMask.Modify);
260 objectGroup.RootPart.NextOwnerMask |=
261 (uint)PermissionMask.Move;
249 262
250 objectGroup.AbsolutePosition = inventoryStoredPosition; 263 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
251 264
252 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); 265 objectGroup.AbsolutePosition = originalPosition;
253 266
254 objectGroup.AbsolutePosition = originalPosition; 267 xmlStrings[objectGroup.UUID] = sceneObjectXml;
268 }
255 269
256 // Get the user info of the item destination 270 string itemXml;
257 //
258 UUID userID = UUID.Zero;
259 271
260 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || 272 if (objlist.Count > 1)
261 action == DeRezAction.SaveToExistingUserInventoryItem) 273 {
262 { 274 float minX, minY, minZ;
263 // Take or take copy require a taker 275 float maxX, maxY, maxZ;
264 // Saving changes requires a local user
265 //
266 if (remoteClient == null)
267 return UUID.Zero;
268 276
269 userID = remoteClient.AgentId; 277 Vector3[] offsets = m_Scene.GetCombinedBoundingBox(objlist,
270 } 278 out minX, out maxX, out minY, out maxY,
271 else 279 out minZ, out maxZ);
272 {
273 // All returns / deletes go to the object owner
274 //
275 280
276 userID = objectGroup.RootPart.OwnerID; 281 // CreateWrapper
277 } 282 XmlDocument itemDoc = new XmlDocument();
283 XmlElement root = itemDoc.CreateElement("", "CoalescedObject", "");
284 itemDoc.AppendChild(root);
278 285
279 if (userID == UUID.Zero) // Can't proceed 286 // Embed the offsets into the group XML
280 { 287 for ( int i = 0 ; i < objlist.Count ; i++ )
281 return UUID.Zero; 288 {
282 } 289 XmlDocument doc = new XmlDocument();
290 SceneObjectGroup g = objlist[i];
291 doc.LoadXml(xmlStrings[g.UUID]);
292 XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup");
293 e.SetAttribute("offsetx", offsets[i].X.ToString());
294 e.SetAttribute("offsety", offsets[i].Y.ToString());
295 e.SetAttribute("offsetz", offsets[i].Z.ToString());
296
297 XmlNode objectNode = itemDoc.ImportNode(e, true);
298 root.AppendChild(objectNode);
299 }
283 300
284 // If we're returning someone's item, it goes back to the 301 float sizeX = maxX - minX;
285 // owner's Lost And Found folder. 302 float sizeY = maxY - minY;
286 // Delete is treated like return in this case 303 float sizeZ = maxZ - minZ;
287 // Deleting your own items makes them go to trash
288 //
289 304
290 InventoryFolderBase folder = null; 305 root.SetAttribute("x", sizeX.ToString());
291 InventoryItemBase item = null; 306 root.SetAttribute("y", sizeY.ToString());
307 root.SetAttribute("z", sizeZ.ToString());
292 308
293 if (DeRezAction.SaveToExistingUserInventoryItem == action) 309 itemXml = itemDoc.InnerXml;
294 { 310 }
295 item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID); 311 else
296 item = m_Scene.InventoryService.GetItem(item); 312 {
313 itemXml = xmlStrings[objlist[0].UUID];
314 }
297 315
298 //item = userInfo.RootFolder.FindItem( 316 // Get the user info of the item destination
299 // objectGroup.RootPart.FromUserInventoryItemID); 317 //
318 UUID userID = UUID.Zero;
300 319
301 if (null == item) 320 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
321 action == DeRezAction.SaveToExistingUserInventoryItem)
322 {
323 // Take or take copy require a taker
324 // Saving changes requires a local user
325 //
326 if (remoteClient == null)
327 return UUID.Zero;
328
329 userID = remoteClient.AgentId;
330 }
331 else
332 {
333 // All returns / deletes go to the object owner
334 //
335
336 userID = objlist[0].RootPart.OwnerID;
337 }
338
339 if (userID == UUID.Zero) // Can't proceed
302 { 340 {
303 m_log.DebugFormat(
304 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
305 objectGroup.Name, objectGroup.UUID);
306 return UUID.Zero; 341 return UUID.Zero;
307 } 342 }
308 } 343
309 else 344 // If we're returning someone's item, it goes back to the
310 { 345 // owner's Lost And Found folder.
311 // Folder magic 346 // Delete is treated like return in this case
347 // Deleting your own items makes them go to trash
312 // 348 //
313 if (action == DeRezAction.Delete) 349
350 InventoryFolderBase folder = null;
351 InventoryItemBase item = null;
352
353 if (DeRezAction.SaveToExistingUserInventoryItem == action)
314 { 354 {
315 // Deleting someone else's item 355 item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID);
316 // 356 item = m_Scene.InventoryService.GetItem(item);
317 if (remoteClient == null ||
318 objectGroup.OwnerID != remoteClient.AgentId)
319 {
320 357
321 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 358 //item = userInfo.RootFolder.FindItem(
322 } 359 // objectGroup.RootPart.FromUserInventoryItemID);
323 else 360
361 if (null == item)
324 { 362 {
325 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); 363 m_log.DebugFormat(
364 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
365 objlist[0].Name, objlist[0].UUID);
366 return UUID.Zero;
326 } 367 }
327 } 368 }
328 else if (action == DeRezAction.Return) 369 else
329 { 370 {
330 371 // Folder magic
331 // Dump to lost + found unconditionally
332 // 372 //
333 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
334 }
335
336 if (folderID == UUID.Zero && folder == null)
337 {
338 if (action == DeRezAction.Delete) 373 if (action == DeRezAction.Delete)
339 { 374 {
340 // Deletes go to trash by default 375 // Deleting someone else's item
341 // 376 //
342 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
343 }
344 else
345 {
346 if (remoteClient == null || 377 if (remoteClient == null ||
347 objectGroup.OwnerID != remoteClient.AgentId) 378 objlist[0].OwnerID != remoteClient.AgentId)
348 { 379 {
349 // Taking copy of another person's item. Take to 380
350 // Objects folder. 381 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
351 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
352 } 382 }
353 else 383 else
354 { 384 {
355 // Catch all. Use lost & found 385 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
386 }
387 }
388 else if (action == DeRezAction.Return)
389 {
390
391 // Dump to lost + found unconditionally
392 //
393 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
394 }
395
396 if (folderID == UUID.Zero && folder == null)
397 {
398 if (action == DeRezAction.Delete)
399 {
400 // Deletes go to trash by default
356 // 401 //
402 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
403 }
404 else
405 {
406 if (remoteClient == null ||
407 objlist[0].OwnerID != remoteClient.AgentId)
408 {
409 // Taking copy of another person's item. Take to
410 // Objects folder.
411 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
412 }
413 else
414 {
415 // Catch all. Use lost & found
416 //
357 417
358 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 418 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
419 }
359 } 420 }
360 } 421 }
361 }
362 422
363 // Override and put into where it came from, if it came 423 // Override and put into where it came from, if it came
364 // from anywhere in inventory 424 // from anywhere in inventory
365 // 425 //
366 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) 426 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
367 {
368 if (objectGroup.RootPart.FromFolderID != UUID.Zero)
369 { 427 {
370 InventoryFolderBase f = new InventoryFolderBase(objectGroup.RootPart.FromFolderID, userID); 428 if (objlist[0].RootPart.FromFolderID != UUID.Zero)
371 folder = m_Scene.InventoryService.GetFolder(f); 429 {
430 InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
431 folder = m_Scene.InventoryService.GetFolder(f);
432 }
372 } 433 }
373 }
374 434
375 if (folder == null) // None of the above 435 if (folder == null) // None of the above
376 { 436 {
377 folder = new InventoryFolderBase(folderID); 437 folder = new InventoryFolderBase(folderID);
378 438
379 if (folder == null) // Nowhere to put it 439 if (folder == null) // Nowhere to put it
440 {
441 return UUID.Zero;
442 }
443 }
444
445 item = new InventoryItemBase();
446 // Can't know creator is the same, so null it in inventory
447 if (objlist.Count > 1)
448 item.CreatorId = UUID.Zero.ToString();
449 else
450 item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
451 item.ID = UUID.Random();
452 item.InvType = (int)InventoryType.Object;
453 item.Folder = folder.ID;
454 item.Owner = userID;
455 if (objlist.Count > 1)
380 { 456 {
381 return UUID.Zero; 457 item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
458 }
459 else
460 {
461 item.SaleType = objlist[0].RootPart.ObjectSaleType;
462 item.SalePrice = objlist[0].RootPart.SalePrice;
382 } 463 }
383 } 464 }
384 465
385 item = new InventoryItemBase(); 466 AssetBase asset = CreateAsset(
386 item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); 467 objlist[0].GetPartName(objlist[0].RootPart.LocalId),
387 item.CreatorData = objectGroup.RootPart.CreatorData; 468 objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
388 item.ID = UUID.Random(); 469 (sbyte)AssetType.Object,
389 item.InvType = (int)InventoryType.Object; 470 Utils.StringToBytes(itemXml),
390 item.Folder = folder.ID; 471 objlist[0].OwnerID.ToString());
391 item.Owner = userID; 472 m_Scene.AssetService.Store(asset);
392 } 473 assetID = asset.FullID;
393
394 AssetBase asset = CreateAsset(
395 objectGroup.GetPartName(objectGroup.RootPart.LocalId),
396 objectGroup.GetPartDescription(objectGroup.RootPart.LocalId),
397 (sbyte)AssetType.Object,
398 Utils.StringToBytes(sceneObjectXml),
399 objectGroup.OwnerID.ToString());
400 m_Scene.AssetService.Store(asset);
401 assetID = asset.FullID;
402
403 if (DeRezAction.SaveToExistingUserInventoryItem == action)
404 {
405 item.AssetID = asset.FullID;
406 m_Scene.InventoryService.UpdateItem(item);
407 }
408 else
409 {
410 item.AssetID = asset.FullID;
411 474
412 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) 475 if (DeRezAction.SaveToExistingUserInventoryItem == action)
413 { 476 {
414 uint perms = objectGroup.GetEffectivePermissions(); 477 item.AssetID = asset.FullID;
415 uint nextPerms = (perms & 7) << 13; 478 m_Scene.InventoryService.UpdateItem(item);
416 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
417 perms &= ~(uint)PermissionMask.Copy;
418 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
419 perms &= ~(uint)PermissionMask.Transfer;
420 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
421 perms &= ~(uint)PermissionMask.Modify;
422
423 // Make sure all bits but the ones we want are clear
424 // on take.
425 // This will be applied to the current perms, so
426 // it will do what we want.
427 objectGroup.RootPart.NextOwnerMask &=
428 ((uint)PermissionMask.Copy |
429 (uint)PermissionMask.Transfer |
430 (uint)PermissionMask.Modify);
431 objectGroup.RootPart.NextOwnerMask |=
432 (uint)PermissionMask.Move;
433
434 item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
435 item.CurrentPermissions = item.BasePermissions;
436 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
437 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
438 item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask;
439
440 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
441 } 479 }
442 else 480 else
443 { 481 {
444 item.BasePermissions = objectGroup.GetEffectivePermissions(); 482 item.AssetID = asset.FullID;
445 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
446 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
447 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
448 item.GroupPermissions = objectGroup.RootPart.GroupMask;
449 483
450 item.CurrentPermissions &= 484 uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
451 ((uint)PermissionMask.Copy | 485 foreach (SceneObjectGroup grp in objlist)
452 (uint)PermissionMask.Transfer | 486 effectivePerms &= grp.GetEffectivePermissions();
453 (uint)PermissionMask.Modify | 487 effectivePerms |= (uint)PermissionMask.Move;
454 (uint)PermissionMask.Move | 488
455 7); // Preserve folded permissions 489 if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
456 } 490 {
491 uint perms = effectivePerms;
492 uint nextPerms = (perms & 7) << 13;
493 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
494 perms &= ~(uint)PermissionMask.Copy;
495 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
496 perms &= ~(uint)PermissionMask.Transfer;
497 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
498 perms &= ~(uint)PermissionMask.Modify;
499
500 item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
501 item.CurrentPermissions = item.BasePermissions;
502 item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
503 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
504 item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
505
506 // Magic number badness. Maybe this deserves an enum.
507 // bit 4 (16) is the "Slam" bit, it means treat as passed
508 // and apply next owner perms on rez
509 item.CurrentPermissions |= 16; // Slam!
510 }
511 else
512 {
513 item.BasePermissions = effectivePerms;
514 item.CurrentPermissions = effectivePerms;
515 item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
516 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
517 item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
518
519 item.CurrentPermissions &=
520 ((uint)PermissionMask.Copy |
521 (uint)PermissionMask.Transfer |
522 (uint)PermissionMask.Modify |
523 (uint)PermissionMask.Move |
524 7); // Preserve folded permissions
525 }
457 526
458 // TODO: add the new fields (Flags, Sale info, etc) 527 item.CreationDate = Util.UnixTimeSinceEpoch();
459 item.CreationDate = Util.UnixTimeSinceEpoch(); 528 item.Description = asset.Description;
460 item.Description = asset.Description; 529 item.Name = asset.Name;
461 item.Name = asset.Name; 530 item.AssetType = asset.Type;
462 item.AssetType = asset.Type;
463 531
464 m_Scene.AddInventoryItem(item); 532 m_Scene.AddInventoryItem(item);
465 533
466 if (remoteClient != null && item.Owner == remoteClient.AgentId) 534 if (remoteClient != null && item.Owner == remoteClient.AgentId)
467 {
468 remoteClient.SendInventoryItemCreateUpdate(item, 0);
469 }
470 else
471 {
472 ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
473 if (notifyUser != null)
474 { 535 {
475 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0); 536 remoteClient.SendInventoryItemCreateUpdate(item, 0);
537 }
538 else
539 {
540 ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
541 if (notifyUser != null)
542 {
543 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
544 }
476 } 545 }
477 } 546 }
478 } 547 }
479
480 return assetID; 548 return assetID;
481 } 549 }
482 550
@@ -531,6 +599,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
531 599
532 AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); 600 AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
533 601
602 SceneObjectGroup group = null;
603
534 if (rezAsset != null) 604 if (rezAsset != null)
535 { 605 {
536 UUID itemId = UUID.Zero; 606 UUID itemId = UUID.Zero;
@@ -539,34 +609,78 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
539 // item that it came from. This allows us to enable 'save object to inventory' 609 // item that it came from. This allows us to enable 'save object to inventory'
540 if (!m_Scene.Permissions.BypassPermissions()) 610 if (!m_Scene.Permissions.BypassPermissions())
541 { 611 {
542 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) 612 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
543 { 613 {
544 itemId = item.ID; 614 itemId = item.ID;
545 } 615 }
546 } 616 }
547 else 617 else
548 { 618 {
549 // Brave new fullperm world 619 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
550 // 620 {
551 itemId = item.ID; 621 // Brave new fullperm world
622 itemId = item.ID;
623 }
552 } 624 }
553 625
554 string xmlData = Utils.BytesToString(rezAsset.Data); 626 string xmlData = Utils.BytesToString(rezAsset.Data);
555 SceneObjectGroup group 627 List<SceneObjectGroup> objlist =
556 = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); 628 new List<SceneObjectGroup>();
629 List<Vector3> veclist = new List<Vector3>();
630
631 XmlDocument doc = new XmlDocument();
632 doc.LoadXml(xmlData);
633 XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
634 if (e == null || attachment) // Single
635 {
636 SceneObjectGroup g =
637 SceneObjectSerializer.FromOriginalXmlFormat(
638 itemId, xmlData);
639 objlist.Add(g);
640 veclist.Add(new Vector3(0, 0, 0));
557 641
558 Util.FireAndForget(delegate { AddUserData(group); }); 642 float offsetHeight = 0;
559 643 pos = m_Scene.GetNewRezLocation(
560 group.RootPart.FromFolderID = item.Folder; 644 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
645 BypassRayCast, bRayEndIsIntersection, true, g.GetAxisAlignedBoundingBox(out offsetHeight), false);
646 pos.Z += offsetHeight;
647 }
648 else
649 {
650 XmlElement coll = (XmlElement)e;
651 float bx = Convert.ToSingle(coll.GetAttribute("x"));
652 float by = Convert.ToSingle(coll.GetAttribute("y"));
653 float bz = Convert.ToSingle(coll.GetAttribute("z"));
654 Vector3 bbox = new Vector3(bx, by, bz);
561 655
562 // If it's rezzed in world, select it. Much easier to 656 pos = m_Scene.GetNewRezLocation(RayStart, RayEnd,
563 // find small items. 657 RayTargetID, Quaternion.Identity,
564 // 658 BypassRayCast, bRayEndIsIntersection, true,
565 if (!attachment) 659 bbox, false);
566 group.RootPart.CreateSelected = true; 660
661 pos -= bbox / 2;
662
663 XmlNodeList groups = e.SelectNodes("SceneObjectGroup");
664 foreach (XmlNode n in groups)
665 {
666 SceneObjectGroup g =
667 SceneObjectSerializer.FromOriginalXmlFormat(
668 itemId, n.OuterXml);
669 objlist.Add(g);
670 XmlElement el = (XmlElement)n;
671 float x = Convert.ToSingle(el.GetAttribute("offsetx"));
672 float y = Convert.ToSingle(el.GetAttribute("offsety"));
673 float z = Convert.ToSingle(el.GetAttribute("offsetz"));
674 veclist.Add(new Vector3(x, y, z));
675 }
676 }
677
678 int primcount = 0;
679 foreach (SceneObjectGroup g in objlist)
680 primcount += g.PrimCount;
567 681
568 if (!m_Scene.Permissions.CanRezObject( 682 if (!m_Scene.Permissions.CanRezObject(
569 group.PrimCount, remoteClient.AgentId, pos) 683 primcount, remoteClient.AgentId, pos)
570 && !attachment) 684 && !attachment)
571 { 685 {
572 // The client operates in no fail mode. It will 686 // The client operates in no fail mode. It will
@@ -579,131 +693,131 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
579 return null; 693 return null;
580 } 694 }
581 695
582 group.ResetIDs(); 696 for (int i = 0 ; i < objlist.Count ; i++ )
583
584 if (attachment)
585 { 697 {
586 group.RootPart.Flags |= PrimFlags.Phantom; 698 group = objlist[i];
587 group.RootPart.IsAttachment = true; 699
700 Vector3 storedPosition = group.AbsolutePosition;
701 if (group.UUID == UUID.Zero)
702 {
703 m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3");
704 }
705 group.RootPart.FromFolderID = item.Folder;
706
707 // If it's rezzed in world, select it. Much easier to
708 // find small items.
709 //
710 if (!attachment)
711 {
712 group.RootPart.CreateSelected = true;
713 foreach (SceneObjectPart child in group.Parts)
714 child.CreateSelected = true;
715 }
716 group.ResetIDs();
717
718 if (attachment)
719 {
720 group.RootPart.Flags |= PrimFlags.Phantom;
721 group.RootPart.IsAttachment = true;
722 }
588 723
589 // If we're rezzing an attachment then don't ask 724 // If we're rezzing an attachment then don't ask
590 // AddNewSceneObject() to update the client since 725 // AddNewSceneObject() to update the client since
591 // we'll be doing that later on. Scheduling more 726 // we'll be doing that later on. Scheduling more than
592 // than one full update during the attachment 727 // one full update during the attachment
593 // process causes some clients to fail to display 728 // process causes some clients to fail to display the
594 // the attachment properly. 729 // attachment properly.
595 // Also, don't persist attachments.
596 m_Scene.AddNewSceneObject(group, false, false);
597 }
598 else
599 {
600 m_Scene.AddNewSceneObject(group, true, false); 730 m_Scene.AddNewSceneObject(group, true, false);
601 }
602 731
603 // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); 732 // if attachment we set it's asset id so object updates
604 // if attachment we set it's asset id so object updates can reflect that 733 // can reflect that, if not, we set it's position in world.
605 // if not, we set it's position in world. 734 if (!attachment)
606 if (!attachment) 735 {
607 { 736 group.ScheduleGroupForFullUpdate();
608 group.ScheduleGroupForFullUpdate(); 737
609 738 group.AbsolutePosition = pos + veclist[i];
610 float offsetHeight = 0; 739 }
611 pos = m_Scene.GetNewRezLocation( 740 else
612 RayStart, RayEnd, RayTargetID, Quaternion.Identity, 741 {
613 BypassRayCast, bRayEndIsIntersection, true, group.GetAxisAlignedBoundingBox(out offsetHeight), false); 742 group.SetFromItemID(itemID);
614 pos.Z += offsetHeight; 743 }
615 group.AbsolutePosition = pos;
616 // m_log.InfoFormat("rezx point for inventory rezz is {0} {1} {2} and offsetheight was {3}", pos.X, pos.Y, pos.Z, offsetHeight);
617
618 }
619 else
620 {
621 group.SetFromItemID(itemID);
622 }
623 744
624 SceneObjectPart rootPart = null; 745 SceneObjectPart rootPart = null;
625 try
626 {
627 rootPart = group.GetChildPart(group.UUID);
628 }
629 catch (NullReferenceException)
630 {
631 string isAttachment = "";
632 746
633 if (attachment) 747 try
634 isAttachment = " Object was an attachment"; 748 {
749 rootPart = group.GetChildPart(group.UUID);
750 }
751 catch (NullReferenceException)
752 {
753 string isAttachment = "";
635 754
636 m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); 755 if (attachment)
637 } 756 isAttachment = " Object was an attachment";
638 757
639 // Since renaming the item in the inventory does not affect the name stored 758 m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
640 // in the serialization, transfer the correct name from the inventory to the 759 }
641 // object itself before we rez.
642 rootPart.Name = item.Name;
643 rootPart.Description = item.Description;
644 760
645 if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0) 761 // Since renaming the item in the inventory does not
646 { 762 // affect the name stored in the serialization, transfer
763 // the correct name from the inventory to the
764 // object itself before we rez.
765 rootPart.Name = item.Name;
766 rootPart.Description = item.Description;
647 rootPart.ObjectSaleType = item.SaleType; 767 rootPart.ObjectSaleType = item.SaleType;
648 rootPart.SalePrice = item.SalePrice; 768 rootPart.SalePrice = item.SalePrice;
649 }
650 769
651 group.SetGroup(remoteClient.ActiveGroupId, remoteClient); 770 group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
652 if ((rootPart.OwnerID != item.Owner) || 771 if ((rootPart.OwnerID != item.Owner) ||
653 (item.CurrentPermissions & 16) != 0 || // Magic number 772 (item.CurrentPermissions & 16) != 0)
654 (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
655 {
656 //Need to kill the for sale here
657 rootPart.ObjectSaleType = 0;
658 rootPart.SalePrice = 10;
659
660 if (m_Scene.Permissions.PropagatePermissions())
661 { 773 {
662 foreach (SceneObjectPart part in group.Parts) 774 //Need to kill the for sale here
775 rootPart.ObjectSaleType = 0;
776 rootPart.SalePrice = 10;
777
778 if (m_Scene.Permissions.PropagatePermissions())
663 { 779 {
664 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) 780 foreach (SceneObjectPart part in group.Parts)
665 part.EveryoneMask = item.EveryOnePermissions; 781 {
666 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) 782 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
667 part.NextOwnerMask = item.NextPermissions; 783 {
668 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) 784 part.EveryoneMask = item.EveryOnePermissions;
669 part.GroupMask = item.GroupPermissions; 785 part.NextOwnerMask = item.NextPermissions;
786 }
787 part.GroupMask = 0; // DO NOT propagate here
788 }
789
790 group.ApplyNextOwnerPermissions();
670 } 791 }
671
672 group.ApplyNextOwnerPermissions();
673 } 792 }
674 }
675 793
676 foreach (SceneObjectPart part in group.Parts) 794 foreach (SceneObjectPart part in group.Parts)
677 {
678 if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
679 { 795 {
680 part.LastOwnerID = part.OwnerID; 796 if ((part.OwnerID != item.Owner) ||
681 part.OwnerID = item.Owner; 797 (item.CurrentPermissions & 16) != 0)
682 part.Inventory.ChangeInventoryOwner(item.Owner); 798 {
683 part.GroupMask = 0; // DO NOT propagate here 799 part.LastOwnerID = part.OwnerID;
684 } 800 part.OwnerID = item.Owner;
685 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) 801 part.Inventory.ChangeInventoryOwner(item.Owner);
802 part.GroupMask = 0; // DO NOT propagate here
803 }
686 part.EveryoneMask = item.EveryOnePermissions; 804 part.EveryoneMask = item.EveryOnePermissions;
687 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
688 part.NextOwnerMask = item.NextPermissions; 805 part.NextOwnerMask = item.NextPermissions;
689 if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) 806 }
690 part.GroupMask = item.GroupPermissions;
691 }
692 807
693 rootPart.TrimPermissions(); 808 rootPart.TrimPermissions();
694 809
695 if (!attachment) 810 if (!attachment)
696 {
697 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
698 { 811 {
699 group.ClearPartAttachmentData(); 812 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
700 } 813 group.ClearPartAttachmentData();
701 814
702 // Fire on_rez 815 // Fire on_rez
703 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1); 816 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
704 rootPart.ParentGroup.ResumeScripts(); 817 rootPart.ParentGroup.ResumeScripts();
705 818
706 rootPart.ScheduleFullUpdate(); 819 rootPart.ScheduleFullUpdate();
820 }
707 } 821 }
708 822
709 if (!m_Scene.Permissions.BypassPermissions()) 823 if (!m_Scene.Permissions.BypassPermissions())
@@ -721,9 +835,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
721 } 835 }
722 } 836 }
723 } 837 }
724
725 return rootPart.ParentGroup;
726 } 838 }
839 return group;
727 } 840 }
728 841
729 return null; 842 return null;
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
index c0975ea..9255791 100644
--- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
@@ -111,14 +111,12 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
111 { 111 {
112 if ((SMTPConfig = m_Config.Configs["SMTP"]) == null) 112 if ((SMTPConfig = m_Config.Configs["SMTP"]) == null)
113 { 113 {
114 m_log.InfoFormat("[SMTP] SMTP server not configured");
115 m_Enabled = false; 114 m_Enabled = false;
116 return; 115 return;
117 } 116 }
118 117
119 if (!SMTPConfig.GetBoolean("enabled", false)) 118 if (!SMTPConfig.GetBoolean("enabled", false))
120 { 119 {
121 m_log.InfoFormat("[SMTP] module disabled in configuration");
122 m_Enabled = false; 120 m_Enabled = false;
123 return; 121 return;
124 } 122 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index d0727d9..2b5f7a0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -762,13 +762,14 @@ namespace OpenSim.Region.CoreModules.World.Land
762 { 762 {
763 try 763 try
764 { 764 {
765 //if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4])) 765 return m_landList[m_landIDList[x / 4, y / 4]];
766 return m_landList[m_landIDList[x / 4, y / 4]];
767 //else
768 // return null;
769 } 766 }
770 catch (IndexOutOfRangeException) 767 catch (IndexOutOfRangeException)
771 { 768 {
769// m_log.WarnFormat(
770// "[LAND MANAGEMENT MODULE]: Tried to retrieve land object from out of bounds co-ordinate ({0},{1}) in {2}",
771// x, y, m_scene.RegionInfo.RegionName);
772
772 return null; 773 return null;
773 } 774 }
774 } 775 }
@@ -805,7 +806,7 @@ namespace OpenSim.Region.CoreModules.World.Land
805 ILandObject landUnderPrim = GetLandObject(position.X, position.Y); 806 ILandObject landUnderPrim = GetLandObject(position.X, position.Y);
806 if (landUnderPrim != null) 807 if (landUnderPrim != null)
807 { 808 {
808 landUnderPrim.AddPrimToCount(obj); 809 ((LandObject)landUnderPrim).AddPrimToCount(obj);
809 } 810 }
810 } 811 }
811 812
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 749bb3d..e7bdb19 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.World.Land
243 } 243 }
244 244
245 remote_client.SendLandProperties(seq_id, 245 remote_client.SendLandProperties(seq_id,
246 snap_selection, request_result, LandData, 246 snap_selection, request_result, this,
247 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 247 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
248 GetParcelMaxPrimCount(this), 248 GetParcelMaxPrimCount(this),
249 GetSimulatorMaxPrimCount(this), regionFlags); 249 GetSimulatorMaxPrimCount(this), regionFlags);
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index 9fd347e..bc140ae 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -45,14 +45,13 @@ namespace OpenSim.Region.CoreModules.World.Land
45 public int Owner = 0; 45 public int Owner = 0;
46 public int Group = 0; 46 public int Group = 0;
47 public int Others = 0; 47 public int Others = 0;
48 public Dictionary <UUID, int> Users = 48 public int Selected = 0;
49 new Dictionary <UUID, int>(); 49 public Dictionary <UUID, int> Users = new Dictionary <UUID, int>();
50 } 50 }
51 51
52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule 52 public class PrimCountModule : IPrimCountModule, INonSharedRegionModule
53 { 53 {
54// private static readonly ILog m_log = 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
56 55
57 private Scene m_Scene; 56 private Scene m_Scene;
58 private Dictionary<UUID, PrimCounts> m_PrimCounts = 57 private Dictionary<UUID, PrimCounts> m_PrimCounts =
@@ -64,7 +63,6 @@ namespace OpenSim.Region.CoreModules.World.Land
64 private Dictionary<UUID, ParcelCounts> m_ParcelCounts = 63 private Dictionary<UUID, ParcelCounts> m_ParcelCounts =
65 new Dictionary<UUID, ParcelCounts>(); 64 new Dictionary<UUID, ParcelCounts>();
66 65
67
68 /// <value> 66 /// <value>
69 /// For now, a simple simwide taint to get this up. Later parcel based 67 /// For now, a simple simwide taint to get this up. Later parcel based
70 /// taint to allow recounting a parcel if only ownership has changed 68 /// taint to allow recounting a parcel if only ownership has changed
@@ -96,6 +94,7 @@ namespace OpenSim.Region.CoreModules.World.Land
96 OnObjectBeingRemovedFromScene; 94 OnObjectBeingRemovedFromScene;
97 m_Scene.EventManager.OnParcelPrimCountTainted += 95 m_Scene.EventManager.OnParcelPrimCountTainted +=
98 OnParcelPrimCountTainted; 96 OnParcelPrimCountTainted;
97 m_Scene.EventManager.OnLandObjectAdded += delegate(ILandObject lo) { OnParcelPrimCountTainted(); };
99 } 98 }
100 99
101 public void RegionLoaded(Scene scene) 100 public void RegionLoaded(Scene scene)
@@ -123,6 +122,11 @@ namespace OpenSim.Region.CoreModules.World.Land
123 { 122 {
124 if (!m_Tainted) 123 if (!m_Tainted)
125 AddObject(obj); 124 AddObject(obj);
125// else
126// m_log.DebugFormat(
127// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted",
128// obj.Name, m_Scene.RegionInfo.RegionName);
129
126 } 130 }
127 } 131 }
128 132
@@ -133,11 +137,18 @@ namespace OpenSim.Region.CoreModules.World.Land
133 { 137 {
134 if (!m_Tainted) 138 if (!m_Tainted)
135 RemoveObject(obj); 139 RemoveObject(obj);
140// else
141// m_log.DebugFormat(
142// "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted",
143// obj.Name, m_Scene.RegionInfo.RegionName);
136 } 144 }
137 } 145 }
138 146
139 private void OnParcelPrimCountTainted() 147 private void OnParcelPrimCountTainted()
140 { 148 {
149// m_log.DebugFormat(
150// "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName);
151
141 lock (m_TaintLock) 152 lock (m_TaintLock)
142 m_Tainted = true; 153 m_Tainted = true;
143 } 154 }
@@ -163,7 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Land
163 // NOTE: Call under Taint Lock 174 // NOTE: Call under Taint Lock
164 private void AddObject(SceneObjectGroup obj) 175 private void AddObject(SceneObjectGroup obj)
165 { 176 {
166// m_log.DebugFormat("[PRIM COUNT MODULE]: Adding object {0} to prim count", obj.Name); 177// m_log.DebugFormat("[PRIM COUNT MODULE]: Adding object {0} {1} to prim count", obj.Name, obj.UUID);
167 178
168 if (obj.IsAttachment) 179 if (obj.IsAttachment)
169 return; 180 return;
@@ -172,6 +183,11 @@ namespace OpenSim.Region.CoreModules.World.Land
172 183
173 Vector3 pos = obj.AbsolutePosition; 184 Vector3 pos = obj.AbsolutePosition;
174 ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); 185 ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y);
186
187 // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it
188 if (landObject == null)
189 return;
190
175 LandData landData = landObject.LandData; 191 LandData landData = landObject.LandData;
176 192
177// m_log.DebugFormat( 193// m_log.DebugFormat(
@@ -194,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Land
194 { 210 {
195 if (obj.OwnerID == landData.GroupID) 211 if (obj.OwnerID == landData.GroupID)
196 parcelCounts.Owner += partCount; 212 parcelCounts.Owner += partCount;
197 else if (obj.GroupID == landData.GroupID) 213 else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
198 parcelCounts.Group += partCount; 214 parcelCounts.Group += partCount;
199 else 215 else
200 parcelCounts.Others += partCount; 216 parcelCounts.Others += partCount;
@@ -203,21 +219,28 @@ namespace OpenSim.Region.CoreModules.World.Land
203 { 219 {
204 if (obj.OwnerID == landData.OwnerID) 220 if (obj.OwnerID == landData.OwnerID)
205 parcelCounts.Owner += partCount; 221 parcelCounts.Owner += partCount;
206 else if (obj.GroupID == landData.GroupID)
207 parcelCounts.Group += partCount;
208 else 222 else
209 parcelCounts.Others += partCount; 223 parcelCounts.Others += partCount;
210 } 224 }
225
226 if (obj.IsSelected)
227 parcelCounts.Selected += partCount;
211 } 228 }
212 } 229 }
213 230
214 // NOTE: Call under Taint Lock 231 // NOTE: Call under Taint Lock
215 private void RemoveObject(SceneObjectGroup obj) 232 private void RemoveObject(SceneObjectGroup obj)
216 { 233 {
234// m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID);
235
236 // Currently this is being done by tainting the count instead.
217 } 237 }
218 238
219 public IPrimCounts GetPrimCounts(UUID parcelID) 239 public IPrimCounts GetPrimCounts(UUID parcelID)
220 { 240 {
241// m_log.DebugFormat(
242// "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName);
243
221 PrimCounts primCounts; 244 PrimCounts primCounts;
222 245
223 lock (m_PrimCounts) 246 lock (m_PrimCounts)
@@ -239,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.Land
239 /// <returns></returns> 262 /// <returns></returns>
240 public int GetOwnerCount(UUID parcelID) 263 public int GetOwnerCount(UUID parcelID)
241 { 264 {
242// m_log.DebugFormat("[PRIM COUNT MODULE]: GetOwnerCount for {0}", parcelID); 265 int count = 0;
243 266
244 lock (m_TaintLock) 267 lock (m_TaintLock)
245 { 268 {
@@ -248,9 +271,14 @@ namespace OpenSim.Region.CoreModules.World.Land
248 271
249 ParcelCounts counts; 272 ParcelCounts counts;
250 if (m_ParcelCounts.TryGetValue(parcelID, out counts)) 273 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
251 return counts.Owner; 274 count = counts.Owner;
252 } 275 }
253 return 0; 276
277// m_log.DebugFormat(
278// "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}",
279// parcelID, m_Scene.RegionInfo.RegionName, count);
280
281 return count;
254 } 282 }
255 283
256 /// <summary> 284 /// <summary>
@@ -260,6 +288,8 @@ namespace OpenSim.Region.CoreModules.World.Land
260 /// <returns></returns> 288 /// <returns></returns>
261 public int GetGroupCount(UUID parcelID) 289 public int GetGroupCount(UUID parcelID)
262 { 290 {
291 int count = 0;
292
263 lock (m_TaintLock) 293 lock (m_TaintLock)
264 { 294 {
265 if (m_Tainted) 295 if (m_Tainted)
@@ -267,9 +297,14 @@ namespace OpenSim.Region.CoreModules.World.Land
267 297
268 ParcelCounts counts; 298 ParcelCounts counts;
269 if (m_ParcelCounts.TryGetValue(parcelID, out counts)) 299 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
270 return counts.Group; 300 count = counts.Group;
271 } 301 }
272 return 0; 302
303// m_log.DebugFormat(
304// "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}",
305// parcelID, m_Scene.RegionInfo.RegionName, count);
306
307 return count;
273 } 308 }
274 309
275 /// <summary> 310 /// <summary>
@@ -279,6 +314,61 @@ namespace OpenSim.Region.CoreModules.World.Land
279 /// <returns></returns> 314 /// <returns></returns>
280 public int GetOthersCount(UUID parcelID) 315 public int GetOthersCount(UUID parcelID)
281 { 316 {
317 int count = 0;
318
319 lock (m_TaintLock)
320 {
321 if (m_Tainted)
322 Recount();
323
324 ParcelCounts counts;
325 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
326 count = counts.Others;
327 }
328
329// m_log.DebugFormat(
330// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}",
331// parcelID, m_Scene.RegionInfo.RegionName, count);
332
333 return count;
334 }
335
336 /// <summary>
337 /// Get the number of selected prims.
338 /// </summary>
339 /// <param name="parcelID"></param>
340 /// <returns></returns>
341 public int GetSelectedCount(UUID parcelID)
342 {
343 int count = 0;
344
345 lock (m_TaintLock)
346 {
347 if (m_Tainted)
348 Recount();
349
350 ParcelCounts counts;
351 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
352 count = counts.Selected;
353 }
354
355// m_log.DebugFormat(
356// "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}",
357// parcelID, m_Scene.RegionInfo.RegionName, count);
358
359 return count;
360 }
361
362 /// <summary>
363 /// Get the total count of owner, group and others prims on the parcel.
364 /// FIXME: Need to do selected prims once this is reimplemented.
365 /// </summary>
366 /// <param name="parcelID"></param>
367 /// <returns></returns>
368 public int GetTotalCount(UUID parcelID)
369 {
370 int count = 0;
371
282 lock (m_TaintLock) 372 lock (m_TaintLock)
283 { 373 {
284 if (m_Tainted) 374 if (m_Tainted)
@@ -286,9 +376,18 @@ namespace OpenSim.Region.CoreModules.World.Land
286 376
287 ParcelCounts counts; 377 ParcelCounts counts;
288 if (m_ParcelCounts.TryGetValue(parcelID, out counts)) 378 if (m_ParcelCounts.TryGetValue(parcelID, out counts))
289 return counts.Others; 379 {
380 count = counts.Owner;
381 count += counts.Group;
382 count += counts.Others;
383 }
290 } 384 }
291 return 0; 385
386// m_log.DebugFormat(
387// "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}",
388// parcelID, m_Scene.RegionInfo.RegionName, count);
389
390 return count;
292 } 391 }
293 392
294 /// <summary> 393 /// <summary>
@@ -298,6 +397,8 @@ namespace OpenSim.Region.CoreModules.World.Land
298 /// <returns></returns> 397 /// <returns></returns>
299 public int GetSimulatorCount(UUID parcelID) 398 public int GetSimulatorCount(UUID parcelID)
300 { 399 {
400 int count = 0;
401
301 lock (m_TaintLock) 402 lock (m_TaintLock)
302 { 403 {
303 if (m_Tainted) 404 if (m_Tainted)
@@ -308,10 +409,15 @@ namespace OpenSim.Region.CoreModules.World.Land
308 { 409 {
309 int val; 410 int val;
310 if (m_SimwideCounts.TryGetValue(owner, out val)) 411 if (m_SimwideCounts.TryGetValue(owner, out val))
311 return val; 412 count = val;
312 } 413 }
313 } 414 }
314 return 0; 415
416// m_log.DebugFormat(
417// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}",
418// parcelID, m_Scene.RegionInfo.RegionName, count);
419
420 return count;
315 } 421 }
316 422
317 /// <summary> 423 /// <summary>
@@ -322,6 +428,8 @@ namespace OpenSim.Region.CoreModules.World.Land
322 /// <returns></returns> 428 /// <returns></returns>
323 public int GetUserCount(UUID parcelID, UUID userID) 429 public int GetUserCount(UUID parcelID, UUID userID)
324 { 430 {
431 int count = 0;
432
325 lock (m_TaintLock) 433 lock (m_TaintLock)
326 { 434 {
327 if (m_Tainted) 435 if (m_Tainted)
@@ -332,10 +440,15 @@ namespace OpenSim.Region.CoreModules.World.Land
332 { 440 {
333 int val; 441 int val;
334 if (counts.Users.TryGetValue(userID, out val)) 442 if (counts.Users.TryGetValue(userID, out val))
335 return val; 443 count = val;
336 } 444 }
337 } 445 }
338 return 0; 446
447// m_log.DebugFormat(
448// "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}",
449// userID, parcelID, m_Scene.RegionInfo.RegionName, count);
450
451 return count;
339 } 452 }
340 453
341 // NOTE: This method MUST be called while holding the taint lock! 454 // NOTE: This method MUST be called while holding the taint lock!
@@ -367,6 +480,7 @@ namespace OpenSim.Region.CoreModules.World.Land
367 if (!m_OwnerMap.ContainsKey(k)) 480 if (!m_OwnerMap.ContainsKey(k))
368 m_PrimCounts.Remove(k); 481 m_PrimCounts.Remove(k);
369 } 482 }
483
370 m_Tainted = false; 484 m_Tainted = false;
371 } 485 }
372 } 486 }
@@ -408,6 +522,22 @@ namespace OpenSim.Region.CoreModules.World.Land
408 return m_Parent.GetOthersCount(m_ParcelID); 522 return m_Parent.GetOthersCount(m_ParcelID);
409 } 523 }
410 } 524 }
525
526 public int Selected
527 {
528 get
529 {
530 return m_Parent.GetSelectedCount(m_ParcelID);
531 }
532 }
533
534 public int Total
535 {
536 get
537 {
538 return m_Parent.GetTotalCount(m_ParcelID);
539 }
540 }
411 541
412 public int Simulator 542 public int Simulator
413 { 543 {
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index c9d393f..f006db2 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -45,7 +45,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
45 public class PrimCountModuleTests 45 public class PrimCountModuleTests
46 { 46 {
47 protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); 47 protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000");
48 protected UUID m_dummyUserId = new UUID("99999999-9999-9999-9999-999999999999"); 48 protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000");
49 protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999");
49 protected TestScene m_scene; 50 protected TestScene m_scene;
50 protected PrimCountModule m_pcm; 51 protected PrimCountModule m_pcm;
51 protected ILandObject m_lo; 52 protected ILandObject m_lo;
@@ -65,22 +66,33 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
65 } 66 }
66 67
67 /// <summary> 68 /// <summary>
68 /// Test count after a parcel owner owned object is added. 69 /// Test that counts before we do anything are correct.
69 /// </summary> 70 /// </summary>
70 [Test] 71 [Test]
71 public void TestAddOwnerObject() 72 public void TestInitialCounts()
72 { 73 {
73 TestHelper.InMethod();
74// log4net.Config.XmlConfigurator.Configure();
75
76 IPrimCounts pc = m_lo.PrimCounts; 74 IPrimCounts pc = m_lo.PrimCounts;
77 75
78 Assert.That(pc.Owner, Is.EqualTo(0)); 76 Assert.That(pc.Owner, Is.EqualTo(0));
79 Assert.That(pc.Group, Is.EqualTo(0)); 77 Assert.That(pc.Group, Is.EqualTo(0));
80 Assert.That(pc.Others, Is.EqualTo(0)); 78 Assert.That(pc.Others, Is.EqualTo(0));
79 Assert.That(pc.Total, Is.EqualTo(0));
80 Assert.That(pc.Selected, Is.EqualTo(0));
81 Assert.That(pc.Users[m_userId], Is.EqualTo(0)); 81 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
82 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 82 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
83 Assert.That(pc.Simulator, Is.EqualTo(0)); 83 Assert.That(pc.Simulator, Is.EqualTo(0));
84 }
85
86 /// <summary>
87 /// Test count after a parcel owner owned object is added.
88 /// </summary>
89 [Test]
90 public void TestAddOwnerObject()
91 {
92 TestHelper.InMethod();
93// log4net.Config.XmlConfigurator.Configure();
94
95 IPrimCounts pc = m_lo.PrimCounts;
84 96
85 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01); 97 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01);
86 m_scene.AddNewSceneObject(sog, false); 98 m_scene.AddNewSceneObject(sog, false);
@@ -88,8 +100,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
88 Assert.That(pc.Owner, Is.EqualTo(3)); 100 Assert.That(pc.Owner, Is.EqualTo(3));
89 Assert.That(pc.Group, Is.EqualTo(0)); 101 Assert.That(pc.Group, Is.EqualTo(0));
90 Assert.That(pc.Others, Is.EqualTo(0)); 102 Assert.That(pc.Others, Is.EqualTo(0));
103 Assert.That(pc.Total, Is.EqualTo(3));
104 Assert.That(pc.Selected, Is.EqualTo(0));
91 Assert.That(pc.Users[m_userId], Is.EqualTo(3)); 105 Assert.That(pc.Users[m_userId], Is.EqualTo(3));
92 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 106 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
93 Assert.That(pc.Simulator, Is.EqualTo(3)); 107 Assert.That(pc.Simulator, Is.EqualTo(3));
94 108
95 // Add a second object and retest 109 // Add a second object and retest
@@ -99,12 +113,39 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
99 Assert.That(pc.Owner, Is.EqualTo(5)); 113 Assert.That(pc.Owner, Is.EqualTo(5));
100 Assert.That(pc.Group, Is.EqualTo(0)); 114 Assert.That(pc.Group, Is.EqualTo(0));
101 Assert.That(pc.Others, Is.EqualTo(0)); 115 Assert.That(pc.Others, Is.EqualTo(0));
116 Assert.That(pc.Total, Is.EqualTo(5));
117 Assert.That(pc.Selected, Is.EqualTo(0));
102 Assert.That(pc.Users[m_userId], Is.EqualTo(5)); 118 Assert.That(pc.Users[m_userId], Is.EqualTo(5));
103 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 119 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
104 Assert.That(pc.Simulator, Is.EqualTo(5)); 120 Assert.That(pc.Simulator, Is.EqualTo(5));
105 } 121 }
106 122
107 /// <summary> 123 /// <summary>
124 /// Test count after a parcel owner owned copied object is added.
125 /// </summary>
126 [Test]
127 public void TestCopiedOwnerObject()
128 {
129 TestHelper.InMethod();
130// log4net.Config.XmlConfigurator.Configure();
131
132 IPrimCounts pc = m_lo.PrimCounts;
133
134 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01);
135 m_scene.AddNewSceneObject(sog, false);
136 m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity);
137
138 Assert.That(pc.Owner, Is.EqualTo(6));
139 Assert.That(pc.Group, Is.EqualTo(0));
140 Assert.That(pc.Others, Is.EqualTo(0));
141 Assert.That(pc.Total, Is.EqualTo(6));
142 Assert.That(pc.Selected, Is.EqualTo(0));
143 Assert.That(pc.Users[m_userId], Is.EqualTo(6));
144 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
145 Assert.That(pc.Simulator, Is.EqualTo(6));
146 }
147
148 /// <summary>
108 /// Test count after a parcel owner owned object is removed. 149 /// Test count after a parcel owner owned object is removed.
109 /// </summary> 150 /// </summary>
110 [Test] 151 [Test]
@@ -123,9 +164,139 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
123 Assert.That(pc.Owner, Is.EqualTo(1)); 164 Assert.That(pc.Owner, Is.EqualTo(1));
124 Assert.That(pc.Group, Is.EqualTo(0)); 165 Assert.That(pc.Group, Is.EqualTo(0));
125 Assert.That(pc.Others, Is.EqualTo(0)); 166 Assert.That(pc.Others, Is.EqualTo(0));
167 Assert.That(pc.Total, Is.EqualTo(1));
168 Assert.That(pc.Selected, Is.EqualTo(0));
169 Assert.That(pc.Users[m_userId], Is.EqualTo(1));
170 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
171 Assert.That(pc.Simulator, Is.EqualTo(1));
172 }
173
174 [Test]
175 public void TestAddGroupObject()
176 {
177 TestHelper.InMethod();
178// log4net.Config.XmlConfigurator.Configure();
179
180 m_lo.DeedToGroup(m_groupId);
181
182 IPrimCounts pc = m_lo.PrimCounts;
183
184 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, 0x01);
185 sog.GroupID = m_groupId;
186 m_scene.AddNewSceneObject(sog, false);
187
188 Assert.That(pc.Owner, Is.EqualTo(0));
189 Assert.That(pc.Group, Is.EqualTo(3));
190 Assert.That(pc.Others, Is.EqualTo(0));
191 Assert.That(pc.Total, Is.EqualTo(3));
192 Assert.That(pc.Selected, Is.EqualTo(0));
193
194 // Is this desired behaviour? Not totally sure.
195 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
196 Assert.That(pc.Users[m_groupId], Is.EqualTo(0));
197 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3));
198
199 Assert.That(pc.Simulator, Is.EqualTo(3));
200 }
201
202 /// <summary>
203 /// Test count after a parcel owner owned object is removed.
204 /// </summary>
205 [Test]
206 public void TestRemoveGroupObject()
207 {
208 TestHelper.InMethod();
209// log4net.Config.XmlConfigurator.Configure();
210
211 m_lo.DeedToGroup(m_groupId);
212
213 IPrimCounts pc = m_lo.PrimCounts;
214
215 SceneObjectGroup sogToKeep = SceneSetupHelpers.CreateSceneObject(1, m_userId, 0x1);
216 sogToKeep.GroupID = m_groupId;
217 m_scene.AddNewSceneObject(sogToKeep, false);
218
219 SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x10);
220 m_scene.AddNewSceneObject(sogToDelete, false);
221 m_scene.DeleteSceneObject(sogToDelete, false);
222
223 Assert.That(pc.Owner, Is.EqualTo(0));
224 Assert.That(pc.Group, Is.EqualTo(1));
225 Assert.That(pc.Others, Is.EqualTo(0));
226 Assert.That(pc.Total, Is.EqualTo(1));
227 Assert.That(pc.Selected, Is.EqualTo(0));
126 Assert.That(pc.Users[m_userId], Is.EqualTo(1)); 228 Assert.That(pc.Users[m_userId], Is.EqualTo(1));
127 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0)); 229 Assert.That(pc.Users[m_groupId], Is.EqualTo(0));
230 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
128 Assert.That(pc.Simulator, Is.EqualTo(1)); 231 Assert.That(pc.Simulator, Is.EqualTo(1));
129 } 232 }
233
234 [Test]
235 public void TestAddOthersObject()
236 {
237 TestHelper.InMethod();
238// log4net.Config.XmlConfigurator.Configure();
239
240 IPrimCounts pc = m_lo.PrimCounts;
241
242 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, 0x01);
243 m_scene.AddNewSceneObject(sog, false);
244
245 Assert.That(pc.Owner, Is.EqualTo(0));
246 Assert.That(pc.Group, Is.EqualTo(0));
247 Assert.That(pc.Others, Is.EqualTo(3));
248 Assert.That(pc.Total, Is.EqualTo(3));
249 Assert.That(pc.Selected, Is.EqualTo(0));
250 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
251 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3));
252 Assert.That(pc.Simulator, Is.EqualTo(3));
253 }
254
255 [Test]
256 public void TestRemoveOthersObject()
257 {
258 TestHelper.InMethod();
259// log4net.Config.XmlConfigurator.Configure();
260
261 IPrimCounts pc = m_lo.PrimCounts;
262
263 m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_otherUserId, 0x1), false);
264 SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, 0x10);
265 m_scene.AddNewSceneObject(sogToDelete, false);
266 m_scene.DeleteSceneObject(sogToDelete, false);
267
268 Assert.That(pc.Owner, Is.EqualTo(0));
269 Assert.That(pc.Group, Is.EqualTo(0));
270 Assert.That(pc.Others, Is.EqualTo(1));
271 Assert.That(pc.Total, Is.EqualTo(1));
272 Assert.That(pc.Selected, Is.EqualTo(0));
273 Assert.That(pc.Users[m_userId], Is.EqualTo(0));
274 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1));
275 Assert.That(pc.Simulator, Is.EqualTo(1));
276 }
277
278 /// <summary>
279 /// Test the count is correct after is has been tainted.
280 /// </summary>
281 [Test]
282 public void TestTaint()
283 {
284 TestHelper.InMethod();
285 IPrimCounts pc = m_lo.PrimCounts;
286
287 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01);
288 m_scene.AddNewSceneObject(sog, false);
289
290 m_pcm.TaintPrimCount();
291
292 Assert.That(pc.Owner, Is.EqualTo(3));
293 Assert.That(pc.Group, Is.EqualTo(0));
294 Assert.That(pc.Others, Is.EqualTo(0));
295 Assert.That(pc.Total, Is.EqualTo(3));
296 Assert.That(pc.Selected, Is.EqualTo(0));
297 Assert.That(pc.Users[m_userId], Is.EqualTo(3));
298 Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0));
299 Assert.That(pc.Simulator, Is.EqualTo(3));
300 }
130 } 301 }
131} \ No newline at end of file 302} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 6676ec8..d6fa093 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -62,9 +62,20 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
62 return LoadBitmap(new Bitmap(filename)); 62 return LoadBitmap(new Bitmap(filename));
63 } 63 }
64 64
65 public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) 65 public virtual ITerrainChannel LoadFile(string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int w, int h)
66 { 66 {
67 throw new NotImplementedException(); 67 Bitmap bitmap = new Bitmap(filename);
68 ITerrainChannel retval = new TerrainChannel(true);
69
70 for (int x = 0; x < retval.Width; x++)
71 {
72 for (int y = 0; y < retval.Height; y++)
73 {
74 retval[x, y] = bitmap.GetPixel(offsetX * retval.Width + x, (bitmap.Height - (retval.Height * (offsetY + 1))) + retval.Height - y - 1).GetBrightness() * 128;
75 }
76 }
77
78 return retval;
68 } 79 }
69 80
70 public virtual ITerrainChannel LoadStream(Stream stream) 81 public virtual ITerrainChannel LoadStream(Stream stream)
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 7bb7544..f9ef286 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -100,8 +100,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region 100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
101 regionInfos = new List<GridRegion>(); 101 regionInfos = new List<GridRegion>();
102 GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName); 102 GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName);
103 if (info != null) regionInfos.Add(info); 103 if (info != null)
104 regionInfos.Add(info);
104 } 105 }
106 else if (regionInfos.Count == 0 && mapName.StartsWith("http://"))
107 remoteClient.SendAlertMessage("Hyperlink could not be established.");
108
105 m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); 109 m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count);
106 List<MapBlockData> blocks = new List<MapBlockData>(); 110 List<MapBlockData> blocks = new List<MapBlockData>();
107 111
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 41d6628..d939329 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -909,7 +909,7 @@ namespace OpenSim.Region.Examples.SimpleModule
909 { 909 {
910 } 910 }
911 911
912 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 912 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
913 { 913 {
914 } 914 }
915 915
diff --git a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
index 65158e1..d63da2e 100644
--- a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
@@ -38,18 +38,4 @@ namespace OpenSim.Region.Framework.Interfaces
38 38
39 IPrimCounts GetPrimCounts(UUID parcelID); 39 IPrimCounts GetPrimCounts(UUID parcelID);
40 } 40 }
41 41} \ No newline at end of file
42 public interface IPrimCounts
43 {
44 int Owner { get; }
45 int Group { get; }
46 int Others { get; }
47 int Simulator { get; }
48 IUserPrimCounts Users { get; }
49 }
50
51 public interface IUserPrimCounts
52 {
53 int this[UUID agentID] { get; }
54 }
55}
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 64567db..8feb022 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes
137 x = m_inventoryDeletes.Dequeue(); 137 x = m_inventoryDeletes.Dequeue();
138 138
139 m_log.DebugFormat( 139 m_log.DebugFormat(
140 "[ASYNC DELETER]: Sending object to user's inventory, {0} item(s) remaining.", left); 140 "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count);
141 141
142 try 142 try
143 { 143 {
@@ -177,4 +177,4 @@ namespace OpenSim.Region.Framework.Scenes
177 return false; 177 return false;
178 } 178 }
179 } 179 }
180} \ No newline at end of file 180}
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 2764b05..a14bb70 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -60,15 +60,6 @@ namespace OpenSim.Region.Framework.Scenes
60 { 60 {
61 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
62 62
63 /// <summary>
64 /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
65 /// viewer before child prim updates.
66 /// The adjustment is added to child prims and subtracted from root prims, so the gap ends up
67 /// being double. We do it both ways so that there is a still a priority delta even if the priority is already
68 /// double.MinValue or double.MaxValue.
69 /// </summary>
70 private double m_childPrimAdjustmentFactor = 0.05;
71
72 private Scene m_scene; 63 private Scene m_scene;
73 64
74 public Prioritizer(Scene scene) 65 public Prioritizer(Scene scene)
@@ -76,9 +67,19 @@ namespace OpenSim.Region.Framework.Scenes
76 m_scene = scene; 67 m_scene = scene;
77 } 68 }
78 69
79//<mic> 70 /// <summary>
71 /// Returns the priority queue into which the update should be placed. Updates within a
72 /// queue will be processed in arrival order. There are currently 12 priority queues
73 /// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained
74 /// for avatar updates. The fair queuing discipline for processing the priority queues
75 /// assumes that the number of entities in each priority queues increases exponentially.
76 /// So for example... if queue 1 contains all updates within 10m of the avatar or camera
77 /// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number
78 /// of updates.
79 /// </summary>
80 public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) 80 public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity)
81 { 81 {
82 // If entity is null we have a serious problem
82 if (entity == null) 83 if (entity == null)
83 { 84 {
84 m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity"); 85 m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity");
@@ -89,71 +90,12 @@ namespace OpenSim.Region.Framework.Scenes
89 if (client.AgentId == entity.UUID) 90 if (client.AgentId == entity.UUID)
90 return 0; 91 return 0;
91 92
92 // Get this agent's position 93 uint priority;
93 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
94 if (presence == null)
95 {
96 m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
97 throw new InvalidOperationException("Prioritization agent not defined");
98 }
99
100 // Use group position for child prims
101 Vector3 entityPos = entity.AbsolutePosition;
102 if (entity is SceneObjectPart)
103 {
104 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
105 if (group != null)
106 entityPos = group.AbsolutePosition;
107 }
108
109 // Use the camera position for local agents and avatar position for remote agents
110 Vector3 presencePos = (presence.IsChildAgent) ?
111 presence.AbsolutePosition :
112 presence.CameraPosition;
113
114 // Compute the distance...
115 double distance = Vector3.Distance(presencePos, entityPos);
116
117 // And convert the distance to a priority queue, this computation gives queues
118 // at 10, 20, 40, 80, 160, 320, 640, and 1280m
119 uint pqueue = 1;
120 for (int i = 0; i < 8; i++)
121 {
122 if (distance < 10 * Math.Pow(2.0,i))
123 break;
124 pqueue++;
125 }
126
127 // If this is a root agent, then determine front & back
128 // Bump up the priority queue for any objects behind the avatar
129 if (! presence.IsChildAgent)
130 {
131 // Root agent, decrease priority for objects behind us
132 Vector3 camPosition = presence.CameraPosition;
133 Vector3 camAtAxis = presence.CameraAtAxis;
134
135 // Plane equation
136 float d = -Vector3.Dot(camPosition, camAtAxis);
137 float p = Vector3.Dot(camAtAxis, entityPos) + d;
138 if (p < 0.0f)
139 pqueue++;
140 }
141
142 return pqueue;
143 }
144//</mic>
145
146 public double bGetUpdatePriority(IClientAPI client, ISceneEntity entity)
147 {
148 double priority = 0;
149
150 if (entity == null)
151 return 100000;
152 94
153 switch (m_scene.UpdatePrioritizationScheme) 95 switch (m_scene.UpdatePrioritizationScheme)
154 { 96 {
155 case UpdatePrioritizationSchemes.Time: 97 case UpdatePrioritizationSchemes.Time:
156 priority = GetPriorityByTime(); 98 priority = GetPriorityByTime(client, entity);
157 break; 99 break;
158 case UpdatePrioritizationSchemes.Distance: 100 case UpdatePrioritizationSchemes.Distance:
159 priority = GetPriorityByDistance(client, entity); 101 priority = GetPriorityByDistance(client, entity);
@@ -171,180 +113,110 @@ namespace OpenSim.Region.Framework.Scenes
171 throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); 113 throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
172 } 114 }
173 115
174 // Adjust priority so that root prims are sent to the viewer first. This is especially important for
175 // attachments acting as huds, since current viewers fail to display hud child prims if their updates
176 // arrive before the root one.
177 if (entity is SceneObjectPart)
178 {
179 SceneObjectPart sop = ((SceneObjectPart)entity);
180
181 if (sop.IsRoot)
182 {
183 if (priority >= double.MinValue + m_childPrimAdjustmentFactor)
184 priority -= m_childPrimAdjustmentFactor;
185 }
186 else
187 {
188 if (priority <= double.MaxValue - m_childPrimAdjustmentFactor)
189 priority += m_childPrimAdjustmentFactor;
190 }
191 }
192
193 return priority; 116 return priority;
194 } 117 }
195 118
196 private double GetPriorityByTime() 119
120 private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity)
197 { 121 {
198 return DateTime.UtcNow.ToOADate(); 122 return 1;
199 } 123 }
200 124
201 private double GetPriorityByDistance(IClientAPI client, ISceneEntity entity) 125 private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
202 { 126 {
203 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 127 return ComputeDistancePriority(client,entity,false);
204 if (presence != null) 128 }
205 { 129
206 // If this is an update for our own avatar give it the highest priority 130 private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
207 if (presence == entity) 131 {
208 return 0.0; 132 return ComputeDistancePriority(client,entity,true);
209
210 // Use the camera position for local agents and avatar position for remote agents
211 Vector3 presencePos = (presence.IsChildAgent) ?
212 presence.AbsolutePosition :
213 presence.CameraPosition;
214
215 // Use group position for child prims
216 Vector3 entityPos;
217 if (entity is SceneObjectPart)
218 {
219 // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
220 // before its scheduled update was triggered
221 //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
222 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
223 }
224 else
225 {
226 entityPos = entity.AbsolutePosition;
227 }
228
229 return Vector3.DistanceSquared(presencePos, entityPos);
230 }
231
232 return double.NaN;
233 } 133 }
234 134
235 private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) 135 private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
236 { 136 {
137 uint pqueue = ComputeDistancePriority(client,entity,true);
138
237 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 139 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
238 if (presence != null) 140 if (presence != null)
239 { 141 {
240 // If this is an update for our own avatar give it the highest priority
241 if (presence == entity)
242 return 0.0;
243
244 // Use group position for child prims
245 Vector3 entityPos = entity.AbsolutePosition;
246 if (entity is SceneObjectPart)
247 {
248 // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
249 // before its scheduled update was triggered
250 //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
251 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
252 }
253 else
254 {
255 entityPos = entity.AbsolutePosition;
256 }
257
258 if (!presence.IsChildAgent) 142 if (!presence.IsChildAgent)
259 { 143 {
260 // Root agent. Use distance from camera and a priority decrease for objects behind us 144 if (entity is SceneObjectPart)
261 Vector3 camPosition = presence.CameraPosition; 145 {
262 Vector3 camAtAxis = presence.CameraAtAxis; 146 // Non physical prims are lower priority than physical prims
263 147 PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
264 // Distance 148 if (physActor == null || !physActor.IsPhysical)
265 double priority = Vector3.DistanceSquared(camPosition, entityPos); 149 pqueue++;
266
267 // Plane equation
268 float d = -Vector3.Dot(camPosition, camAtAxis);
269 float p = Vector3.Dot(camAtAxis, entityPos) + d;
270 if (p < 0.0f) priority *= 2.0;
271
272 return priority;
273 }
274 else
275 {
276 // Child agent. Use the normal distance method
277 Vector3 presencePos = presence.AbsolutePosition;
278 150
279 return Vector3.DistanceSquared(presencePos, entityPos); 151 // Attachments are high priority,
152 // MIC: shouldn't these already be in the highest priority queue already
153 // since their root position is same as the avatars?
154 if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
155 pqueue = 1;
156 }
280 } 157 }
281 } 158 }
282 159
283 return double.NaN; 160 return pqueue;
284 } 161 }
285 162
286 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) 163 private uint ComputeDistancePriority(IClientAPI client, ISceneEntity entity, bool useFrontBack)
287 { 164 {
288 // If this is an update for our own avatar give it the highest priority 165 // Get this agent's position
289 if (client.AgentId == entity.UUID) 166 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
290 return 0.0; 167 if (presence == null)
291 if (entity == null) 168 {
292 return double.NaN; 169 m_log.WarnFormat("[PRIORITIZER] attempt to prioritize agent no longer in the scene");
293 170 throw new InvalidOperationException("Prioritization agent not defined");
294 // Use group position for child prims 171 }
172
173 // Use group position for child prims, since we are putting child prims in
174 // the same queue with the root of the group, the root prim (which goes into
175 // the queue first) should always be sent first, no need to adjust child prim
176 // priorities
295 Vector3 entityPos = entity.AbsolutePosition; 177 Vector3 entityPos = entity.AbsolutePosition;
296 if (entity is SceneObjectPart) 178 if (entity is SceneObjectPart)
297 { 179 {
298 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; 180 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
299 if (group != null) 181 if (group != null)
300 entityPos = group.AbsolutePosition; 182 entityPos = group.AbsolutePosition;
301 else
302 entityPos = entity.AbsolutePosition;
303 } 183 }
304 else
305 entityPos = entity.AbsolutePosition;
306
307 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
308 if (presence != null)
309 {
310 if (!presence.IsChildAgent)
311 {
312 if (entity is ScenePresence)
313 return 1.0;
314 184
315 // Root agent. Use distance from camera and a priority decrease for objects behind us 185 // Use the camera position for local agents and avatar position for remote agents
316 Vector3 camPosition = presence.CameraPosition; 186 Vector3 presencePos = (presence.IsChildAgent) ?
317 Vector3 camAtAxis = presence.CameraAtAxis; 187 presence.AbsolutePosition :
318 188 presence.CameraPosition;
319 // Distance
320 double priority = Vector3.DistanceSquared(camPosition, entityPos);
321
322 // Plane equation
323 float d = -Vector3.Dot(camPosition, camAtAxis);
324 float p = Vector3.Dot(camAtAxis, entityPos) + d;
325 if (p < 0.0f) priority *= 2.0;
326 189
327 if (entity is SceneObjectPart) 190 // Compute the distance...
328 { 191 double distance = Vector3.Distance(presencePos, entityPos);
329 PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
330 if (physActor == null || !physActor.IsPhysical)
331 priority += 100;
332 192
333 if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment) 193 // And convert the distance to a priority queue, this computation gives queues
334 priority = 1.0; 194 // at 10, 20, 40, 80, 160, 320, 640, and 1280m
335 } 195 uint pqueue = 1;
336 return priority; 196 for (int i = 0; i < 8; i++)
337 } 197 {
338 else 198 if (distance < 10 * Math.Pow(2.0,i))
339 { 199 break;
340 // Child agent. Use the normal distance method 200 pqueue++;
341 Vector3 presencePos = presence.AbsolutePosition; 201 }
202
203 // If this is a root agent, then determine front & back
204 // Bump up the priority queue (drop the priority) for any objects behind the avatar
205 if (useFrontBack && ! presence.IsChildAgent)
206 {
207 // Root agent, decrease priority for objects behind us
208 Vector3 camPosition = presence.CameraPosition;
209 Vector3 camAtAxis = presence.CameraAtAxis;
342 210
343 return Vector3.DistanceSquared(presencePos, entityPos); 211 // Plane equation
344 } 212 float d = -Vector3.Dot(camPosition, camAtAxis);
213 float p = Vector3.Dot(camAtAxis, entityPos) + d;
214 if (p < 0.0f)
215 pqueue++;
345 } 216 }
346 217
347 return double.NaN; 218 return pqueue;
348 } 219 }
220
349 } 221 }
350} 222}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index fcbcf59..73dd531 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2069,7 +2069,10 @@ namespace OpenSim.Region.Framework.Scenes
2069 SceneObjectPart[] partList = sog.Parts; 2069 SceneObjectPart[] partList = sog.Parts;
2070 2070
2071 foreach (SceneObjectPart child in partList) 2071 foreach (SceneObjectPart child in partList)
2072 {
2072 child.Inventory.ChangeInventoryOwner(ownerID); 2073 child.Inventory.ChangeInventoryOwner(ownerID);
2074 child.TriggerScriptChangedEvent(Changed.OWNER);
2075 }
2073 } 2076 }
2074 else 2077 else
2075 { 2078 {
@@ -2085,6 +2088,7 @@ namespace OpenSim.Region.Framework.Scenes
2085 { 2088 {
2086 child.LastOwnerID = child.OwnerID; 2089 child.LastOwnerID = child.OwnerID;
2087 child.Inventory.ChangeInventoryOwner(groupID); 2090 child.Inventory.ChangeInventoryOwner(groupID);
2091 child.TriggerScriptChangedEvent(Changed.OWNER);
2088 } 2092 }
2089 2093
2090 sog.SetOwnerId(groupID); 2094 sog.SetOwnerId(groupID);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d407a6f..35a798e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -563,7 +563,6 @@ namespace OpenSim.Region.Framework.Scenes
563 m_regInfo = regInfo; 563 m_regInfo = regInfo;
564 m_regionHandle = m_regInfo.RegionHandle; 564 m_regionHandle = m_regInfo.RegionHandle;
565 m_regionName = m_regInfo.RegionName; 565 m_regionName = m_regInfo.RegionName;
566 m_datastore = m_regInfo.DataStore;
567 m_lastUpdate = Util.EnvironmentTickCount(); 566 m_lastUpdate = Util.EnvironmentTickCount();
568 567
569 m_physicalPrim = physicalPrim; 568 m_physicalPrim = physicalPrim;
@@ -4866,8 +4865,17 @@ namespace OpenSim.Region.Framework.Scenes
4866 { 4865 {
4867 float ominX, ominY, ominZ, omaxX, omaxY, omaxZ; 4866 float ominX, ominY, ominZ, omaxX, omaxY, omaxZ;
4868 4867
4868 Vector3 vec = g.AbsolutePosition;
4869
4869 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); 4870 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
4870 4871
4872 ominX += vec.X;
4873 omaxX += vec.X;
4874 ominY += vec.Y;
4875 omaxY += vec.Y;
4876 ominZ += vec.Z;
4877 omaxZ += vec.Z;
4878
4871 if (minX > ominX) 4879 if (minX > ominX)
4872 minX = ominX; 4880 minX = ominX;
4873 if (minY > ominY) 4881 if (minY > ominY)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index f343bc8..c4547f2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -136,8 +136,6 @@ namespace OpenSim.Region.Framework.Scenes
136 get { return m_permissions; } 136 get { return m_permissions; }
137 } 137 }
138 138
139 protected string m_datastore;
140
141 /* Used by the loadbalancer plugin on GForge */ 139 /* Used by the loadbalancer plugin on GForge */
142 protected RegionStatus m_regStatus; 140 protected RegionStatus m_regStatus;
143 public RegionStatus RegionStatus 141 public RegionStatus RegionStatus
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index fa404c0..3281eab 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -175,12 +175,12 @@ namespace OpenSim.Region.Framework.Scenes
175 foreach (TaskInventoryItem item in items) 175 foreach (TaskInventoryItem item in items)
176 { 176 {
177 if (ownerId != item.OwnerID) 177 if (ownerId != item.OwnerID)
178 {
179 item.LastOwnerID = item.OwnerID; 178 item.LastOwnerID = item.OwnerID;
180 item.OwnerID = ownerId; 179
181 item.PermsMask = 0; 180 item.OwnerID = ownerId;
182 item.PermsGranter = UUID.Zero; 181 item.PermsMask = 0;
183 } 182 item.PermsGranter = UUID.Zero;
183 item.OwnerChanged = true;
184 } 184 }
185 } 185 }
186 186
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 49382f0..821cd4b 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1247,7 +1247,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1247 1247
1248 } 1248 }
1249 1249
1250 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 1250 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
1251 { 1251 {
1252 1252
1253 } 1253 }
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
index 2fcc477..0d6313a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
@@ -80,16 +80,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
80 m_config = config.Configs["Concierge"]; 80 m_config = config.Configs["Concierge"];
81 81
82 if (null == m_config) 82 if (null == m_config)
83 {
84 m_log.Info("[Concierge]: no config found, plugin disabled");
85 return; 83 return;
86 }
87 84
88 if (!m_config.GetBoolean("enabled", false)) 85 if (!m_config.GetBoolean("enabled", false))
89 {
90 m_log.Info("[Concierge]: plugin disabled by configuration");
91 return; 86 return;
92 } 87
93 m_enabled = true; 88 m_enabled = true;
94 89
95 90
@@ -113,9 +108,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
113 { 108 {
114 m_replacingChatModule = false; 109 m_replacingChatModule = false;
115 } 110 }
111
116 m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing"); 112 m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing");
117 113
118
119 // take note of concierge channel and of identity 114 // take note of concierge channel and of identity
120 m_conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel); 115 m_conciergeChannel = config.Configs["Concierge"].GetInt("concierge_channel", m_conciergeChannel);
121 m_whoami = m_config.GetString("whoami", "conferencier"); 116 m_whoami = m_config.GetString("whoami", "conferencier");
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 05a1c3b..7909d8a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -106,16 +106,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
106 m_Config = config.Configs["FreeSwitchVoice"]; 106 m_Config = config.Configs["FreeSwitchVoice"];
107 107
108 if (m_Config == null) 108 if (m_Config == null)
109 {
110 m_log.Info("[FreeSwitchVoice] no config found, plugin disabled");
111 return; 109 return;
112 }
113 110
114 if (!m_Config.GetBoolean("Enabled", false)) 111 if (!m_Config.GetBoolean("Enabled", false))
115 {
116 m_log.Info("[FreeSwitchVoice] plugin disabled by configuration");
117 return; 112 return;
118 }
119 113
120 try 114 try
121 { 115 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 34d0e24..534bf92 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -121,16 +121,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
121 m_config = config.Configs["VivoxVoice"]; 121 m_config = config.Configs["VivoxVoice"];
122 122
123 if (null == m_config) 123 if (null == m_config)
124 {
125 m_log.Info("[VivoxVoice] no config found, plugin disabled");
126 return; 124 return;
127 }
128 125
129 if (!m_config.GetBoolean("enabled", false)) 126 if (!m_config.GetBoolean("enabled", false))
130 {
131 m_log.Info("[VivoxVoice] plugin disabled by configuration");
132 return; 127 return;
133 }
134 128
135 try 129 try
136 { 130 {
@@ -218,7 +212,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
218 m_pluginEnabled = true; 212 m_pluginEnabled = true;
219 213
220 m_log.Info("[VivoxVoice] plugin enabled"); 214 m_log.Info("[VivoxVoice] plugin enabled");
221
222 } 215 }
223 catch (Exception e) 216 catch (Exception e)
224 { 217 {
@@ -228,7 +221,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
228 } 221 }
229 } 222 }
230 223
231
232 // Called to indicate that the module has been added to the region 224 // Called to indicate that the module has been added to the region
233 public void AddRegion(Scene scene) 225 public void AddRegion(Scene scene)
234 { 226 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 3d34441..8c01d75 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -86,13 +86,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
86 return; 86 return;
87 } 87 }
88 88
89 m_log.Info("[GROUPS-MESSAGING]: Initializing GroupsMessagingModule");
90
91 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); 89 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
92 } 90 }
93 91
94 m_log.Info("[GROUPS-MESSAGING]: GroupsMessagingModule starting up"); 92 m_log.Info("[GROUPS-MESSAGING]: GroupsMessagingModule starting up");
95
96 } 93 }
97 94
98 public void AddRegion(Scene scene) 95 public void AddRegion(Scene scene)
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs
index 8df020f..c898da6 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using OpenSim.Framework;
28using OpenSim.Region.Framework.Interfaces; 29using OpenSim.Region.Framework.Interfaces;
29using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
30 31
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
index df60709..74f5208 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
75 75
76 if (source.Configs["MRM"].GetBoolean("Enabled", false)) 76 if (source.Configs["MRM"].GetBoolean("Enabled", false))
77 { 77 {
78 m_log.Info("[MRM] Enabling MRM Module"); 78 m_log.Info("[MRM]: Enabling MRM Module");
79 m_scene = scene; 79 m_scene = scene;
80 80
81 // when hidden, we don't listen for client initiated script events 81 // when hidden, we don't listen for client initiated script events
@@ -90,14 +90,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
90 90
91 scene.RegisterModuleInterface<IMRMModule>(this); 91 scene.RegisterModuleInterface<IMRMModule>(this);
92 } 92 }
93 else
94 {
95 m_log.Info("[MRM] Disabled MRM Module (Disabled in ini)");
96 }
97 }
98 else
99 {
100 m_log.Info("[MRM] Disabled MRM Module (Default disabled)");
101 } 93 }
102 } 94 }
103 95
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 5d44aa1..96760a2 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -925,7 +925,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
925 { 925 {
926 } 926 }
927 927
928 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 928 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
929 { 929 {
930 } 930 }
931 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 931 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 72ee495..43b0da3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
81 /// </summary> 81 /// </summary>
82 public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi 82 public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi
83 { 83 {
84 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 84 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
85 protected IScriptEngine m_ScriptEngine; 85 protected IScriptEngine m_ScriptEngine;
86 protected SceneObjectPart m_host; 86 protected SceneObjectPart m_host;
87 protected uint m_localID; 87 protected uint m_localID;
@@ -10278,6 +10278,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10278 10278
10279 return GetLinkPrimitiveParams(obj, rules); 10279 return GetLinkPrimitiveParams(obj, rules);
10280 } 10280 }
10281
10282 public void print(string str)
10283 {
10284 // yes, this is a real LSL function. See: http://wiki.secondlife.com/wiki/Print
10285 IOSSL_Api ossl = (IOSSL_Api)m_ScriptEngine.GetApi(m_itemID, "OSSL");
10286 if (ossl != null)
10287 {
10288 ossl.CheckThreatLevel(ThreatLevel.High, "print");
10289 m_log.Info("LSL print():" + str);
10290 }
10291 }
10281 } 10292 }
10282 10293
10283 public class NotecardCache 10294 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 561e3b3..bd6a094 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -398,6 +398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
398 LSL_Vector llWind(LSL_Vector offset); 398 LSL_Vector llWind(LSL_Vector offset);
399 LSL_String llXorBase64Strings(string str1, string str2); 399 LSL_String llXorBase64Strings(string str1, string str2);
400 LSL_String llXorBase64StringsCorrect(string str1, string str2); 400 LSL_String llXorBase64StringsCorrect(string str1, string str2);
401 void print(string str);
401 402
402 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 403 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
403 LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 404 LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 451163f..3b29861 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -1847,5 +1847,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1847 { 1847 {
1848 return m_LSL_Functions.llClearPrimMedia(face); 1848 return m_LSL_Functions.llClearPrimMedia(face);
1849 } 1849 }
1850
1851 public void print(string str)
1852 {
1853 m_LSL_Functions.print(str);
1854 }
1850 } 1855 }
1851} 1856}
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 12ea453..c539047 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -65,6 +65,8 @@ namespace OpenSim.Services.GridService
65 protected UUID m_ScopeID = UUID.Zero; 65 protected UUID m_ScopeID = UUID.Zero;
66 protected bool m_Check4096 = true; 66 protected bool m_Check4096 = true;
67 protected string m_MapTileDirectory = string.Empty; 67 protected string m_MapTileDirectory = string.Empty;
68 protected string m_ThisGatekeeper = string.Empty;
69 protected Uri m_ThisGatekeeperURI = null;
68 70
69 // Hyperlink regions are hyperlinks on the map 71 // Hyperlink regions are hyperlinks on the map
70 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 72 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -123,6 +125,16 @@ namespace OpenSim.Services.GridService
123 125
124 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); 126 m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
125 127
128 m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
129 try
130 {
131 m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper);
132 }
133 catch
134 {
135 m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper);
136 }
137
126 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 138 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
127 139
128 m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); 140 m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
@@ -246,6 +258,8 @@ namespace OpenSim.Services.GridService
246 remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); 258 remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
247 259
248 reason = string.Empty; 260 reason = string.Empty;
261 Uri uri = null;
262
249 regInfo = new GridRegion(); 263 regInfo = new GridRegion();
250 if ( externalPort > 0) 264 if ( externalPort > 0)
251 regInfo.HttpPort = externalPort; 265 regInfo.HttpPort = externalPort;
@@ -256,8 +270,17 @@ namespace OpenSim.Services.GridService
256 else 270 else
257 regInfo.ExternalHostName = "0.0.0.0"; 271 regInfo.ExternalHostName = "0.0.0.0";
258 if ( serverURI != null) 272 if ( serverURI != null)
273 {
259 regInfo.ServerURI = serverURI; 274 regInfo.ServerURI = serverURI;
260 275 try
276 {
277 uri = new Uri(serverURI);
278 regInfo.ExternalHostName = uri.Host;
279 regInfo.HttpPort = (uint)uri.Port;
280 }
281 catch {}
282 }
283
261 if ( remoteRegionName != string.Empty ) 284 if ( remoteRegionName != string.Empty )
262 regInfo.RegionName = remoteRegionName; 285 regInfo.RegionName = remoteRegionName;
263 286
@@ -266,6 +289,18 @@ namespace OpenSim.Services.GridService
266 regInfo.ScopeID = scopeID; 289 regInfo.ScopeID = scopeID;
267 regInfo.EstateOwner = ownerID; 290 regInfo.EstateOwner = ownerID;
268 291
292 // Make sure we're not hyperlinking to regions on this grid!
293 if (m_ThisGatekeeperURI != null)
294 {
295 if (regInfo.ExternalHostName == m_ThisGatekeeperURI.Host && regInfo.HttpPort == m_ThisGatekeeperURI.Port)
296 {
297 reason = "Cannot hyperlink to regions on the same grid";
298 return false;
299 }
300 }
301 else
302 m_log.WarnFormat("[HYPERGRID LINKER]: Please set this grid's Gatekeeper's address in [GridService]!");
303
269 // Check for free coordinates 304 // Check for free coordinates
270 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); 305 GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
271 if (region != null) 306 if (region != null)
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index ebe0a72..d1dc17f 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -957,7 +957,7 @@ namespace OpenSim.Tests.Common.Mock
957 { 957 {
958 } 958 }
959 959
960 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 960 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
961 { 961 {
962 } 962 }
963 963
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index 4dc0e53..a6fe4b1 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -45,6 +45,12 @@
45 ;; Directory for map tile images of linked regions 45 ;; Directory for map tile images of linked regions
46 ; MapTileDirectory = "./maptiles" 46 ; MapTileDirectory = "./maptiles"
47 47
48 ; === HG ONLY ===
49 ;; change this to the address of your Gatekeeper service
50 ;; (usually bundled with the rest of the services in one
51 ;; Robust server in port 8002, but not always)
52 Gatekeeper="http://mygridserver.com:8002"
53
48[AvatarService] 54[AvatarService]
49 ; 55 ;
50 ; change this to your grid-wide grid server 56 ; change this to your grid-wide grid server
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example
index 816e9a6..995a33e 100644
--- a/bin/config-include/StandaloneCommon.ini.example
+++ b/bin/config-include/StandaloneCommon.ini.example
@@ -78,6 +78,11 @@
78 ;; For example: 78 ;; For example:
79 Region_Welcome_Area = "DefaultRegion, FallbackRegion" 79 Region_Welcome_Area = "DefaultRegion, FallbackRegion"
80 80
81 ; === HG ONLY ===
82 ;; change this to the address of your simulator
83 Gatekeeper="http://127.0.0.1:9000"
84
85
81[LibraryModule] 86[LibraryModule]
82 ; Set this if you want to change the name of the OpenSim Library 87 ; Set this if you want to change the name of the OpenSim Library
83 ;LibraryName = "My World's Library" 88 ;LibraryName = "My World's Library"