aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJeff Ames2008-05-16 01:22:11 +0000
committerJeff Ames2008-05-16 01:22:11 +0000
commit65c5efe43b68700bad94076d4cd421160203c5de (patch)
tree589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Region/Environment
parentThank you very much, mjm for : (diff)
downloadopensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.zip
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/InstantMessageReceiver.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/IScenePermissions.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/ITextureSender.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs22
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs34
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs136
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs82
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs444
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs262
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs60
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs118
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs132
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs202
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs88
-rw-r--r--OpenSim/Region/Environment/Types/UpdateQueue.cs4
50 files changed, 1116 insertions, 1116 deletions
diff --git a/OpenSim/Region/Environment/InstantMessageReceiver.cs b/OpenSim/Region/Environment/InstantMessageReceiver.cs
index b82b4aa..d82bffc 100644
--- a/OpenSim/Region/Environment/InstantMessageReceiver.cs
+++ b/OpenSim/Region/Environment/InstantMessageReceiver.cs
@@ -32,11 +32,11 @@ namespace OpenSim.Region.Environment
32 /// <summary> 32 /// <summary>
33 /// Bit Vector for Which Modules to send an instant message to from the Scene or an Associated Module 33 /// Bit Vector for Which Modules to send an instant message to from the Scene or an Associated Module
34 /// </summary> 34 /// </summary>
35 35
36 // This prevents the Modules from sending Instant messages to other modules through the scene 36 // This prevents the Modules from sending Instant messages to other modules through the scene
37 // and then receiving the same messages 37 // and then receiving the same messages
38 38
39 // This is mostly here because on LLSL and the SecondLife Client, IMs,Groups and friends are linked 39 // This is mostly here because on LLSL and the SecondLife Client, IMs,Groups and friends are linked
40 // inseparably 40 // inseparably
41 41
42 [Flags] 42 [Flags]
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
index 86958d1..d03e167 100644
--- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -31,7 +31,7 @@ using OpenSim.Region.Environment.Scenes;
31 31
32namespace OpenSim.Region.Environment.Interfaces 32namespace OpenSim.Region.Environment.Interfaces
33{ 33{
34 public interface IAvatarFactory 34 public interface IAvatarFactory
35 { 35 {
36 bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance); 36 bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
37 void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance); 37 void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);
diff --git a/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs b/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
index f28b46c..eba4a04 100644
--- a/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
+++ b/OpenSim/Region/Environment/Interfaces/IScenePermissions.cs
@@ -28,7 +28,7 @@
28using libsecondlife; 28using libsecondlife;
29 29
30namespace OpenSim.Region.Environment.Interfaces 30namespace OpenSim.Region.Environment.Interfaces
31{ 31{
32 public interface IScenePermissions 32 public interface IScenePermissions
33 { 33 {
34 } 34 }
diff --git a/OpenSim/Region/Environment/Interfaces/ITextureSender.cs b/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
index 1b9e4eb..ece1953 100644
--- a/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
+++ b/OpenSim/Region/Environment/Interfaces/ITextureSender.cs
@@ -31,17 +31,17 @@ namespace OpenSim.Region.Environment.Interfaces
31 /// Interface for an object which can send texture information to a client 31 /// Interface for an object which can send texture information to a client
32 /// </summary> 32 /// </summary>
33 public interface ITextureSender 33 public interface ITextureSender
34 { 34 {
35 /// <summary> 35 /// <summary>
36 /// Are we in the process of sending the texture? 36 /// Are we in the process of sending the texture?
37 /// </summary> 37 /// </summary>
38 bool Sending { get; set; } 38 bool Sending { get; set; }
39 39
40 /// <summary> 40 /// <summary>
41 /// Has the texture send been cancelled? 41 /// Has the texture send been cancelled?
42 /// </summary> 42 /// </summary>
43 bool Cancel { get; set; } 43 bool Cancel { get; set; }
44 44
45 /// <summary> 45 /// <summary>
46 /// Update the non data properties of a texture request 46 /// Update the non data properties of a texture request
47 /// </summary> 47 /// </summary>
@@ -53,6 +53,6 @@ namespace OpenSim.Region.Environment.Interfaces
53 /// Send a texture packet to the client. 53 /// Send a texture packet to the client.
54 /// </summary> 54 /// </summary>
55 /// <returns>True if the last packet has been sent, false otherwise.</returns> 55 /// <returns>True if the last packet has been sent, false otherwise.</returns>
56 bool SendTexturePacket(); 56 bool SendTexturePacket();
57 } 57 }
58} 58}
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 48db51b..d3cf41e 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
216 public IClientAPI RequestUser; 216 public IClientAPI RequestUser;
217 public LLUUID TransferRequestID; 217 public LLUUID TransferRequestID;
218 //public bool AssetInCache; 218 //public bool AssetInCache;
219 //public int TimeRequested; 219 //public int TimeRequested;
220 220
221 public AssetRequest() 221 public AssetRequest()
222 { 222 {
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index bae23fa..65785af 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
40 /// </summary> 40 /// </summary>
41 public class AgentAssetTransactions 41 public class AgentAssetTransactions
42 { 42 {
43 //private static readonly log4net.ILog m_log 43 //private static readonly log4net.ILog m_log
44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 // Fields 46 // Fields
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
192 } 192 }
193 193
194 ourClient.SendConfirmXfer(xferID, packetID); 194 ourClient.SendConfirmXfer(xferID, packetID);
195 195
196 if ((packetID & 0x80000000) != 0) 196 if ((packetID & 0x80000000) != 0)
197 { 197 {
198 SendCompleteMessage(); 198 SendCompleteMessage();
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
209 /// <param name="xferID"></param> 209 /// <param name="xferID"></param>
210 /// <param name="packetID"></param> 210 /// <param name="packetID"></param>
211 /// <param name="data"></param> 211 /// <param name="data"></param>
212 /// <returns>True if the transfer is complete, false otherwise</returns> 212 /// <returns>True if the transfer is complete, false otherwise</returns>
213 public bool Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, 213 public bool Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data,
214 bool storeLocal, bool tempFile) 214 bool storeLocal, bool tempFile)
215 { 215 {
@@ -363,7 +363,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
363 363
364 private void DoCreateItem() 364 private void DoCreateItem()
365 { 365 {
366 //really need to fix this call, if lbsa71 saw this he would die. 366 //really need to fix this call, if lbsa71 saw this he would die.
367 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset); 367 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset);
368 CachedUserInfo userInfo = 368 CachedUserInfo userInfo =
369 m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(ourClient.AgentId); 369 m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(ourClient.AgentId);
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
index fcd0e0c..fd407d9 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
199 199
200 /// <summary> 200 /// <summary>
201 /// Create an inventory item from data that has been received through a transaction. 201 /// Create an inventory item from data that has been received through a transaction.
202 /// 202 ///
203 /// This is called when new clothing or body parts are created. It may also be called in other 203 /// This is called when new clothing or body parts are created. It may also be called in other
204 /// situations. 204 /// situations.
205 /// </summary> 205 /// </summary>
@@ -229,8 +229,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
229 229
230 /// <summary> 230 /// <summary>
231 /// Update an inventory item with data that has been received through a transaction. 231 /// Update an inventory item with data that has been received through a transaction.
232 /// 232 ///
233 /// This is called when clothing or body parts are updated (for instance, with new textures or 233 /// This is called when clothing or body parts are updated (for instance, with new textures or
234 /// colours). It may also be called in other situations. 234 /// colours). It may also be called in other situations.
235 /// </summary> 235 /// </summary>
236 /// <param name="remoteClient"></param> 236 /// <param name="remoteClient"></param>
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 474ac75..8f81f3d 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
38{ 38{
39 public class TextureDownloadModule : IRegionModule 39 public class TextureDownloadModule : IRegionModule
40 { 40 {
41 //private static readonly log4net.ILog m_log 41 //private static readonly log4net.ILog m_log
42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 /// <summary> 44 /// <summary>
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
212 private void TextureSent(ITextureSender sender) 212 private void TextureSent(ITextureSender sender)
213 { 213 {
214 sender.Sending = false; 214 sender.Sending = false;
215 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); 215 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID);
216 m_scene.AddPendingDownloads(-1); 216 m_scene.AddPendingDownloads(-1);
217 } 217 }
218 } 218 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
index 70e44d4..7c187c0 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
37 /// </summary> 37 /// </summary>
38 public class TextureNotFoundSender : ITextureSender 38 public class TextureNotFoundSender : ITextureSender
39 { 39 {
40 //private static readonly log4net.ILog m_log 40 //private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private bool m_cancel = false; 43 private bool m_cancel = false;
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
80 public bool SendTexturePacket() 80 public bool SendTexturePacket()
81 { 81 {
82 //m_log.InfoFormat( 82 //m_log.InfoFormat(
83 // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", 83 // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found",
84 // m_textureId); 84 // m_textureId);
85 85
86 ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); 86 ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
index d4fa39f..42624ad 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// This module sets up texture senders in response to client texture requests, and places them on a 41 /// This module sets up texture senders in response to client texture requests, and places them on a
42 /// processing queue once those senders have the appropriate data (i.e. a texture retrieved from the 42 /// processing queue once those senders have the appropriate data (i.e. a texture retrieved from the
43 /// asset cache). 43 /// asset cache).
44 /// </summary> 44 /// </summary>
45 public class UserTextureDownloadService 45 public class UserTextureDownloadService
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
49 49
50 /// <summary> 50 /// <summary>
51 /// We will allow the client to request the same texture n times before dropping further requests 51 /// We will allow the client to request the same texture n times before dropping further requests
52 /// 52 ///
53 /// This number includes repeated requests for the same texture at different resolutions (which we don't 53 /// This number includes repeated requests for the same texture at different resolutions (which we don't
54 /// currently handle properly as far as I know). However, this situation should be handled in a more 54 /// currently handle properly as far as I know). However, this situation should be handled in a more
55 /// sophisticated way. 55 /// sophisticated way.
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
80 /// We're going to limit requests for the same missing texture. 80 /// We're going to limit requests for the same missing texture.
81 /// XXX This is really a temporary solution to deal with the situation where a client continually requests 81 /// XXX This is really a temporary solution to deal with the situation where a client continually requests
82 /// the same missing textures 82 /// the same missing textures
83 /// </summary> 83 /// </summary>
84 private readonly IRequestLimitStrategy<LLUUID> missingTextureLimitStrategy 84 private readonly IRequestLimitStrategy<LLUUID> missingTextureLimitStrategy
85 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS); 85 = new RepeatLimitStrategy<LLUUID>(MAX_ALLOWED_TEXTURE_REQUESTS);
86 86
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
93 } 93 }
94 94
95 /// <summary> 95 /// <summary>
96 /// Handle a texture request. This involves creating a texture sender and placing it on the 96 /// Handle a texture request. This involves creating a texture sender and placing it on the
97 /// previously passed in shared queue. 97 /// previously passed in shared queue.
98 /// </summary> 98 /// </summary>
99 /// <param name="e"></param> 99 /// <param name="e"></param>
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
108 { 108 {
109 if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) 109 if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender))
110 { 110 {
111 // If we've received new non UUID information for this request and it hasn't dispatched 111 // If we've received new non UUID information for this request and it hasn't dispatched
112 // yet, then update the request accordingly. 112 // yet, then update the request accordingly.
113 textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); 113 textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber);
114 } 114 }
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
117 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) 117 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
118 { 118 {
119// m_log.DebugFormat( 119// m_log.DebugFormat(
120// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}", 120// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}",
121// e.RequestedAssetID, m_client.AgentId); 121// e.RequestedAssetID, m_client.AgentId);
122 122
123 return; 123 return;
@@ -128,9 +128,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
128 { 128 {
129 if (StatsManager.SimExtraStats != null) 129 if (StatsManager.SimExtraStats != null)
130 StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); 130 StatsManager.SimExtraStats.AddBlockedMissingTextureRequest();
131 131
132 // Commenting out this message for now as it causes too much noise with other 132 // Commenting out this message for now as it causes too much noise with other
133 // debug messages. 133 // debug messages.
134// m_log.DebugFormat( 134// m_log.DebugFormat(
135// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", 135// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
136// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); 136// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index ea84436..be73156 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -35,7 +35,7 @@ using OpenSim.Region.Environment.Interfaces;
35namespace OpenSim.Region.Environment.Modules.Agent.TextureSender 35namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
36{ 36{
37 /// <summary> 37 /// <summary>
38 /// A TextureSender handles the process of receiving a texture requested by the client from the 38 /// A TextureSender handles the process of receiving a texture requested by the client from the
39 /// AssetCache, and then sending that texture back to the client. 39 /// AssetCache, and then sending that texture back to the client.
40 /// </summary> 40 /// </summary>
41 public class TextureSender : ITextureSender 41 public class TextureSender : ITextureSender
@@ -150,14 +150,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
150 { 150 {
151 if (NumPackets == 0) 151 if (NumPackets == 0)
152 { 152 {
153 153
154 RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); 154 RequestUser.SendImagePart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
155 155
156 PacketCounter++; 156 PacketCounter++;
157 } 157 }
158 else 158 else
159 { 159 {
160 160
161 byte[] ImageData1 = new byte[600]; 161 byte[] ImageData1 = new byte[600];
162 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); 162 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
163 163
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
167 } 167 }
168 else 168 else
169 { 169 {
170 // Doesn't like to be refactored... 170 // Doesn't like to be refactored...
171 ImagePacketPacket im = new ImagePacketPacket(); 171 ImagePacketPacket im = new ImagePacketPacket();
172 im.Header.Reliable = false; 172 im.Header.Reliable = false;
173 im.ImageID.Packet = (ushort)(PacketCounter); 173 im.ImageID.Packet = (ushort)(PacketCounter);
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
index 1b50bbd..16874d7 100644
--- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// 101 ///
102 /// </summary> 102 /// </summary>
103 /// <param name="remoteClient"></param> 103 /// <param name="remoteClient"></param>
104 /// <param name="xferID"></param> 104 /// <param name="xferID"></param>
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 9e5f376..a72010c 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -235,7 +235,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
235 { 235 {
236 TrySendChatMessage(presence, fromPos, regionPos, 236 TrySendChatMessage(presence, fromPos, regionPos,
237 fromAgentID, fromName, e.Type, message, ChatSourceType.Agent); 237 fromAgentID, fromName, e.Type, message, ChatSourceType.Agent);
238 238
239 } 239 }
240 }); 240 });
241 } 241 }
@@ -572,7 +572,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
572 string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; 572 string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)";
573 Regex RE = new Regex(regex, RegexOptions.Multiline); 573 Regex RE = new Regex(regex, RegexOptions.Multiline);
574 MatchCollection matches = RE.Matches(input); 574 MatchCollection matches = RE.Matches(input);
575 // Get some direct matches $1 $4 is a 575 // Get some direct matches $1 $4 is a
576 if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) 576 if ((matches.Count == 1) && (matches[0].Groups.Count == 5))
577 { 577 {
578 result = new Dictionary<string, string>(); 578 result = new Dictionary<string, string>();
@@ -703,7 +703,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
703 703
704 public void ProcessIRCCommand(string command) 704 public void ProcessIRCCommand(string command)
705 { 705 {
706 //m_log.Info("[IRC]: ProcessIRCCommand:" + command); 706 //m_log.Info("[IRC]: ProcessIRCCommand:" + command);
707 707
708 string[] commArgs = new string[command.Split(' ').Length]; 708 string[] commArgs = new string[command.Split(' ').Length];
709 string c_server = m_server; 709 string c_server = m_server;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index c63fc93..fab546b 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -46,10 +46,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
46 /// Demo Economy/Money Module. This is not a production quality money/economy module! 46 /// Demo Economy/Money Module. This is not a production quality money/economy module!
47 /// This is a demo for you to use when making one that works for you. 47 /// This is a demo for you to use when making one that works for you.
48 /// // To use the following you need to add: 48 /// // To use the following you need to add:
49 /// -helperuri <ADDRESS TO HERE OR grid MONEY SERVER> 49 /// -helperuri <ADDRESS TO HERE OR grid MONEY SERVER>
50 /// to the command line parameters you use to start up your client 50 /// to the command line parameters you use to start up your client
51 /// This commonly looks like -helperuri http://127.0.0.1:9000/ 51 /// This commonly looks like -helperuri http://127.0.0.1:9000/
52 /// 52 ///
53 /// Centralized grid structure example using OpenSimWi Redux revision 9+ 53 /// Centralized grid structure example using OpenSimWi Redux revision 9+
54 /// svn co https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux 54 /// svn co https://opensimwiredux.svn.sourceforge.net/svnroot/opensimwiredux
55 /// </summary> 55 /// </summary>
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
147 XMLRPCHandler = scene; 147 XMLRPCHandler = scene;
148 148
149 // To use the following you need to add: 149 // To use the following you need to add:
150 // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER> 150 // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER>
151 // to the command line parameters you use to start up your client 151 // to the command line parameters you use to start up your client
152 // This commonly looks like -helperuri http://127.0.0.1:9000/ 152 // This commonly looks like -helperuri http://127.0.0.1:9000/
153 153
@@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
276 private void OnNewClient(IClientAPI client) 276 private void OnNewClient(IClientAPI client)
277 { 277 {
278 // Here we check if we're in grid mode 278 // Here we check if we're in grid mode
279 // I imagine that the 'check balance' 279 // I imagine that the 'check balance'
280 // function for the client should be here or shortly after 280 // function for the client should be here or shortly after
281 281
282 if (gridmode) 282 if (gridmode)
@@ -367,7 +367,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
367 { 367 {
368 lock (m_KnownClientFunds) 368 lock (m_KnownClientFunds)
369 { 369 {
370 // If we don't know about the sender, then the sender can't 370 // If we don't know about the sender, then the sender can't
371 // actually be here and therefore this is likely fraud or outdated. 371 // actually be here and therefore this is likely fraud or outdated.
372 if (m_MoneyAddress.Length == 0) 372 if (m_MoneyAddress.Length == 0)
373 { 373 {
@@ -1394,7 +1394,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1394 1394
1395 1395
1396 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; 1396 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID;
1397 1397
1398 1398
1399 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); 1399 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + ".");
1400 // Claim User! my user! Mine mine mine! 1400 // Claim User! my user! Mine mine mine!
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
index 8c96392..c82f88d 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
@@ -97,9 +97,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
97 private void OnNewClient(IClientAPI client) 97 private void OnNewClient(IClientAPI client)
98 { 98 {
99 // All friends establishment protocol goes over instant message 99 // All friends establishment protocol goes over instant message
100 // There's no way to send a message from the sim 100 // There's no way to send a message from the sim
101 // to a user to 'add a friend' without causing dialog box spam 101 // to a user to 'add a friend' without causing dialog box spam
102 // 102 //
103 // The base set of friends are added when the user signs on in their XMLRPC response 103 // The base set of friends are added when the user signs on in their XMLRPC response
104 // Generated by LoginService. The friends are retreived from the database by the UserManager 104 // Generated by LoginService. The friends are retreived from the database by the UserManager
105 105
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
167 LLUUID[] Agents = new LLUUID[1]; 167 LLUUID[] Agents = new LLUUID[1];
168 Agents[0] = client.AgentId; 168 Agents[0] = client.AgentId;
169 av.ControllingClient.SendAgentOnline(Agents); 169 av.ControllingClient.SendAgentOnline(Agents);
170 170
171 } 171 }
172 } 172 }
173 } 173 }
@@ -223,14 +223,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
223 } 223 }
224 catch (IndexOutOfRangeException) 224 catch (IndexOutOfRangeException)
225 { 225 {
226 // Ignore the index out of range exception. 226 // Ignore the index out of range exception.
227 // This causes friend lists to get out of sync slightly.. however 227 // This causes friend lists to get out of sync slightly.. however
228 // prevents a sim crash. 228 // prevents a sim crash.
229 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 229 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
230 } 230 }
231 catch (ArgumentOutOfRangeException) 231 catch (ArgumentOutOfRangeException)
232 { 232 {
233 // Ignore the index out of range exception. 233 // Ignore the index out of range exception.
234 // This causes friend lists to get out of sync slightly.. however 234 // This causes friend lists to get out of sync slightly.. however
235 // prevents a sim crash. 235 // prevents a sim crash.
236 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 236 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
@@ -248,14 +248,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
248 248
249 catch (IndexOutOfRangeException) 249 catch (IndexOutOfRangeException)
250 { 250 {
251 // Ignore the index out of range exception. 251 // Ignore the index out of range exception.
252 // This causes friend lists to get out of sync slightly.. however 252 // This causes friend lists to get out of sync slightly.. however
253 // prevents a sim crash. 253 // prevents a sim crash.
254 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 254 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
255 } 255 }
256 catch (ArgumentOutOfRangeException) 256 catch (ArgumentOutOfRangeException)
257 { 257 {
258 // Ignore the index out of range exception. 258 // Ignore the index out of range exception.
259 // This causes friend lists to get out of sync slightly.. however 259 // This causes friend lists to get out of sync slightly.. however
260 // prevents a sim crash. 260 // prevents a sim crash.
261 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); 261 m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
@@ -411,10 +411,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
411 { 411 {
412 if (m_pendingFriendRequests.ContainsKey(transactionID)) 412 if (m_pendingFriendRequests.ContainsKey(transactionID))
413 { 413 {
414 // Found Pending Friend Request with that Transaction.. 414 // Found Pending Friend Request with that Transaction..
415 Scene SceneAgentIn = m_scene[0]; 415 Scene SceneAgentIn = m_scene[0];
416 416
417 // Found Pending Friend Request with that Transaction.. 417 // Found Pending Friend Request with that Transaction..
418 ScenePresence agentpresence = GetPresenceFromAgentID(agentID); 418 ScenePresence agentpresence = GetPresenceFromAgentID(agentID);
419 if (agentpresence != null) 419 if (agentpresence != null)
420 { 420 {
@@ -453,7 +453,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
453 { 453 {
454 Scene SceneAgentIn = m_scene[0]; 454 Scene SceneAgentIn = m_scene[0];
455 455
456 // Found Pending Friend Request with that Transaction.. 456 // Found Pending Friend Request with that Transaction..
457 ScenePresence agentpresence = GetPresenceFromAgentID(agentID); 457 ScenePresence agentpresence = GetPresenceFromAgentID(agentID);
458 if (agentpresence != null) 458 if (agentpresence != null)
459 { 459 {
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
index 624f307..e1cc688 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
107 107
108 // First byte of the array is probably the item type 108 // First byte of the array is probably the item type
109 // Next 16 bytes are the UUID 109 // Next 16 bytes are the UUID
110 //Array.Copy(binaryBucket, 1, rawId, 0, 16); 110 //Array.Copy(binaryBucket, 1, rawId, 0, 16);
111 111
112 //LLUUID itemId = new LLUUID(new Guid(rawId)); 112 //LLUUID itemId = new LLUUID(new Guid(rawId));
113 LLUUID itemId = new LLUUID(binaryBucket, 1); 113 LLUUID itemId = new LLUUID(binaryBucket, 1);
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
index 15825b6..2e2be7a 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles
86 } 86 }
87 87
88 /// <summary> 88 /// <summary>
89 /// 89 ///
90 /// </summary> 90 /// </summary>
91 /// <param name="remoteClient"></param> 91 /// <param name="remoteClient"></param>
92 /// <param name="avatarID"></param> 92 /// <param name="avatarID"></param>
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
index 2112f91..f8651a3 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice
226 public string ProvisionVoiceAccountRequest(string request, string path, string param, 226 public string ProvisionVoiceAccountRequest(string request, string path, string param,
227 LLUUID agentID, Caps caps) 227 LLUUID agentID, Caps caps)
228 { 228 {
229 // we need to 229 // we need to
230 // - get user data from UserProfileCacheService 230 // - get user data from UserProfileCacheService
231 // - generate nonce for user voice account password 231 // - generate nonce for user voice account password
232 // - issue XmlRpc request to asterisk opensim front end: 232 // - issue XmlRpc request to asterisk opensim front end:
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index e1339a3..87ecfee 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -40,25 +40,25 @@ using OpenSim.Region.Environment.Scenes;
40/***************************************************** 40/*****************************************************
41 * 41 *
42 * ScriptsHttpRequests 42 * ScriptsHttpRequests
43 * 43 *
44 * Implements the llHttpRequest and http_response 44 * Implements the llHttpRequest and http_response
45 * callback. 45 * callback.
46 * 46 *
47 * Some stuff was already in LSLLongCmdHandler, and then 47 * Some stuff was already in LSLLongCmdHandler, and then
48 * there was this file with a stub class in it. So, 48 * there was this file with a stub class in it. So,
49 * I am moving some of the objects and functions out of 49 * I am moving some of the objects and functions out of
50 * LSLLongCmdHandler, such as the HttpRequestClass, the 50 * LSLLongCmdHandler, such as the HttpRequestClass, the
51 * start and stop methods, and setting up pending and 51 * start and stop methods, and setting up pending and
52 * completed queues. These are processed in the 52 * completed queues. These are processed in the
53 * LSLLongCmdHandler polling loop. Similiar to the 53 * LSLLongCmdHandler polling loop. Similiar to the
54 * XMLRPCModule, since that seems to work. 54 * XMLRPCModule, since that seems to work.
55 * 55 *
56 * //TODO 56 * //TODO
57 * 57 *
58 * This probably needs some throttling mechanism but 58 * This probably needs some throttling mechanism but
59 * its wide open right now. This applies to both 59 * its wide open right now. This applies to both
60 * number of requests and data volume. 60 * number of requests and data volume.
61 * 61 *
62 * Linden puts all kinds of header fields in the requests. 62 * Linden puts all kinds of header fields in the requests.
63 * Not doing any of that: 63 * Not doing any of that:
64 * User-Agent 64 * User-Agent
@@ -71,13 +71,13 @@ using OpenSim.Region.Environment.Scenes;
71 * X-SecondLife-Local-Rotation 71 * X-SecondLife-Local-Rotation
72 * X-SecondLife-Owner-Name 72 * X-SecondLife-Owner-Name
73 * X-SecondLife-Owner-Key 73 * X-SecondLife-Owner-Key
74 * 74 *
75 * HTTPS support 75 * HTTPS support
76 * 76 *
77 * Configurable timeout? 77 * Configurable timeout?
78 * Configurable max repsonse size? 78 * Configurable max repsonse size?
79 * Configurable 79 * Configurable
80 * 80 *
81 * **************************************************/ 81 * **************************************************/
82 82
83namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest 83namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
index 626c60f..bbd4fa3 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
226 foreach (string line in lines) 226 foreach (string line in lines)
227 { 227 {
228 string nextLine = line.Trim(); 228 string nextLine = line.Trim();
229 //replace with switch, or even better, do some proper parsing 229 //replace with switch, or even better, do some proper parsing
230 if (nextLine.StartsWith("MoveTo")) 230 if (nextLine.StartsWith("MoveTo"))
231 { 231 {
232 float x = 0; 232 float x = 0;
diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
index 7a15708..4ed0fb5 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
@@ -37,25 +37,25 @@ using OpenSim.Region.Environment.Scenes;
37/***************************************************** 37/*****************************************************
38 * 38 *
39 * WorldCommModule 39 * WorldCommModule
40 * 40 *
41 * 41 *
42 * Holding place for world comms - basically llListen 42 * Holding place for world comms - basically llListen
43 * function implementation. 43 * function implementation.
44 * 44 *
45 * lLListen(integer channel, string name, key id, string msg) 45 * lLListen(integer channel, string name, key id, string msg)
46 * The name, id, and msg arguments specify the filtering 46 * The name, id, and msg arguments specify the filtering
47 * criteria. You can pass the empty string 47 * criteria. You can pass the empty string
48 * (or NULL_KEY for id) for these to set a completely 48 * (or NULL_KEY for id) for these to set a completely
49 * open filter; this causes the listen() event handler to be 49 * open filter; this causes the listen() event handler to be
50 * invoked for all chat on the channel. To listen only 50 * invoked for all chat on the channel. To listen only
51 * for chat spoken by a specific object or avatar, 51 * for chat spoken by a specific object or avatar,
52 * specify the name and/or id arguments. To listen 52 * specify the name and/or id arguments. To listen
53 * only for a specific command, specify the 53 * only for a specific command, specify the
54 * (case-sensitive) msg argument. If msg is not empty, 54 * (case-sensitive) msg argument. If msg is not empty,
55 * listener will only hear strings which are exactly equal 55 * listener will only hear strings which are exactly equal
56 * to msg. You can also use all the arguments to establish 56 * to msg. You can also use all the arguments to establish
57 * the most restrictive filtering criteria. 57 * the most restrictive filtering criteria.
58 * 58 *
59 * It might be useful for each listener to maintain a message 59 * It might be useful for each listener to maintain a message
60 * digest, with a list of recent messages by UUID. This can 60 * digest, with a list of recent messages by UUID. This can
61 * be used to prevent in-world repeater loops. However, the 61 * be used to prevent in-world repeater loops. However, the
@@ -76,7 +76,7 @@ using OpenSim.Region.Environment.Scenes;
76 * Might be actually easier to map the global handle into 76 * Might be actually easier to map the global handle into
77 * script-local handle in the ScriptEngine. Not sure if its 77 * script-local handle in the ScriptEngine. Not sure if its
78 * worth the effort tho. 78 * worth the effort tho.
79 * 79 *
80 * **************************************************/ 80 * **************************************************/
81 81
82namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm 82namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
@@ -317,9 +317,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
317 } 317 }
318 318
319 /******************************************************************** 319 /********************************************************************
320 * 320 *
321 * Listener Stuff 321 * Listener Stuff
322 * 322 *
323 * *****************************************************************/ 323 * *****************************************************************/
324 324
325 private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) 325 private void DeliverClientMessage(Object sender, ChatFromViewerArgs e)
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
index a039d42..9d4e0fa 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
@@ -43,12 +43,12 @@ using OpenSim.Region.Environment.Scenes;
43/***************************************************** 43/*****************************************************
44 * 44 *
45 * XMLRPCModule 45 * XMLRPCModule
46 * 46 *
47 * Module for accepting incoming communications from 47 * Module for accepting incoming communications from
48 * external XMLRPC client and calling a remote data 48 * external XMLRPC client and calling a remote data
49 * procedure for a registered data channel/prim. 49 * procedure for a registered data channel/prim.
50 * 50 *
51 * 51 *
52 * 1. On module load, open a listener port 52 * 1. On module load, open a listener port
53 * 2. Attach an XMLRPC handler 53 * 2. Attach an XMLRPC handler
54 * 3. When a request is received: 54 * 3. When a request is received:
@@ -59,18 +59,18 @@ using OpenSim.Region.Environment.Scenes;
59 * 3.5 Return response to client caller 59 * 3.5 Return response to client caller
60 * 3.6 If no response from llRemoteDataReply within 60 * 3.6 If no response from llRemoteDataReply within
61 * RemoteReplyScriptTimeout, generate script timeout fault 61 * RemoteReplyScriptTimeout, generate script timeout fault
62 * 62 *
63 * Prims in script must: 63 * Prims in script must:
64 * 1. Open a remote data channel 64 * 1. Open a remote data channel
65 * 1.1 Generate a channel ID 65 * 1.1 Generate a channel ID
66 * 1.2 Register primid,channelid pair with module 66 * 1.2 Register primid,channelid pair with module
67 * 2. Implement the remote data procedure handler 67 * 2. Implement the remote data procedure handler
68 * 68 *
69 * llOpenRemoteDataChannel 69 * llOpenRemoteDataChannel
70 * llRemoteDataReply 70 * llRemoteDataReply
71 * remote_data(integer type, key channel, key messageid, string sender, integer ival, string sval) 71 * remote_data(integer type, key channel, key messageid, string sender, integer ival, string sval)
72 * llCloseRemoteDataChannel 72 * llCloseRemoteDataChannel
73 * 73 *
74 * **************************************************/ 74 * **************************************************/
75 75
76namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC 76namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
@@ -157,16 +157,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
157 157
158 /********************************************** 158 /**********************************************
159 * OpenXMLRPCChannel 159 * OpenXMLRPCChannel
160 * 160 *
161 * Generate a LLUUID channel key and add it and 161 * Generate a LLUUID channel key and add it and
162 * the prim id to dictionary <channelUUID, primUUID> 162 * the prim id to dictionary <channelUUID, primUUID>
163 * 163 *
164 * First check if there is a channel assigned for 164 * First check if there is a channel assigned for
165 * this itemID. If there is, then someone called 165 * this itemID. If there is, then someone called
166 * llOpenRemoteDataChannel twice. Just return the 166 * llOpenRemoteDataChannel twice. Just return the
167 * original channel. Other option is to delete the 167 * original channel. Other option is to delete the
168 * current channel and assign a new one. 168 * current channel and assign a new one.
169 * 169 *
170 * ********************************************/ 170 * ********************************************/
171 171
172 public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID) 172 public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID)
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
224 224
225 /********************************************** 225 /**********************************************
226 * Remote Data Reply 226 * Remote Data Reply
227 * 227 *
228 * Response to RPC message 228 * Response to RPC message
229 * 229 *
230 *********************************************/ 230 *********************************************/
231 231
232 public void RemoteDataReply(string channel, string message_id, string sdata, int idata) 232 public void RemoteDataReply(string channel, string message_id, string sdata, int idata)
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
245 245
246 /********************************************** 246 /**********************************************
247 * CloseXMLRPCChannel 247 * CloseXMLRPCChannel
248 * 248 *
249 * Remove channel from dictionary 249 * Remove channel from dictionary
250 * 250 *
251 *********************************************/ 251 *********************************************/
252 252
253 public void CloseXMLRPCChannel(LLUUID channelKey) 253 public void CloseXMLRPCChannel(LLUUID channelKey)
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index b5d5e6e..82341a9 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
41 #region Constants 41 #region Constants
42 42
43 //Land types set with flags in ParcelOverlay. 43 //Land types set with flags in ParcelOverlay.
44 //Only one of these can be used. 44 //Only one of these can be used.
45 public const float BAN_LINE_SAFETY_HIEGHT = 100; 45 public const float BAN_LINE_SAFETY_HIEGHT = 100;
46 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000 46 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000
47 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000 47 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000
@@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
584 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) 584 if (byteArrayCount >= LAND_BLOCKS_PER_PACKET)
585 { 585 {
586 remote_client.sendLandParcelOverlay(byteArray, sequenceID); 586 remote_client.sendLandParcelOverlay(byteArray, sequenceID);
587 byteArrayCount = 0; 587 byteArrayCount = 0;
588 sequenceID++; 588 sequenceID++;
589 byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 589 byteArray = new byte[LAND_BLOCKS_PER_PACKET];
590 } 590 }
@@ -655,7 +655,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
655 655
656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) 656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
657 { 657 {
658 658
659 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); 659 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
660 } 660 }
661 661
@@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
870 } 870 }
871 871
872 public void handleAnyClientMovement(ScenePresence avatar) 872 public void handleAnyClientMovement(ScenePresence avatar)
873 //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. 873 //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance.
874 { 874 {
875 ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 875 ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
876 if (over != null) 876 if (over != null)
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index b319370..54870d8 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -622,7 +622,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
622 /// <summary> 622 /// <summary>
623 /// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes 623 /// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
624 /// aggreagete details such as the number of prims. 624 /// aggreagete details such as the number of prims.
625 /// 625 ///
626 /// </summary> 626 /// </summary>
627 /// <param name="remote_client"> 627 /// <param name="remote_client">
628 /// A <see cref="IClientAPI"/> 628 /// A <see cref="IClientAPI"/>
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index d31a250..43e8f36 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
47 47
48 #region Constants 48 #region Constants
49 // These are here for testing. They will be taken out 49 // These are here for testing. They will be taken out
50 50
51 //private uint PERM_ALL = (uint)2147483647; 51 //private uint PERM_ALL = (uint)2147483647;
52 private uint PERM_COPY = (uint)32768; 52 private uint PERM_COPY = (uint)32768;
53 //private uint PERM_MODIFY = (uint)16384; 53 //private uint PERM_MODIFY = (uint)16384;
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
59 59
60 #region Bypass Permissions / Debug Permissions Stuff 60 #region Bypass Permissions / Debug Permissions Stuff
61 61
62 // Bypasses the permissions engine 62 // Bypasses the permissions engine
63 private bool m_bypassPermissions = false; 63 private bool m_bypassPermissions = false;
64 private bool m_bypassPermissionsValue = true; 64 private bool m_bypassPermissionsValue = true;
65 private bool m_debugPermissions = false; 65 private bool m_debugPermissions = false;
@@ -126,18 +126,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
126 public void Initialise(Scene scene, IConfigSource config) 126 public void Initialise(Scene scene, IConfigSource config)
127 { 127 {
128 m_scene = scene; 128 m_scene = scene;
129 129
130 IConfig myConfig = config.Configs["Startup"]; 130 IConfig myConfig = config.Configs["Startup"];
131
132 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
133 131
134 List<string> modules=new List<string>(permissionModules.Split(',')); 132 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
133
134 List<string> modules=new List<string>(permissionModules.Split(','));
135 135
136 if(!modules.Contains("DefaultPermissionsModule")) 136 if (!modules.Contains("DefaultPermissionsModule"))
137 return; 137 return;
138
139 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
138 140
139 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
140
141 m_scene.RegisterModuleInterface<IScenePermissions>(this); 141 m_scene.RegisterModuleInterface<IScenePermissions>(this);
142 142
143 //Register functions with Scene External Checks! 143 //Register functions with Scene External Checks!
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
212 get { return false; } 212 get { return false; }
213 } 213 }
214 214
215 #endregion 215 #endregion
216 216
217 #region Helper Functions 217 #region Helper Functions
218 protected void SendPermissionError(LLUUID user, string reason) 218 protected void SendPermissionError(LLUUID user, string reason)
@@ -252,38 +252,38 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
252 } 252 }
253#endregion 253#endregion
254 254
255 public bool PropagatePermissions() 255 public bool PropagatePermissions()
256 { 256 {
257 return false; 257 return false;
258 } 258 }
259 259
260 public bool BypassPermissions() 260 public bool BypassPermissions()
261 { 261 {
262 return m_bypassPermissions; 262 return m_bypassPermissions;
263 } 263 }
264 264
265 public void SetBypassPermissions(bool value) 265 public void SetBypassPermissions(bool value)
266 { 266 {
267 m_bypassPermissions=value; 267 m_bypassPermissions=value;
268 } 268 }
269 269
270 #region Object Permissions 270 #region Object Permissions
271 271
272 public uint GenerateClientFlags(LLUUID user, LLUUID objID) 272 public uint GenerateClientFlags(LLUUID user, LLUUID objID)
273 { 273 {
274 // Here's the way this works, 274 // Here's the way this works,
275 // ObjectFlags and Permission flags are two different enumerations 275 // ObjectFlags and Permission flags are two different enumerations
276 // ObjectFlags, however, tells the client to change what it will allow the user to do. 276 // ObjectFlags, however, tells the client to change what it will allow the user to do.
277 // So, that means that all of the permissions type ObjectFlags are /temporary/ and only 277 // So, that means that all of the permissions type ObjectFlags are /temporary/ and only
278 // supposed to be set when customizing the objectflags for the client. 278 // supposed to be set when customizing the objectflags for the client.
279 279
280 // These temporary objectflags get computed and added in this function based on the 280 // These temporary objectflags get computed and added in this function based on the
281 // Permission mask that's appropriate! 281 // Permission mask that's appropriate!
282 // Outside of this method, they should never be added to objectflags! 282 // Outside of this method, they should never be added to objectflags!
283 // -teravus 283 // -teravus
284 284
285 SceneObjectPart task=m_scene.GetSceneObjectPart(objID); 285 SceneObjectPart task=m_scene.GetSceneObjectPart(objID);
286 286
287 // this shouldn't ever happen.. return no permissions/objectflags. 287 // this shouldn't ever happen.. return no permissions/objectflags.
288 if (task == null) 288 if (task == null)
289 return (uint)0; 289 return (uint)0;
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
292 LLUUID objectOwner = task.OwnerID; 292 LLUUID objectOwner = task.OwnerID;
293 293
294 294
295 // Remove any of the objectFlags that are temporary. These will get added back if appropriate 295 // Remove any of the objectFlags that are temporary. These will get added back if appropriate
296 // in the next bit of code 296 // in the next bit of code
297 297
298 objflags &= (uint) 298 objflags &= (uint)
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
354 354
355 private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask) 355 private uint ApplyObjectModifyMasks(uint setPermissionMask, uint objectFlagsMask)
356 { 356 {
357 // We are adding the temporary objectflags to the object's objectflags based on the 357 // We are adding the temporary objectflags to the object's objectflags based on the
358 // permission flag given. These change the F flags on the client. 358 // permission flag given. These change the F flags on the client.
359 359
360 if ((setPermissionMask & (uint)PermissionMask.Copy) != 0) 360 if ((setPermissionMask & (uint)PermissionMask.Copy) != 0)
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
404 locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); 404 locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
405 405
406 // People shouldn't be able to do anything with locked objects, except the Administrator 406 // People shouldn't be able to do anything with locked objects, except the Administrator
407 // The 'set permissions' runs through a different permission check, so when an object owner 407 // The 'set permissions' runs through a different permission check, so when an object owner
408 // sets an object locked, the only thing that they can do is unlock it. 408 // sets an object locked, the only thing that they can do is unlock it.
409 // 409 //
410 // Nobody but the object owner can set permissions on an object 410 // Nobody but the object owner can set permissions on an object
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
458 bool permission = false; 458 bool permission = false;
459 string reason = "Only registered users may communicate with another account."; 459 string reason = "Only registered users may communicate with another account.";
460 460
461 461
462 if (IsAdministrator(user)) 462 if (IsAdministrator(user))
463 permission = true; 463 permission = true;
464 464
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
521 return GenericParcelPermission(user, parcel); 521 return GenericParcelPermission(user, parcel);
522 } 522 }
523#endregion 523#endregion
524 524
525 #region Permission Checks 525 #region Permission Checks
526 private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene) 526 private bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene)
527 { 527 {
@@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
607 { 607 {
608 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 608 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
609 if (m_bypassPermissions) return m_bypassPermissionsValue; 609 if (m_bypassPermissions) return m_bypassPermissionsValue;
610 610
611 return GenericCommunicationPermission(user, target); 611 return GenericCommunicationPermission(user, target);
612 } 612 }
613 613
@@ -632,8 +632,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
632 return false; 632 return false;
633 } 633 }
634 634
635 // The client 635 // The client
636 // may request to edit linked parts, and therefore, it needs 636 // may request to edit linked parts, and therefore, it needs
637 // to also check for SceneObjectPart 637 // to also check for SceneObjectPart
638 638
639 // If it's not an object, we cant edit it. 639 // If it's not an object, we cant edit it.
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
647 647
648 648
649 LLUUID taskOwner = null; 649 LLUUID taskOwner = null;
650 // Added this because at this point in time it wouldn't be wise for 650 // Added this because at this point in time it wouldn't be wise for
651 // the administrator object permissions to take effect. 651 // the administrator object permissions to take effect.
652 LLUUID objectOwner = task.OwnerID; 652 LLUUID objectOwner = task.OwnerID;
653 653
@@ -682,12 +682,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
682 682
683 683
684 // This is an exception to the generic object permission. 684 // This is an exception to the generic object permission.
685 // Administrators who lock their objects should not be able to move them, 685 // Administrators who lock their objects should not be able to move them,
686 // however generic object permission should return true. 686 // however generic object permission should return true.
687 // This keeps locked objects from being affected by random click + drag actions by accident 687 // This keeps locked objects from being affected by random click + drag actions by accident
688 // and allows the administrator to grab or delete a locked object. 688 // and allows the administrator to grab or delete a locked object.
689 689
690 // Administrators and estate managers are still able to click+grab locked objects not 690 // Administrators and estate managers are still able to click+grab locked objects not
691 // owned by them in the scene 691 // owned by them in the scene
692 // This is by design. 692 // This is by design.
693 693
@@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
834 834
835 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; 835 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
836 LLUUID taskOwner = null; 836 LLUUID taskOwner = null;
837 // Added this because at this point in time it wouldn't be wise for 837 // Added this because at this point in time it wouldn't be wise for
838 // the administrator object permissions to take effect. 838 // the administrator object permissions to take effect.
839 LLUUID objectOwner = task.OwnerID; 839 LLUUID objectOwner = task.OwnerID;
840 840
@@ -895,61 +895,61 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
895 895
896 #endregion 896 #endregion
897 897
898 public bool CanLinkObject(LLUUID userID, LLUUID objectID) 898 public bool CanLinkObject(LLUUID userID, LLUUID objectID)
899 { 899 {
900 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 900 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
901 if (m_bypassPermissions) return m_bypassPermissionsValue; 901 if (m_bypassPermissions) return m_bypassPermissionsValue;
902 902
903 return true; 903 return true;
904 } 904 }
905 905
906 public bool CanDelinkObject(LLUUID userID, LLUUID objectID) 906 public bool CanDelinkObject(LLUUID userID, LLUUID objectID)
907 { 907 {
908 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 908 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
909 if (m_bypassPermissions) return m_bypassPermissionsValue; 909 if (m_bypassPermissions) return m_bypassPermissionsValue;
910 910
911 return true; 911 return true;
912 } 912 }
913 913
914 public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene) 914 public bool CanBuyLand(LLUUID userID, ILandObject parcel, Scene scene)
915 { 915 {
916 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 916 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
917 if (m_bypassPermissions) return m_bypassPermissionsValue; 917 if (m_bypassPermissions) return m_bypassPermissionsValue;
918 918
919 return true; 919 return true;
920 } 920 }
921 921
922 public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 922 public bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
923 { 923 {
924 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 924 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
925 if (m_bypassPermissions) return m_bypassPermissionsValue; 925 if (m_bypassPermissions) return m_bypassPermissionsValue;
926 926
927 return true; 927 return true;
928 } 928 }
929 929
930 public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 930 public bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
931 { 931 {
932 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 932 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
933 if (m_bypassPermissions) return m_bypassPermissionsValue; 933 if (m_bypassPermissions) return m_bypassPermissionsValue;
934 934
935 return true; 935 return true;
936 } 936 }
937 937
938 public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) 938 public bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
939 { 939 {
940 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 940 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
941 if (m_bypassPermissions) return m_bypassPermissionsValue; 941 if (m_bypassPermissions) return m_bypassPermissionsValue;
942 942
943 return true; 943 return true;
944 } 944 }
945 945
946 public bool CanTeleport(LLUUID userID) 946 public bool CanTeleport(LLUUID userID)
947 { 947 {
948 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 948 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
949 if (m_bypassPermissions) return m_bypassPermissionsValue; 949 if (m_bypassPermissions) return m_bypassPermissionsValue;
950 950
951 return true; 951 return true;
952 } 952 }
953 953
954 954
955 } 955 }
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index beb74ce..1bdc702 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules
99 // Current time in elpased seconds since Jan 1st 1970 99 // Current time in elpased seconds since Jan 1st 1970
100 private ulong CurrentTime 100 private ulong CurrentTime
101 { 101 {
102 get { 102 get {
103 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000); 103 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
104 } 104 }
105 } 105 }
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules
118 118
119 TimeZone local = TimeZone.CurrentTimeZone; 119 TimeZone local = TimeZone.CurrentTimeZone;
120 TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; 120 TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
121 121
122 m_log.Debug("[SUN] localtime offset is " + TicksOffset); 122 m_log.Debug("[SUN] localtime offset is " + TicksOffset);
123 123
124 // Align ticks with Second Life 124 // Align ticks with Second Life
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment.Modules
246 avatar.ControllingClient.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); 246 avatar.ControllingClient.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
247 } 247 }
248 248
249 // set estate settings for region access to sun position 249 // set estate settings for region access to sun position
250 m_scene.RegionInfo.EstateSettings.sunPosition = Position; 250 m_scene.RegionInfo.EstateSettings.sunPosition = Position;
251 } 251 }
252 252
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules
281 281
282 Position = LLVector3.Rot(Position,Tilt); 282 Position = LLVector3.Rot(Position,Tilt);
283 283
284 // Finally we shift the axis so that more of the 284 // Finally we shift the axis so that more of the
285 // circle is above the horizon than below. This 285 // circle is above the horizon than below. This
286 // makes the nights shorter than the days. 286 // makes the nights shorter than the days.
287 287
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
index eb981d9..98d69a5 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
@@ -31,9 +31,9 @@ using OpenSim.Region.Environment.Interfaces;
31namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders 31namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// A generic windows bitmap loader. 34 /// A generic windows bitmap loader.
35 /// Should be capable of handling 24-bit RGB images. 35 /// Should be capable of handling 24-bit RGB images.
36 /// 36 ///
37 /// Uses the System.Drawing filesystem loader. 37 /// Uses the System.Drawing filesystem loader.
38 /// </summary> 38 /// </summary>
39 internal class BMP : GenericSystemDrawing 39 internal class BMP : GenericSystemDrawing
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 484bb89..bb819e1 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -33,7 +33,7 @@ using OpenSim.Region.Environment.Interfaces;
33namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders 33namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
34{ 34{
35 /// <summary> 35 /// <summary>
36 /// A virtual class designed to have methods overloaded, 36 /// A virtual class designed to have methods overloaded,
37 /// this class provides an interface for a generic image 37 /// this class provides an interface for a generic image
38 /// saving and loading mechanism, but does not specify the 38 /// saving and loading mechanism, but does not specify the
39 /// format. It should not be insubstantiated directly. 39 /// format. It should not be insubstantiated directly.
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Protected method, generates a grayscale bitmap 102 /// Protected method, generates a grayscale bitmap
103 /// image from a specified terrain channel. 103 /// image from a specified terrain channel.
104 /// </summary> 104 /// </summary>
105 /// <param name="map">The terrain channel to export to bitmap</param> 105 /// <param name="map">The terrain channel to export to bitmap</param>
@@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// Protected method, generates a coloured bitmap 137 /// Protected method, generates a coloured bitmap
138 /// image from a specified terrain channel. 138 /// image from a specified terrain channel.
139 /// </summary> 139 /// </summary>
140 /// <param name="map">The terrain channel to export to bitmap</param> 140 /// <param name="map">The terrain channel to export to bitmap</param>
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
index 0c4e3de..7bf88f0 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
43 double sum = 0.0; 43 double sum = 0.0;
44 double step2 = 0.0; 44 double step2 = 0.0;
45 45
46 // compute delta map 46 // compute delta map
47 for (x = 0; x < map.Width; x++) 47 for (x = 0; x < map.Width; x++)
48 { 48 {
49 for (y = 0; y < map.Height; y++) 49 for (y = 0; y < map.Height; y++)
50 { 50 {
51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
52 52
53 if (z > 0) // add in non-zero amount 53 if (z > 0) // add in non-zero amount
54 { 54 {
55 sum += map[x, y] * z; 55 sum += map[x, y] * z;
56 step2 += z; 56 step2 += z;
@@ -60,14 +60,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
60 60
61 double avg = sum / step2; 61 double avg = sum / step2;
62 62
63 // blend in map 63 // blend in map
64 for (x = 0; x < map.Width; x++) 64 for (x = 0; x < map.Width; x++)
65 { 65 {
66 for (y = 0; y < map.Height; y++) 66 for (y = 0; y < map.Height; y++)
67 { 67 {
68 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration; 68 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration;
69 69
70 if (z > 0) // add in non-zero amount 70 if (z > 0) // add in non-zero amount
71 { 71 {
72 if (z > 1.0) 72 if (z > 1.0)
73 z = 1.0; 73 z = 1.0;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
index f2a1800..6df8408 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/OlsenSphere.cs
@@ -32,8 +32,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// Speed-Optimised Hybrid Erosion Brush 34 /// Speed-Optimised Hybrid Erosion Brush
35 /// 35 ///
36 /// As per Jacob Olsen's Paper 36 /// As per Jacob Olsen's Paper
37 /// http://www.oddlabs.com/download/terrain_generation.pdf 37 /// http://www.oddlabs.com/download/terrain_generation.pdf
38 /// </summary> 38 /// </summary>
39 public class OlsenSphere : ITerrainPaintableEffect 39 public class OlsenSphere : ITerrainPaintableEffect
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
164 { 164 {
165 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 165 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
166 166
167 if (z > 0) // add in non-zero amount 167 if (z > 0) // add in non-zero amount
168 { 168 {
169 const int NEIGHBOUR_ME = 4; 169 const int NEIGHBOUR_ME = 4;
170 const int NEIGHBOUR_MAX = 9; 170 const int NEIGHBOUR_MAX = 9;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
index 49946fd..fc0a579 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/SmoothSphere.cs
@@ -43,14 +43,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
43 double area = strength; 43 double area = strength;
44 double step = strength / 4.0; 44 double step = strength / 4.0;
45 45
46 // compute delta map 46 // compute delta map
47 for (x = 0; x < map.Width; x++) 47 for (x = 0; x < map.Width; x++)
48 { 48 {
49 for (y = 0; y < map.Height; y++) 49 for (y = 0; y < map.Height; y++)
50 { 50 {
51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 51 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
52 52
53 if (z > 0) // add in non-zero amount 53 if (z > 0) // add in non-zero amount
54 { 54 {
55 double average = 0.0; 55 double average = 0.0;
56 int avgsteps = 0; 56 int avgsteps = 0;
@@ -69,14 +69,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
69 } 69 }
70 } 70 }
71 } 71 }
72 // blend in map 72 // blend in map
73 for (x = 0; x < map.Width; x++) 73 for (x = 0; x < map.Width; x++)
74 { 74 {
75 for (y = 0; y < map.Height; y++) 75 for (y = 0; y < map.Height; y++)
76 { 76 {
77 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 77 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
78 78
79 if (z > 0) // add in non-zero amount 79 if (z > 0) // add in non-zero amount
80 { 80 {
81 double da = z; 81 double da = z;
82 double a = (map[x, y] - tweak[x, y]) * da; 82 double a = (map[x, y] - tweak[x, y]) * da;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
index 753d171..b3aa732 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
@@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
160 { 160 {
161 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 161 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
162 162
163 if (z > 0) // add in non-zero amount 163 if (z > 0) // add in non-zero amount
164 { 164 {
165 const int NEIGHBOUR_ME = 4; 165 const int NEIGHBOUR_ME = 4;
166 const int NEIGHBOUR_MAX = 9; 166 const int NEIGHBOUR_MAX = 9;
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 18a2851..4b6ca49 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Scenes
35{ 35{
36 [Serializable] 36 [Serializable]
37 public abstract class EntityBase : ISerializable 37 public abstract class EntityBase : ISerializable
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// The scene to which this entity belongs 40 /// The scene to which this entity belongs
41 /// </summary> 41 /// </summary>
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Environment.Scenes
56 protected string m_name; 56 protected string m_name;
57 57
58 /// <summary> 58 /// <summary>
59 /// 59 ///
60 /// </summary> 60 /// </summary>
61 public virtual string Name 61 public virtual string Name
62 { 62 {
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Scenes
67 protected LLVector3 m_pos; 67 protected LLVector3 m_pos;
68 68
69 /// <summary> 69 /// <summary>
70 /// 70 ///
71 /// </summary> 71 /// </summary>
72 public virtual LLVector3 AbsolutePosition 72 public virtual LLVector3 AbsolutePosition
73 { 73 {
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment.Scenes
79 protected LLVector3 m_rotationalvelocity; 79 protected LLVector3 m_rotationalvelocity;
80 80
81 /// <summary> 81 /// <summary>
82 /// 82 ///
83 /// </summary> 83 /// </summary>
84 public virtual LLVector3 Velocity 84 public virtual LLVector3 Velocity
85 { 85 {
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes
118 } 118 }
119 119
120 /// <summary> 120 /// <summary>
121 /// 121 ///
122 /// </summary> 122 /// </summary>
123 public abstract void UpdateMovement(); 123 public abstract void UpdateMovement();
124 124
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index aa22740..352fdf9 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Scenes
93 set 93 set
94 { 94 {
95 // If we're not doing the initial set 95 // If we're not doing the initial set
96 // Then we've got to remove the previous 96 // Then we've got to remove the previous
97 // event handler 97 // event handler
98 try 98 try
99 { 99 {
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
104 // This occurs when storing to _PhyScene the first time. 104 // This occurs when storing to _PhyScene the first time.
105 // Is there a better way to check the event handler before 105 // Is there a better way to check the event handler before
106 // getting here 106 // getting here
107 // This can be safely ignored. We're setting the first inital 107 // This can be safely ignored. We're setting the first inital
108 // there are no event handler's registered. 108 // there are no event handler's registered.
109 } 109 }
110 110
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Scenes
120 { 120 {
121 ScenePresences.Clear(); 121 ScenePresences.Clear();
122 } 122 }
123 123
124 //SceneObjects.Clear(); 124 //SceneObjects.Clear();
125 Entities.Clear(); 125 Entities.Clear();
126 } 126 }
@@ -235,7 +235,7 @@ namespace OpenSim.Region.Environment.Scenes
235 for (int i = 0; i < m_updateList.Count; i++) 235 for (int i = 0; i < m_updateList.Count; i++)
236 { 236 {
237 EntityBase entity = m_updateList[i]; 237 EntityBase entity = m_updateList[i];
238 238
239 // Don't abort the whole update if one entity happens to give us an exception. 239 // Don't abort the whole update if one entity happens to give us an exception.
240 try 240 try
241 { 241 {
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Environment.Scenes
327 part.Undo(); 327 part.Undo();
328 328
329 } 329 }
330 330
331 331
332 } 332 }
333 333
@@ -341,7 +341,7 @@ namespace OpenSim.Region.Environment.Scenes
341 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) 341 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot)
342 { 342 {
343 // Calls attach with a Zero position 343 // Calls attach with a Zero position
344 344
345 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); 345 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero);
346 } 346 }
347 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) 347 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask)
@@ -364,8 +364,8 @@ namespace OpenSim.Region.Environment.Scenes
364 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? 364 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID??
365 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) 365 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
366 { 366 {
367 367
368 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... 368 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake....
369 return; 369 return;
370 370
371 List<EntityBase> EntityList = GetEntities(); 371 List<EntityBase> EntityList = GetEntities();
@@ -443,14 +443,14 @@ namespace OpenSim.Region.Environment.Scenes
443 { 443 {
444 remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false); 444 remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false);
445 } 445 }
446 446
447 } 447 }
448 448
449 } 449 }
450 } 450 }
451 451
452 } 452 }
453 453
454 public ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child, AvatarAppearance appearance) 454 public ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child, AvatarAppearance appearance)
455 { 455 {
456 ScenePresence newAvatar = null; 456 ScenePresence newAvatar = null;
@@ -627,13 +627,13 @@ namespace OpenSim.Region.Environment.Scenes
627 627
628 return result; 628 return result;
629 } 629 }
630 630
631 /// <summary> 631 /// <summary>
632 /// Get the controlling client for the given avatar, if there is one. 632 /// Get the controlling client for the given avatar, if there is one.
633 /// 633 ///
634 /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't 634 /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't
635 /// use the ScenePresence. This could be better solved in a number of ways - we could establish an 635 /// use the ScenePresence. This could be better solved in a number of ways - we could establish an
636 /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more 636 /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more
637 /// suitable solution). 637 /// suitable solution).
638 /// </summary> 638 /// </summary>
639 /// <param name="agentId"></param> 639 /// <param name="agentId"></param>
@@ -641,12 +641,12 @@ namespace OpenSim.Region.Environment.Scenes
641 public IClientAPI GetControllingClient(LLUUID agentId) 641 public IClientAPI GetControllingClient(LLUUID agentId)
642 { 642 {
643 ScenePresence presence = GetScenePresence(agentId); 643 ScenePresence presence = GetScenePresence(agentId);
644 644
645 if (presence != null) 645 if (presence != null)
646 { 646 {
647 return presence.ControllingClient; 647 return presence.ControllingClient;
648 } 648 }
649 649
650 return null; 650 return null;
651 } 651 }
652 652
@@ -657,7 +657,7 @@ namespace OpenSim.Region.Environment.Scenes
657 public List<ScenePresence> GetScenePresences(FilterAvatarList filter) 657 public List<ScenePresence> GetScenePresences(FilterAvatarList filter)
658 { 658 {
659 // No locking of scene presences here since we're passing back a list... 659 // No locking of scene presences here since we're passing back a list...
660 660
661 List<ScenePresence> result = new List<ScenePresence>(); 661 List<ScenePresence> result = new List<ScenePresence>();
662 List<ScenePresence> ScenePresencesList = GetScenePresences(); 662 List<ScenePresence> ScenePresencesList = GetScenePresences();
663 663
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
681 { 681 {
682 ScenePresence sp; 682 ScenePresence sp;
683 ScenePresences.TryGetValue(agentID, out sp); 683 ScenePresences.TryGetValue(agentID, out sp);
684 684
685 return sp; 685 return sp;
686 } 686 }
687 687
@@ -764,13 +764,13 @@ namespace OpenSim.Region.Environment.Scenes
764 { 764 {
765 if (!presence.IsChildAgent) 765 if (!presence.IsChildAgent)
766 { 766 {
767 avatar = presence; 767 avatar = presence;
768 return true; 768 return true;
769 } 769 }
770 else 770 else
771 { 771 {
772 m_log.WarnFormat( 772 m_log.WarnFormat(
773 "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!", 773 "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!",
774 avatarId, m_parentScene.RegionInfo.RegionName); 774 avatarId, m_parentScene.RegionInfo.RegionName);
775 } 775 }
776 } 776 }
@@ -846,8 +846,8 @@ namespace OpenSim.Region.Environment.Scenes
846 { 846 {
847 // Only send child agents stuff in their draw distance. 847 // Only send child agents stuff in their draw distance.
848 // This will need to be done for every agent once we figure out 848 // This will need to be done for every agent once we figure out
849 // what we're going to use to store prim that agents already got 849 // what we're going to use to store prim that agents already got
850 // the initial update for and what we'll use to limit the 850 // the initial update for and what we'll use to limit the
851 // space we check for new objects on movement. 851 // space we check for new objects on movement.
852 852
853 if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor) 853 if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor)
@@ -889,7 +889,7 @@ namespace OpenSim.Region.Environment.Scenes
889 #region Client Event handlers 889 #region Client Event handlers
890 890
891 /// <summary> 891 /// <summary>
892 /// 892 ///
893 /// </summary> 893 /// </summary>
894 /// <param name="localID"></param> 894 /// <param name="localID"></param>
895 /// <param name="scale"></param> 895 /// <param name="scale"></param>
@@ -918,7 +918,7 @@ namespace OpenSim.Region.Environment.Scenes
918 } 918 }
919 919
920 /// <summary> 920 /// <summary>
921 /// This handles the nifty little tool tip that you get when you drag your mouse over an object 921 /// This handles the nifty little tool tip that you get when you drag your mouse over an object
922 /// Send to the Object Group to process. We don't know enough to service the request 922 /// Send to the Object Group to process. We don't know enough to service the request
923 /// </summary> 923 /// </summary>
924 /// <param name="remoteClient"></param> 924 /// <param name="remoteClient"></param>
@@ -936,7 +936,7 @@ namespace OpenSim.Region.Environment.Scenes
936 } 936 }
937 937
938 /// <summary> 938 /// <summary>
939 /// 939 ///
940 /// </summary> 940 /// </summary>
941 /// <param name="localID"></param> 941 /// <param name="localID"></param>
942 /// <param name="rot"></param> 942 /// <param name="rot"></param>
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 } 954 }
955 955
956 /// <summary> 956 /// <summary>
957 /// 957 ///
958 /// </summary> 958 /// </summary>
959 /// <param name="localID"></param> 959 /// <param name="localID"></param>
960 /// <param name="rot"></param> 960 /// <param name="rot"></param>
@@ -972,7 +972,7 @@ namespace OpenSim.Region.Environment.Scenes
972 } 972 }
973 973
974 /// <summary> 974 /// <summary>
975 /// 975 ///
976 /// </summary> 976 /// </summary>
977 /// <param name="localID"></param> 977 /// <param name="localID"></param>
978 /// <param name="pos"></param> 978 /// <param name="pos"></param>
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes
1009 } 1009 }
1010 1010
1011 /// <summary> 1011 /// <summary>
1012 /// 1012 ///
1013 /// </summary> 1013 /// </summary>
1014 /// <param name="localID"></param> 1014 /// <param name="localID"></param>
1015 /// <param name="pos"></param> 1015 /// <param name="pos"></param>
@@ -1019,13 +1019,13 @@ namespace OpenSim.Region.Environment.Scenes
1019 SceneObjectGroup group = GetGroupByPrim(localID); 1019 SceneObjectGroup group = GetGroupByPrim(localID);
1020 if (group != null) 1020 if (group != null)
1021 { 1021 {
1022 1022
1023 LLVector3 oldPos = group.AbsolutePosition; 1023 LLVector3 oldPos = group.AbsolutePosition;
1024 if (group.RootPart.m_IsAttachment) 1024 if (group.RootPart.m_IsAttachment)
1025 { 1025 {
1026 group.UpdateGroupPosition(pos); 1026 group.UpdateGroupPosition(pos);
1027 } 1027 }
1028 else 1028 else
1029 { 1029 {
1030 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.m_IsAttachment) 1030 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.m_IsAttachment)
1031 { 1031 {
@@ -1041,7 +1041,7 @@ namespace OpenSim.Region.Environment.Scenes
1041 } 1041 }
1042 1042
1043 /// <summary> 1043 /// <summary>
1044 /// 1044 ///
1045 /// </summary> 1045 /// </summary>
1046 /// <param name="localID"></param> 1046 /// <param name="localID"></param>
1047 /// <param name="texture"></param> 1047 /// <param name="texture"></param>
@@ -1059,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes
1059 } 1059 }
1060 1060
1061 /// <summary> 1061 /// <summary>
1062 /// 1062 ///
1063 /// </summary> 1063 /// </summary>
1064 /// <param name="localID"></param> 1064 /// <param name="localID"></param>
1065 /// <param name="packet"></param> 1065 /// <param name="packet"></param>
@@ -1094,7 +1094,7 @@ namespace OpenSim.Region.Environment.Scenes
1094 } 1094 }
1095 1095
1096 /// <summary> 1096 /// <summary>
1097 /// 1097 ///
1098 /// </summary> 1098 /// </summary>
1099 /// <param name="primLocalID"></param> 1099 /// <param name="primLocalID"></param>
1100 /// <param name="description"></param> 1100 /// <param name="description"></param>
@@ -1111,7 +1111,7 @@ namespace OpenSim.Region.Environment.Scenes
1111 } 1111 }
1112 1112
1113 /// <summary> 1113 /// <summary>
1114 /// 1114 ///
1115 /// </summary> 1115 /// </summary>
1116 /// <param name="primLocalID"></param> 1116 /// <param name="primLocalID"></param>
1117 /// <param name="description"></param> 1117 /// <param name="description"></param>
@@ -1141,7 +1141,7 @@ namespace OpenSim.Region.Environment.Scenes
1141 } 1141 }
1142 1142
1143 /// <summary> 1143 /// <summary>
1144 /// 1144 ///
1145 /// </summary> 1145 /// </summary>
1146 /// <param name="primLocalID"></param> 1146 /// <param name="primLocalID"></param>
1147 /// <param name="shapeBlock"></param> 1147 /// <param name="shapeBlock"></param>
@@ -1223,7 +1223,7 @@ namespace OpenSim.Region.Environment.Scenes
1223 { 1223 {
1224 parenPrim.LinkToGroup(sceneObj); 1224 parenPrim.LinkToGroup(sceneObj);
1225 } 1225 }
1226 1226
1227 // We need to explicitly resend the newly link prim's object properties since no other actions 1227 // We need to explicitly resend the newly link prim's object properties since no other actions
1228 // occur on link to invoke this elsewhere (such as object selection) 1228 // occur on link to invoke this elsewhere (such as object selection)
1229 parenPrim.GetProperties(client); 1229 parenPrim.GetProperties(client);
@@ -1232,7 +1232,7 @@ namespace OpenSim.Region.Environment.Scenes
1232 /// <summary> 1232 /// <summary>
1233 /// Delink a linkset 1233 /// Delink a linkset
1234 /// </summary> 1234 /// </summary>
1235 /// <param name="prims"></param> 1235 /// <param name="prims"></param>
1236 public void DelinkObjects(List<uint> primIds) 1236 public void DelinkObjects(List<uint> primIds)
1237 { 1237 {
1238 SceneObjectGroup parenPrim = null; 1238 SceneObjectGroup parenPrim = null;
@@ -1278,7 +1278,7 @@ namespace OpenSim.Region.Environment.Scenes
1278 else 1278 else
1279 { 1279 {
1280 // If the first scan failed, we need to do a /deep/ scan of the linkages. This is /really/ slow 1280 // If the first scan failed, we need to do a /deep/ scan of the linkages. This is /really/ slow
1281 // We know that this is not the root prim now essentially, so we don't have to worry about remapping 1281 // We know that this is not the root prim now essentially, so we don't have to worry about remapping
1282 // which one is the root prim 1282 // which one is the root prim
1283 bool delinkedSomething = false; 1283 bool delinkedSomething = false;
1284 for (int i = 0; i < primIds.Count; i++) 1284 for (int i = 0; i < primIds.Count; i++)
@@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Environment.Scenes
1324 } 1324 }
1325 } 1325 }
1326 } 1326 }
1327 1327
1328 //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints 1328 //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints
1329 //aka ObjectFlags.JointWheel = IncludeInSearch 1329 //aka ObjectFlags.JointWheel = IncludeInSearch
1330 1330
@@ -1356,7 +1356,7 @@ namespace OpenSim.Region.Environment.Scenes
1356 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) 1356 public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID)
1357 { 1357 {
1358 m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1358 m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1359 1359
1360 List<EntityBase> EntityList = GetEntities(); 1360 List<EntityBase> EntityList = GetEntities();
1361 1361
1362 SceneObjectGroup originPrim = null; 1362 SceneObjectGroup originPrim = null;
@@ -1405,7 +1405,7 @@ namespace OpenSim.Region.Environment.Scenes
1405 /// <returns></returns> 1405 /// <returns></returns>
1406 public float Vector3Distance(Vector3 v1, Vector3 v2) 1406 public float Vector3Distance(Vector3 v1, Vector3 v2)
1407 { 1407 {
1408 // We don't really need the double floating point precision... 1408 // We don't really need the double floating point precision...
1409 // so casting it to a single 1409 // so casting it to a single
1410 1410
1411 return 1411 return
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 6aef45e..5e2ccec 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Scenes
40{ 40{
41 public partial class Scene 41 public partial class Scene
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 /// <summary> 46 /// <summary>
@@ -49,14 +49,14 @@ namespace OpenSim.Region.Environment.Scenes
49 public void StartScripts() 49 public void StartScripts()
50 { 50 {
51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); 51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
52 52
53 foreach (EntityBase group in Entities.Values) 53 foreach (EntityBase group in Entities.Values)
54 { 54 {
55 if (group is SceneObjectGroup) 55 if (group is SceneObjectGroup)
56 { 56 {
57 ((SceneObjectGroup) group).StartScripts(); 57 ((SceneObjectGroup) group).StartScripts();
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 /// <summary> 62 /// <summary>
@@ -67,9 +67,9 @@ namespace OpenSim.Region.Environment.Scenes
67 /// in which the item is to be placed.</param> 67 /// in which the item is to be placed.</param>
68 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) 68 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
69 { 69 {
70 CachedUserInfo userInfo 70 CachedUserInfo userInfo
71 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 71 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
72 72
73 if (userInfo != null) 73 if (userInfo != null)
74 { 74 {
75 userInfo.AddItem(item); 75 userInfo.AddItem(item);
@@ -91,17 +91,17 @@ namespace OpenSim.Region.Environment.Scenes
91 m_log.ErrorFormat( 91 m_log.ErrorFormat(
92 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}", 92 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}",
93 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID); 93 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID);
94 94
95 return; 95 return;
96 } 96 }
97 } 97 }
98 98
99 /// <summary> 99 /// <summary>
100 /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see> 100 /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see>
101 /// </summary> 101 /// </summary>
102 /// <param name="avatarId">The ID of the avatar</param> 102 /// <param name="avatarId">The ID of the avatar</param>
103 /// <param name="item">The item. This structure contains all the item metadata, including the folder 103 /// <param name="item">The item. This structure contains all the item metadata, including the folder
104 /// in which the item is to be placed.</param> 104 /// in which the item is to be placed.</param>
105 public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item) 105 public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item)
106 { 106 {
107 ScenePresence avatar; 107 ScenePresence avatar;
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes
131 if (userInfo.RootFolder != null) 131 if (userInfo.RootFolder != null)
132 { 132 {
133 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 133 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
134 134
135 if (item != null) 135 if (item != null)
136 { 136 {
137 AssetBase asset = 137 AssetBase asset =
@@ -188,13 +188,13 @@ namespace OpenSim.Region.Environment.Scenes
188 /// <param name="itemID"></param> 188 /// <param name="itemID"></param>
189 /// <param name="primID">The prim which contains the item to update</param> 189 /// <param name="primID">The prim which contains the item to update</param>
190 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> 190 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
191 /// <param name="data"></param> 191 /// <param name="data"></param>
192 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, 192 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId,
193 LLUUID primId, bool isScriptRunning, byte[] data) 193 LLUUID primId, bool isScriptRunning, byte[] data)
194 { 194 {
195 // Retrieve group 195 // Retrieve group
196 SceneObjectPart part = GetSceneObjectPart(primId); 196 SceneObjectPart part = GetSceneObjectPart(primId);
197 SceneObjectGroup group = part.ParentGroup; 197 SceneObjectGroup group = part.ParentGroup;
198 if (null == group) 198 if (null == group)
199 { 199 {
200 m_log.ErrorFormat( 200 m_log.ErrorFormat(
@@ -204,36 +204,36 @@ namespace OpenSim.Region.Environment.Scenes
204 204
205 return; 205 return;
206 } 206 }
207 207
208 // Retrieve item 208 // Retrieve item
209 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 209 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
210 if (null == item) 210 if (null == item)
211 { 211 {
212 return; 212 return;
213 } 213 }
214 214
215 // Create new asset 215 // Create new asset
216 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this 216 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this
217 // There may well be one in libsecondlife 217 // There may well be one in libsecondlife
218 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data); 218 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data);
219 AssetCache.AddAsset(asset); 219 AssetCache.AddAsset(asset);
220 220
221 // Update item with new asset 221 // Update item with new asset
222 item.AssetID = asset.FullID; 222 item.AssetID = asset.FullID;
223 group.UpdateInventoryItem(item); 223 group.UpdateInventoryItem(item);
224 group.GetProperties(remoteClient); 224 group.GetProperties(remoteClient);
225 225
226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
227 if (isScriptRunning) 227 if (isScriptRunning)
228 { 228 {
229 group.StopScript(part.LocalId, item.ItemID); 229 group.StopScript(part.LocalId, item.ItemID);
230 group.StartScript(part.LocalId, item.ItemID); 230 group.StartScript(part.LocalId, item.ItemID);
231 } 231 }
232 } 232 }
233 233
234 /// <summary> 234 /// <summary>
235 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see> 235 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see>
236 /// </summary> 236 /// </summary>
237 private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, 237 private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId,
238 LLUUID primId, bool isScriptRunning, byte[] data) 238 LLUUID primId, bool isScriptRunning, byte[] data)
239 { 239 {
@@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
276 if (userInfo != null && userInfo.RootFolder != null) 276 if (userInfo != null && userInfo.RootFolder != null)
277 { 277 {
278 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 278 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
279 279
280 if (item != null) 280 if (item != null)
281 { 281 {
282 if (LLUUID.Zero == transactionID) 282 if (LLUUID.Zero == transactionID)
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes
284 item.Name = itemUpd.Name; 284 item.Name = itemUpd.Name;
285 item.Description = itemUpd.Description; 285 item.Description = itemUpd.Description;
286 item.NextPermissions = itemUpd.NextPermissions; 286 item.NextPermissions = itemUpd.NextPermissions;
287 item.CurrentPermissions |= 8; // Slam! 287 item.CurrentPermissions |= 8; // Slam!
288 item.EveryOnePermissions = itemUpd.EveryOnePermissions; 288 item.EveryOnePermissions = itemUpd.EveryOnePermissions;
289 289
290 // TODO: Requires sanity checks 290 // TODO: Requires sanity checks
@@ -323,7 +323,7 @@ namespace OpenSim.Region.Environment.Scenes
323 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update."); 323 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
324 } 324 }
325 } 325 }
326 326
327 /// <summary> 327 /// <summary>
328 /// Give an inventory item from one avatar to another 328 /// Give an inventory item from one avatar to another
329 /// </summary> 329 /// </summary>
@@ -333,35 +333,35 @@ namespace OpenSim.Region.Environment.Scenes
333 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId) 333 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId)
334 { 334 {
335 // Retrieve the item from the sender 335 // Retrieve the item from the sender
336 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); 336 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
337 337
338 if (senderUserInfo == null) 338 if (senderUserInfo == null)
339 { 339 {
340 m_log.ErrorFormat( 340 m_log.ErrorFormat(
341 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId); 341 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId);
342 342
343 return; 343 return;
344 } 344 }
345 345
346 if (senderUserInfo.RootFolder != null) 346 if (senderUserInfo.RootFolder != null)
347 { 347 {
348 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId); 348 InventoryItemBase item = senderUserInfo.RootFolder.FindItem(itemId);
349 349
350 if (item != null) 350 if (item != null)
351 { 351 {
352 if (!ExternalChecks.ExternalChecksBypassPermissions()) 352 if (!ExternalChecks.ExternalChecksBypassPermissions())
353 { 353 {
354 if((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) 354 if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
355 return; 355 return;
356 } 356 }
357 357
358 // TODO get recipient's root folder 358 // TODO get recipient's root folder
359 CachedUserInfo recipientUserInfo 359 CachedUserInfo recipientUserInfo
360 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId); 360 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId);
361 361
362 if (recipientUserInfo != null) 362 if (recipientUserInfo != null)
363 { 363 {
364 // Insert a copy of the item into the recipient 364 // Insert a copy of the item into the recipient
365 InventoryItemBase itemCopy = new InventoryItemBase(); 365 InventoryItemBase itemCopy = new InventoryItemBase();
366 itemCopy.Owner = recipientClient.AgentId; 366 itemCopy.Owner = recipientClient.AgentId;
367 itemCopy.Creator = senderId; 367 itemCopy.Creator = senderId;
@@ -372,37 +372,37 @@ namespace OpenSim.Region.Environment.Scenes
372 itemCopy.AssetType = item.AssetType; 372 itemCopy.AssetType = item.AssetType;
373 itemCopy.InvType = item.InvType; 373 itemCopy.InvType = item.InvType;
374 itemCopy.Folder = recipientUserInfo.RootFolder.ID; 374 itemCopy.Folder = recipientUserInfo.RootFolder.ID;
375 if (ExternalChecks.ExternalChecksPropagatePermissions()) 375 if (ExternalChecks.ExternalChecksPropagatePermissions())
376 { 376 {
377 if(item.InvType == 6) 377 if (item.InvType == 6)
378 { 378 {
379 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); 379 itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
380 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; 380 itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13;
381 } 381 }
382 else 382 else
383 { 383 {
384 Console.WriteLine("Non-Prim item ==>"); 384 Console.WriteLine("Non-Prim item ==>");
385 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; 385 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
386 } 386 }
387 387
388 itemCopy.CurrentPermissions = itemCopy.BasePermissions; 388 itemCopy.CurrentPermissions = itemCopy.BasePermissions;
389 if((item.CurrentPermissions & 8) != 0) // Propagate slam bit 389 if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit
390 { 390 {
391 itemCopy.CurrentPermissions = item.NextPermissions; 391 itemCopy.CurrentPermissions = item.NextPermissions;
392 itemCopy.BasePermissions=itemCopy.CurrentPermissions; 392 itemCopy.BasePermissions=itemCopy.CurrentPermissions;
393 itemCopy.CurrentPermissions |= 8; 393 itemCopy.CurrentPermissions |= 8;
394 } 394 }
395 395
396 itemCopy.NextPermissions = item.NextPermissions; 396 itemCopy.NextPermissions = item.NextPermissions;
397 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 397 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
398 } 398 }
399 else 399 else
400 { 400 {
401 itemCopy.CurrentPermissions = item.CurrentPermissions; 401 itemCopy.CurrentPermissions = item.CurrentPermissions;
402 itemCopy.NextPermissions = item.NextPermissions; 402 itemCopy.NextPermissions = item.NextPermissions;
403 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; 403 itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
404 itemCopy.BasePermissions = item.BasePermissions; 404 itemCopy.BasePermissions = item.BasePermissions;
405 } 405 }
406 itemCopy.GroupID = item.GroupID; 406 itemCopy.GroupID = item.GroupID;
407 itemCopy.GroupOwned = item.GroupOwned; 407 itemCopy.GroupOwned = item.GroupOwned;
408 itemCopy.Flags = item.Flags; 408 itemCopy.Flags = item.Flags;
@@ -410,21 +410,21 @@ namespace OpenSim.Region.Environment.Scenes
410 itemCopy.SaleType = item.SaleType; 410 itemCopy.SaleType = item.SaleType;
411 411
412 recipientUserInfo.AddItem(itemCopy); 412 recipientUserInfo.AddItem(itemCopy);
413 413
414 if (!ExternalChecks.ExternalChecksBypassPermissions()) 414 if (!ExternalChecks.ExternalChecksBypassPermissions())
415 { 415 {
416 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 416 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
417 senderUserInfo.DeleteItem(itemId); 417 senderUserInfo.DeleteItem(itemId);
418 } 418 }
419 419
420 // Let the recipient client know about this new item 420 // Let the recipient client know about this new item
421 recipientClient.SendBulkUpdateInventory(itemCopy); 421 recipientClient.SendBulkUpdateInventory(itemCopy);
422 } 422 }
423 else 423 else
424 { 424 {
425 m_log.ErrorFormat( 425 m_log.ErrorFormat(
426 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}", 426 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}",
427 recipientClient.Name, recipientClient.AgentId, item.Name, 427 recipientClient.Name, recipientClient.AgentId, item.Name,
428 item.ID, senderId); 428 item.ID, senderId);
429 } 429 }
430 } 430 }
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
432 { 432 {
433 m_log.ErrorFormat( 433 m_log.ErrorFormat(
434 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId); 434 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId);
435 435
436 return; 436 return;
437 } 437 }
438 } 438 }
@@ -440,7 +440,7 @@ namespace OpenSim.Region.Environment.Scenes
440 { 440 {
441 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); 441 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder");
442 return; 442 return;
443 } 443 }
444 } 444 }
445 445
446 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, 446 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID,
@@ -449,9 +449,9 @@ namespace OpenSim.Region.Environment.Scenes
449 m_log.DebugFormat( 449 m_log.DebugFormat(
450 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", 450 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
451 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName); 451 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
452 452
453 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(oldItemID); 453 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(oldItemID);
454 454
455 if (item == null) 455 if (item == null)
456 { 456 {
457 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID); 457 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
@@ -464,7 +464,7 @@ namespace OpenSim.Region.Environment.Scenes
464 if (userInfo.RootFolder != null) 464 if (userInfo.RootFolder != null)
465 { 465 {
466 item = userInfo.RootFolder.FindItem(oldItemID); 466 item = userInfo.RootFolder.FindItem(oldItemID);
467 467
468 if (item == null) 468 if (item == null)
469 { 469 {
470 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 470 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
@@ -477,29 +477,29 @@ namespace OpenSim.Region.Environment.Scenes
477 return; 477 return;
478 } 478 }
479 } 479 }
480 480
481 AssetBase asset 481 AssetBase asset
482 = AssetCache.GetAsset( 482 = AssetCache.GetAsset(
483 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false)); 483 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false));
484 484
485 if (asset != null) 485 if (asset != null)
486 { 486 {
487 if(remoteClient.AgentId == oldAgentID) 487 if (remoteClient.AgentId == oldAgentID)
488 { 488 {
489 CreateNewInventoryItem( 489 CreateNewInventoryItem(
490 remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions); 490 remoteClient, newFolderID, callbackID, asset, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions);
491 } 491 }
492 else 492 else
493 { 493 {
494 CreateNewInventoryItem( 494 CreateNewInventoryItem(
495 remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions); 495 remoteClient, newFolderID, callbackID, asset, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions);
496 } 496 }
497 } 497 }
498 else 498 else
499 { 499 {
500 m_log.ErrorFormat( 500 m_log.ErrorFormat(
501 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found", 501 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
502 item.Name, item.AssetID); 502 item.Name, item.AssetID);
503 } 503 }
504 } 504 }
505 505
@@ -530,18 +530,18 @@ namespace OpenSim.Region.Environment.Scenes
530 "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); 530 "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
531 531
532 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 532 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
533 533
534 if (userInfo == null) 534 if (userInfo == null)
535 { 535 {
536 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 536 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
537 537
538 return; 538 return;
539 } 539 }
540 540
541 if (userInfo.RootFolder != null) 541 if (userInfo.RootFolder != null)
542 { 542 {
543 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 543 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
544 544
545 if (item != null) 545 if (item != null)
546 { 546 {
547 if (newName != String.Empty) 547 if (newName != String.Empty)
@@ -549,7 +549,7 @@ namespace OpenSim.Region.Environment.Scenes
549 item.Name = newName; 549 item.Name = newName;
550 } 550 }
551 item.Folder = folderID; 551 item.Folder = folderID;
552 552
553 userInfo.DeleteItem(item.ID); 553 userInfo.DeleteItem(item.ID);
554 554
555 AddInventoryItem(remoteClient, item); 555 AddInventoryItem(remoteClient, item);
@@ -557,23 +557,23 @@ namespace OpenSim.Region.Environment.Scenes
557 else 557 else
558 { 558 {
559 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); 559 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString());
560 560
561 return; 561 return;
562 } 562 }
563 } 563 }
564 else 564 else
565 { 565 {
566 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder"); 566 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder");
567 567
568 return; 568 return;
569 } 569 }
570 } 570 }
571 571
572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
573 AssetBase asset, uint nextOwnerMask) 573 AssetBase asset, uint nextOwnerMask)
574 { 574 {
575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask); 575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask);
576 } 576 }
577 577
578 /// <summary> 578 /// <summary>
579 /// Create a new inventory item. 579 /// Create a new inventory item.
@@ -586,9 +586,9 @@ namespace OpenSim.Region.Environment.Scenes
586 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 586 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
587 AssetBase asset, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask) 587 AssetBase asset, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask)
588 { 588 {
589 CachedUserInfo userInfo 589 CachedUserInfo userInfo
590 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 590 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
591 591
592 if (userInfo != null) 592 if (userInfo != null)
593 { 593 {
594 InventoryItemBase item = new InventoryItemBase(); 594 InventoryItemBase item = new InventoryItemBase();
@@ -603,8 +603,8 @@ namespace OpenSim.Region.Environment.Scenes
603 item.Folder = folderID; 603 item.Folder = folderID;
604 item.CurrentPermissions = currentMask; 604 item.CurrentPermissions = currentMask;
605 item.NextPermissions = nextOwnerMask; 605 item.NextPermissions = nextOwnerMask;
606 item.EveryOnePermissions = everyoneMask; 606 item.EveryOnePermissions = everyoneMask;
607 item.BasePermissions = baseMask; 607 item.BasePermissions = baseMask;
608 608
609 userInfo.AddItem(item); 609 userInfo.AddItem(item);
610 remoteClient.SendInventoryItemCreateUpdate(item); 610 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -612,7 +612,7 @@ namespace OpenSim.Region.Environment.Scenes
612 else 612 else
613 { 613 {
614 m_log.WarnFormat( 614 m_log.WarnFormat(
615 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!", 615 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!",
616 remoteClient.Name, remoteClient.AgentId); 616 remoteClient.Name, remoteClient.AgentId);
617 } 617 }
618 } 618 }
@@ -637,12 +637,12 @@ namespace OpenSim.Region.Environment.Scenes
637 byte wearableType, uint nextOwnerMask) 637 byte wearableType, uint nextOwnerMask)
638 { 638 {
639// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); 639// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
640 640
641 if (transactionID == LLUUID.Zero) 641 if (transactionID == LLUUID.Zero)
642 { 642 {
643 CachedUserInfo userInfo 643 CachedUserInfo userInfo
644 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 644 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
645 645
646 if (userInfo != null) 646 if (userInfo != null)
647 { 647 {
648 ScenePresence presence; 648 ScenePresence presence;
@@ -666,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes
666 else 666 else
667 { 667 {
668 m_log.ErrorFormat( 668 m_log.ErrorFormat(
669 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem", 669 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem",
670 remoteClient.AgentId); 670 remoteClient.AgentId);
671 } 671 }
672 } 672 }
@@ -677,10 +677,10 @@ namespace OpenSim.Region.Environment.Scenes
677 { 677 {
678 agentTransactions.HandleItemCreationFromTransaction( 678 agentTransactions.HandleItemCreationFromTransaction(
679 remoteClient, transactionID, folderID, callbackID, description, 679 remoteClient, transactionID, folderID, callbackID, description,
680 name, invType, assetType, wearableType, nextOwnerMask); 680 name, invType, assetType, wearableType, nextOwnerMask);
681 } 681 }
682 682
683 683
684 } 684 }
685 } 685 }
686 686
@@ -693,13 +693,13 @@ namespace OpenSim.Region.Environment.Scenes
693 { 693 {
694 CachedUserInfo userInfo 694 CachedUserInfo userInfo
695 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 695 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
696 696
697 if (userInfo == null) 697 if (userInfo == null)
698 { 698 {
699 m_log.WarnFormat( 699 m_log.WarnFormat(
700 "[AGENT INVENTORY]: Failed to find user {0} {1} to delete inventory item {2}", 700 "[AGENT INVENTORY]: Failed to find user {0} {1} to delete inventory item {2}",
701 remoteClient.Name, remoteClient.AgentId, itemID); 701 remoteClient.Name, remoteClient.AgentId, itemID);
702 702
703 return; 703 return;
704 } 704 }
705 705
@@ -716,7 +716,7 @@ namespace OpenSim.Region.Environment.Scenes
716 { 716 {
717 CachedUserInfo userInfo 717 CachedUserInfo userInfo
718 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 718 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
719 719
720 if (userInfo == null) 720 if (userInfo == null)
721 { 721 {
722 m_log.Warn("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 722 m_log.Warn("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
@@ -726,13 +726,13 @@ namespace OpenSim.Region.Environment.Scenes
726 if (userInfo.RootFolder != null) 726 if (userInfo.RootFolder != null)
727 { 727 {
728 InventoryItemBase folder = userInfo.RootFolder.FindItem(folderID); 728 InventoryItemBase folder = userInfo.RootFolder.FindItem(folderID);
729 729
730 if (folder != null) 730 if (folder != null)
731 { 731 {
732 m_log.WarnFormat( 732 m_log.WarnFormat(
733 "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}", 733 "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}",
734 remoteClient.Name, remoteClient.AgentId, folderID); 734 remoteClient.Name, remoteClient.AgentId, folderID);
735 735
736 // doesn't work just yet, commented out. will fix in next patch. 736 // doesn't work just yet, commented out. will fix in next patch.
737 // userInfo.DeleteItem(folder); 737 // userInfo.DeleteItem(folder);
738 } 738 }
@@ -760,7 +760,7 @@ namespace OpenSim.Region.Environment.Scenes
760 /// <param name="remoteClient"></param> 760 /// <param name="remoteClient"></param>
761 /// <param name="primLocalID"></param> 761 /// <param name="primLocalID"></param>
762 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) 762 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
763 { 763 {
764 SceneObjectGroup group = GetGroupByPrim(primLocalID); 764 SceneObjectGroup group = GetGroupByPrim(primLocalID);
765 if (group != null) 765 if (group != null)
766 { 766 {
@@ -808,7 +808,7 @@ namespace OpenSim.Region.Environment.Scenes
808 localID); 808 localID);
809 } 809 }
810 } 810 }
811 811
812 /// <summary> 812 /// <summary>
813 /// Move the given item in the given prim to a folder in the client's inventory 813 /// Move the given item in the given prim to a folder in the client's inventory
814 /// </summary> 814 /// </summary>
@@ -819,33 +819,33 @@ namespace OpenSim.Region.Environment.Scenes
819 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 819 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
820 { 820 {
821 SceneObjectPart part = GetSceneObjectPart(primLocalId); 821 SceneObjectPart part = GetSceneObjectPart(primLocalId);
822 822
823 if (null == part) 823 if (null == part)
824 { 824 {
825 m_log.WarnFormat( 825 m_log.WarnFormat(
826 "[PRIM INVENTORY]: " + 826 "[PRIM INVENTORY]: " +
827 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", 827 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
828 itemId, primLocalId); 828 itemId, primLocalId);
829 829
830 return; 830 return;
831 } 831 }
832 832
833 TaskInventoryItem taskItem = part.GetInventoryItem(itemId); 833 TaskInventoryItem taskItem = part.GetInventoryItem(itemId);
834 834
835 if (null == taskItem) 835 if (null == taskItem)
836 { 836 {
837 // Console already notified of error in GetInventoryItem 837 // Console already notified of error in GetInventoryItem
838 return; 838 return;
839 } 839 }
840 840
841 // Only owner can copy 841 // Only owner can copy
842 if (remoteClient.AgentId != taskItem.OwnerID) 842 if (remoteClient.AgentId != taskItem.OwnerID)
843 { 843 {
844 return; 844 return;
845 } 845 }
846 846
847 InventoryItemBase agentItem = new InventoryItemBase(); 847 InventoryItemBase agentItem = new InventoryItemBase();
848 848
849 agentItem.ID = LLUUID.Random(); 849 agentItem.ID = LLUUID.Random();
850 agentItem.Creator = taskItem.CreatorID; 850 agentItem.Creator = taskItem.CreatorID;
851 agentItem.Owner = remoteClient.AgentId; 851 agentItem.Owner = remoteClient.AgentId;
@@ -855,33 +855,33 @@ namespace OpenSim.Region.Environment.Scenes
855 agentItem.AssetType = taskItem.Type; 855 agentItem.AssetType = taskItem.Type;
856 agentItem.InvType = taskItem.InvType; 856 agentItem.InvType = taskItem.InvType;
857 agentItem.Folder = folderId; 857 agentItem.Folder = folderId;
858 858
859 if ((remoteClient.AgentId != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 859 if ((remoteClient.AgentId != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
860 { 860 {
861 agentItem.BasePermissions = taskItem.NextOwnerMask; 861 agentItem.BasePermissions = taskItem.NextOwnerMask;
862 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 862 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
863 agentItem.NextPermissions = taskItem.NextOwnerMask; 863 agentItem.NextPermissions = taskItem.NextOwnerMask;
864 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask; 864 agentItem.EveryOnePermissions = taskItem.EveryoneMask & taskItem.NextOwnerMask;
865 } 865 }
866 else 866 else
867 { 867 {
868 agentItem.BasePermissions = taskItem.BaseMask; 868 agentItem.BasePermissions = taskItem.BaseMask;
869 agentItem.CurrentPermissions = taskItem.OwnerMask; 869 agentItem.CurrentPermissions = taskItem.OwnerMask;
870 agentItem.NextPermissions = taskItem.NextOwnerMask; 870 agentItem.NextPermissions = taskItem.NextOwnerMask;
871 agentItem.EveryOnePermissions = taskItem.EveryoneMask; 871 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
872 } 872 }
873 873
874 AddInventoryItem(remoteClient, agentItem); 874 AddInventoryItem(remoteClient, agentItem);
875 if (!ExternalChecks.ExternalChecksBypassPermissions()) 875 if (!ExternalChecks.ExternalChecksBypassPermissions())
876 { 876 {
877 if((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) 877 if ((taskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
878 part.RemoveInventoryItem(itemId); 878 part.RemoveInventoryItem(itemId);
879 } 879 }
880 880
881 } 881 }
882 882
883 /// <summary> 883 /// <summary>
884 /// Update an item in a prim (task) inventory. 884 /// Update an item in a prim (task) inventory.
885 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> 885 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>
886 /// </summary> 886 /// </summary>
887 /// <param name="remoteClient"></param> 887 /// <param name="remoteClient"></param>
@@ -915,14 +915,14 @@ namespace OpenSim.Region.Environment.Scenes
915 { 915 {
916 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); 916 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
917 m_log.InfoFormat( 917 m_log.InfoFormat(
918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
919 item.Name, primLocalID, remoteClient.Name); 919 item.Name, primLocalID, remoteClient.Name);
920 part.ParentGroup.GetProperties(remoteClient); 920 part.ParentGroup.GetProperties(remoteClient);
921 if (!ExternalChecks.ExternalChecksBypassPermissions()) 921 if (!ExternalChecks.ExternalChecksBypassPermissions())
922 { 922 {
923 if((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 923 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
924 RemoveInventoryItem(remoteClient, itemID); 924 RemoveInventoryItem(remoteClient, itemID);
925 } 925 }
926 } 926 }
927 else 927 else
928 { 928 {
@@ -951,22 +951,22 @@ namespace OpenSim.Region.Environment.Scenes
951 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 951 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
952 { 952 {
953 LLUUID copyID = LLUUID.Random(); 953 LLUUID copyID = LLUUID.Random();
954 954
955 if (itemID != LLUUID.Zero) 955 if (itemID != LLUUID.Zero)
956 { 956 {
957 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 957 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
958 958
959 if (userInfo != null && userInfo.RootFolder != null) 959 if (userInfo != null && userInfo.RootFolder != null)
960 { 960 {
961 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 961 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
962 962
963 // Try library 963 // Try library
964 // XXX clumsy, possibly should be one call 964 // XXX clumsy, possibly should be one call
965 if (null == item) 965 if (null == item)
966 { 966 {
967 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); 967 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
968 } 968 }
969 969
970 if (item != null) 970 if (item != null)
971 { 971 {
972 SceneObjectPart part = GetSceneObjectPart(localID); 972 SceneObjectPart part = GetSceneObjectPart(localID);
@@ -975,7 +975,7 @@ namespace OpenSim.Region.Environment.Scenes
975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); 975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
976 part.ParentGroup.StartScript(localID, copyID); 976 part.ParentGroup.StartScript(localID, copyID);
977 part.ParentGroup.GetProperties(remoteClient); 977 part.ParentGroup.GetProperties(remoteClient);
978 978
979 // m_log.InfoFormat("[PRIMINVENTORY]: " + 979 // m_log.InfoFormat("[PRIMINVENTORY]: " +
980 // "Rezzed script {0} into prim local ID {1} for user {2}", 980 // "Rezzed script {0} into prim local ID {1} for user {2}",
981 // item.inventoryName, localID, remoteClient.Name); 981 // item.inventoryName, localID, remoteClient.Name);
@@ -1000,10 +1000,10 @@ namespace OpenSim.Region.Environment.Scenes
1000 else // If the itemID is zero then the script has been rezzed directly in an object's inventory 1000 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
1001 { 1001 {
1002 // not yet implemented 1002 // not yet implemented
1003 // TODO Need to get more details from original RezScript packet 1003 // TODO Need to get more details from original RezScript packet
1004 // XXX jc tmp 1004 // XXX jc tmp
1005// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null); 1005// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null);
1006// AssetCache.AddAsset(asset); 1006// AssetCache.AddAsset(asset);
1007 } 1007 }
1008 } 1008 }
1009 1009
@@ -1023,11 +1023,11 @@ namespace OpenSim.Region.Environment.Scenes
1023 else 1023 else
1024 { 1024 {
1025 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 1025 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
1026 { 1026 {
1027// m_log.DebugFormat( 1027// m_log.DebugFormat(
1028// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}", 1028// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}",
1029// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID); 1029// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID);
1030 1030
1031 EntityBase selectedEnt = null; 1031 EntityBase selectedEnt = null;
1032 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString()); 1032 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
1033 1033
@@ -1046,9 +1046,9 @@ namespace OpenSim.Region.Environment.Scenes
1046 bool permissionToTake = false; 1046 bool permissionToTake = false;
1047 bool permissionToDelete = false; 1047 bool permissionToDelete = false;
1048 if (DeRezPacket.AgentBlock.Destination == 1)// Take Copy 1048 if (DeRezPacket.AgentBlock.Destination == 1)// Take Copy
1049 { 1049 {
1050 permissionToTake = ExternalChecks.ExternalChecksCanTakeCopyObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); 1050 permissionToTake = ExternalChecks.ExternalChecksCanTakeCopyObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
1051 permissionToDelete = false; //Just taking copy! 1051 permissionToDelete = false; //Just taking copy!
1052 1052
1053 } 1053 }
1054 else if (DeRezPacket.AgentBlock.Destination == 4) //Take 1054 else if (DeRezPacket.AgentBlock.Destination == 4) //Take
@@ -1094,27 +1094,27 @@ namespace OpenSim.Region.Environment.Scenes
1094 item.Folder = DeRezPacket.AgentBlock.DestinationID; 1094 item.Folder = DeRezPacket.AgentBlock.DestinationID;
1095 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) 1095 if ((remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
1096 { 1096 {
1097 uint perms=objectGroup.GetEffectivePermissions(); 1097 uint perms=objectGroup.GetEffectivePermissions();
1098 uint nextPerms=(perms & 7) << 13; 1098 uint nextPerms=(perms & 7) << 13;
1099 if((nextPerms & (uint)PermissionMask.Copy) == 0) 1099 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
1100 perms &= ~(uint)PermissionMask.Copy; 1100 perms &= ~(uint)PermissionMask.Copy;
1101 if((nextPerms & (uint)PermissionMask.Transfer) == 0) 1101 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
1102 perms &= ~(uint)PermissionMask.Transfer; 1102 perms &= ~(uint)PermissionMask.Transfer;
1103 if((nextPerms & (uint)PermissionMask.Modify) == 0) 1103 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
1104 perms &= ~(uint)PermissionMask.Modify; 1104 perms &= ~(uint)PermissionMask.Modify;
1105 1105
1106 item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; 1106 item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
1107 item.CurrentPermissions = item.BasePermissions; 1107 item.CurrentPermissions = item.BasePermissions;
1108 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1108 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1109 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1109 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1110 item.CurrentPermissions |= 8; // Slam! 1110 item.CurrentPermissions |= 8; // Slam!
1111 } 1111 }
1112 else 1112 else
1113 { 1113 {
1114 item.BasePermissions = objectGroup.GetEffectivePermissions(); 1114 item.BasePermissions = objectGroup.GetEffectivePermissions();
1115 item.CurrentPermissions = objectGroup.GetEffectivePermissions(); 1115 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1116 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1116 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1117 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1117 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1118 } 1118 }
1119 1119
1120 // TODO: add the new fields (Flags, Sale info, etc) 1120 // TODO: add the new fields (Flags, Sale info, etc)
@@ -1201,15 +1201,15 @@ namespace OpenSim.Region.Environment.Scenes
1201 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1201 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1202 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1202 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1203 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1203 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1204 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1204 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1205 } 1205 }
1206 else 1206 else
1207 { 1207 {
1208 item.BasePermissions = objectGroup.GetEffectivePermissions(); 1208 item.BasePermissions = objectGroup.GetEffectivePermissions();
1209 item.CurrentPermissions = objectGroup.GetEffectivePermissions(); 1209 item.CurrentPermissions = objectGroup.GetEffectivePermissions();
1210 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1210 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1211 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1211 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1212 } 1212 }
1213 1213
1214 userInfo.AddItem(item); 1214 userInfo.AddItem(item);
1215 1215
@@ -1218,7 +1218,7 @@ namespace OpenSim.Region.Environment.Scenes
1218 { 1218 {
1219 remoteClient.SendInventoryItemCreateUpdate(item); 1219 remoteClient.SendInventoryItemCreateUpdate(item);
1220 } 1220 }
1221 1221
1222 } 1222 }
1223 } 1223 }
1224 } 1224 }
@@ -1250,7 +1250,7 @@ namespace OpenSim.Region.Environment.Scenes
1250 item.Name = asset.Name; 1250 item.Name = asset.Name;
1251 item.AssetType = asset.Type; 1251 item.AssetType = asset.Type;
1252 item.InvType = asset.InvType; 1252 item.InvType = asset.InvType;
1253 1253
1254 // Sticking it in root folder for now.. objects folder later? 1254 // Sticking it in root folder for now.. objects folder later?
1255 1255
1256 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID; 1256 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID;
@@ -1259,14 +1259,14 @@ namespace OpenSim.Region.Environment.Scenes
1259 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1259 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1260 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1260 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1261 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1261 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1262 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; 1262 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
1263 } 1263 }
1264 else 1264 else
1265 { 1265 {
1266 item.BasePermissions = objectGroup.RootPart.BaseMask; 1266 item.BasePermissions = objectGroup.RootPart.BaseMask;
1267 item.CurrentPermissions = objectGroup.RootPart.OwnerMask; 1267 item.CurrentPermissions = objectGroup.RootPart.OwnerMask;
1268 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1268 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
1269 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1269 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1270 } 1270 }
1271 1271
1272 userInfo.AddItem(item); 1272 userInfo.AddItem(item);
@@ -1345,12 +1345,12 @@ namespace OpenSim.Region.Environment.Scenes
1345 1345
1346 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f); 1346 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f);
1347 1347
1348 1348
1349 LLVector3 pos = GetNewRezLocation( 1349 LLVector3 pos = GetNewRezLocation(
1350 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1350 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
1351 BypassRayCast, bRayEndIsIntersection,true,scale, false); 1351 BypassRayCast, bRayEndIsIntersection,true,scale, false);
1352 1352
1353 1353
1354 1354
1355 // Rez object 1355 // Rez object
1356 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 1356 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -1359,14 +1359,14 @@ namespace OpenSim.Region.Environment.Scenes
1359 if (userInfo.RootFolder != null) 1359 if (userInfo.RootFolder != null)
1360 { 1360 {
1361 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 1361 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
1362 1362
1363 if (item != null) 1363 if (item != null)
1364 { 1364 {
1365 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); 1365 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
1366 1366
1367 if (rezAsset != null) 1367 if (rezAsset != null)
1368 { 1368 {
1369 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1369 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
1370 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1370 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1371 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment) 1371 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count,remoteClient.AgentId, pos) && !attachment)
1372 { 1372 {
@@ -1401,10 +1401,10 @@ namespace OpenSim.Region.Environment.Scenes
1401 1401
1402 if (attachment) 1402 if (attachment)
1403 isAttachment = " Object was an attachment"; 1403 isAttachment = " Object was an attachment";
1404 1404
1405 m_log.Error("[OJECTREZ]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); 1405 m_log.Error("[OJECTREZ]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
1406 } 1406 }
1407 1407
1408 // Since renaming the item in the inventory does not affect the name stored 1408 // Since renaming the item in the inventory does not affect the name stored
1409 // in the serialization, transfer the correct name from the inventory to the 1409 // in the serialization, transfer the correct name from the inventory to the
1410 // object itself before we rez. 1410 // object itself before we rez.
@@ -1413,18 +1413,18 @@ namespace OpenSim.Region.Environment.Scenes
1413 1413
1414 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1414 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1415 1415
1416 if(rootPart.OwnerID != item.Owner) 1416 if (rootPart.OwnerID != item.Owner)
1417 { 1417 {
1418 if((item.CurrentPermissions & 8) != 0) 1418 if ((item.CurrentPermissions & 8) != 0)
1419 { 1419 {
1420 foreach (SceneObjectPart part in partList) 1420 foreach (SceneObjectPart part in partList)
1421 { 1421 {
1422 part.EveryoneMask = item.EveryOnePermissions; 1422 part.EveryoneMask = item.EveryOnePermissions;
1423 part.NextOwnerMask = item.NextPermissions; 1423 part.NextOwnerMask = item.NextPermissions;
1424 } 1424 }
1425 } 1425 }
1426 group.ApplyNextOwnerPermissions(); 1426 group.ApplyNextOwnerPermissions();
1427 } 1427 }
1428 1428
1429 foreach (SceneObjectPart part in partList) 1429 foreach (SceneObjectPart part in partList)
1430 { 1430 {
@@ -1434,13 +1434,13 @@ namespace OpenSim.Region.Environment.Scenes
1434 part.OwnerID = item.Owner; 1434 part.OwnerID = item.Owner;
1435 part.ChangeInventoryOwner(item.Owner); 1435 part.ChangeInventoryOwner(item.Owner);
1436 } 1436 }
1437 else if(((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam! 1437 else if (((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam!
1438 { 1438 {
1439 part.EveryoneMask = item.EveryOnePermissions; 1439 part.EveryoneMask = item.EveryOnePermissions;
1440 part.NextOwnerMask = item.NextPermissions; 1440 part.NextOwnerMask = item.NextPermissions;
1441 } 1441 }
1442 } 1442 }
1443 1443
1444 rootPart.TrimPermissions(); 1444 rootPart.TrimPermissions();
1445 1445
1446 if (!attachment) 1446 if (!attachment)
@@ -1451,11 +1451,11 @@ namespace OpenSim.Region.Environment.Scenes
1451 } 1451 }
1452 group.ApplyPhysics(m_physicalPrim); 1452 group.ApplyPhysics(m_physicalPrim);
1453 } 1453 }
1454 1454
1455 1455
1456 group.StartScripts(); 1456 group.StartScripts();
1457 1457
1458 1458
1459 if (!attachment) 1459 if (!attachment)
1460 rootPart.ScheduleFullUpdate(); 1460 rootPart.ScheduleFullUpdate();
1461 1461
@@ -1505,18 +1505,18 @@ namespace OpenSim.Region.Environment.Scenes
1505 1505
1506 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); 1506 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1507 1507
1508 if(rootPart.OwnerID != item.OwnerID) 1508 if (rootPart.OwnerID != item.OwnerID)
1509 { 1509 {
1510 if((item.OwnerMask & 8) != 0) 1510 if ((item.OwnerMask & 8) != 0)
1511 { 1511 {
1512 foreach (SceneObjectPart part in partList) 1512 foreach (SceneObjectPart part in partList)
1513 { 1513 {
1514 part.EveryoneMask = item.EveryoneMask; 1514 part.EveryoneMask = item.EveryoneMask;
1515 part.NextOwnerMask = item.NextOwnerMask; 1515 part.NextOwnerMask = item.NextOwnerMask;
1516 } 1516 }
1517 } 1517 }
1518 group.ApplyNextOwnerPermissions(); 1518 group.ApplyNextOwnerPermissions();
1519 } 1519 }
1520 1520
1521 foreach (SceneObjectPart part in partList) 1521 foreach (SceneObjectPart part in partList)
1522 { 1522 {
@@ -1526,11 +1526,11 @@ namespace OpenSim.Region.Environment.Scenes
1526 part.OwnerID = item.OwnerID; 1526 part.OwnerID = item.OwnerID;
1527 part.ChangeInventoryOwner(item.OwnerID); 1527 part.ChangeInventoryOwner(item.OwnerID);
1528 } 1528 }
1529 else if((item.OwnerMask & 8) != 0) // Slam! 1529 else if ((item.OwnerMask & 8) != 0) // Slam!
1530 { 1530 {
1531 part.EveryoneMask = item.EveryoneMask; 1531 part.EveryoneMask = item.EveryoneMask;
1532 part.NextOwnerMask = item.NextOwnerMask; 1532 part.NextOwnerMask = item.NextOwnerMask;
1533 } 1533 }
1534 } 1534 }
1535 rootPart.TrimPermissions(); 1535 rootPart.TrimPermissions();
1536 if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 1536 if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
@@ -1548,6 +1548,6 @@ namespace OpenSim.Region.Environment.Scenes
1548 } 1548 }
1549 return null; 1549 return null;
1550 } 1550 }
1551 1551
1552 } 1552 }
1553} 1553}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index f55d822..c486e28 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Scenes
35 public partial class Scene 35 public partial class Scene
36 { 36 {
37 /// <summary> 37 /// <summary>
38 /// 38 ///
39 /// </summary> 39 /// </summary>
40 /// <param name="message"></param> 40 /// <param name="message"></param>
41 /// <param name="type"></param> 41 /// <param name="type"></param>
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Scenes
81 foreach (EntityBase ent in EntitieList) 81 foreach (EntityBase ent in EntitieList)
82 { 82 {
83 if (ent is SceneObjectGroup) 83 if (ent is SceneObjectGroup)
84 { 84 {
85 if (((SceneObjectGroup) ent).LocalId == primLocalID) 85 if (((SceneObjectGroup) ent).LocalId == primLocalID)
86 { 86 {
87 // A prim is only tainted if it's allowed to be edited by the person clicking it. 87 // A prim is only tainted if it's allowed to be edited by the person clicking it.
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Scenes
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// 101 ///
102 /// </summary> 102 /// </summary>
103 /// <param name="primLocalID"></param> 103 /// <param name="primLocalID"></param>
104 /// <param name="remoteClient"></param> 104 /// <param name="remoteClient"></param>
@@ -139,10 +139,10 @@ namespace OpenSim.Region.Environment.Scenes
139 agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated); 139 agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated);
140 140
141 // First, allow all validators a stab at it 141 // First, allow all validators a stab at it
142 m_eventManager.TriggerValidateLandBuy(this, args); 142 m_eventManager.TriggerValidateLandBuy(this, args);
143 143
144 // Then, check validation and transfer 144 // Then, check validation and transfer
145 m_eventManager.TriggerLandBuy(this, args); 145 m_eventManager.TriggerLandBuy(this, args);
146 } 146 }
147 147
148 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 148 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1964ef4..32dc7d5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Scenes
98 /// Each agent has its own capabilities handler. 98 /// Each agent has its own capabilities handler.
99 /// </summary> 99 /// </summary>
100 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>(); 100 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>();
101 101
102 protected BaseHttpServer m_httpListener; 102 protected BaseHttpServer m_httpListener;
103 103
104 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>(); 104 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>();
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Environment.Scenes
135 private int m_update_backup = 200; 135 private int m_update_backup = 200;
136 private int m_update_terrain = 50; 136 private int m_update_terrain = 50;
137 private int m_update_land = 1; 137 private int m_update_land = 1;
138 138
139 139
140 private int frameMS = 0; 140 private int frameMS = 0;
141 private int physicsMS2 = 0; 141 private int physicsMS2 = 0;
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Environment.Scenes
201 get { return m_innerScene.Entities; } 201 get { return m_innerScene.Entities; }
202 set { m_innerScene.Entities = value; } 202 set { m_innerScene.Entities = value; }
203 } 203 }
204 204
205 public Dictionary<LLUUID, ScenePresence> m_restorePresences 205 public Dictionary<LLUUID, ScenePresence> m_restorePresences
206 { 206 {
207 get { return m_innerScene.RestorePresences; } 207 get { return m_innerScene.RestorePresences; }
@@ -324,14 +324,14 @@ namespace OpenSim.Region.Environment.Scenes
324 324
325 public override bool OtherRegionUp(RegionInfo otherRegion) 325 public override bool OtherRegionUp(RegionInfo otherRegion)
326 { 326 {
327 // Another region is up. 327 // Another region is up.
328 // Gets called from Grid Comms (SceneCommunicationService<---RegionListener<----LocalBackEnd<----OGS1) 328 // Gets called from Grid Comms (SceneCommunicationService<---RegionListener<----LocalBackEnd<----OGS1)
329 // We have to tell all our ScenePresences about it.. 329 // We have to tell all our ScenePresences about it..
330 // and add it to the neighbor list. 330 // and add it to the neighbor list.
331 331
332 // We only add it to the neighbor list if it's within 1 region from here. 332 // We only add it to the neighbor list if it's within 1 region from here.
333 // Agents may have draw distance values that cross two regions though, so 333 // Agents may have draw distance values that cross two regions though, so
334 // we add it to the notify list regardless of distance. 334 // we add it to the notify list regardless of distance.
335 // We'll check the agent's draw distance before notifying them though. 335 // We'll check the agent's draw distance before notifying them though.
336 336
337 337
@@ -339,9 +339,9 @@ namespace OpenSim.Region.Environment.Scenes
339 { 339 {
340 for (int i = 0; i < m_neighbours.Count; i++) 340 for (int i = 0; i < m_neighbours.Count; i++)
341 { 341 {
342 // The purpose of this loop is to re-update the known neighbors 342 // The purpose of this loop is to re-update the known neighbors
343 // when another region comes up on top of another one. 343 // when another region comes up on top of another one.
344 // The latest region in that location ends up in the 344 // The latest region in that location ends up in the
345 // 'known neighbors list' 345 // 'known neighbors list'
346 // Additionally, the commFailTF property gets reset to false. 346 // Additionally, the commFailTF property gets reset to false.
347 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle) 347 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle)
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Scenes
354 } 354 }
355 355
356 // If the value isn't in the neighbours, add it. 356 // If the value isn't in the neighbours, add it.
357 // If the RegionInfo isn't exact but is for the same XY World location, 357 // If the RegionInfo isn't exact but is for the same XY World location,
358 // then the above loop will fix that. 358 // then the above loop will fix that.
359 359
360 if (!(CheckNeighborRegion(otherRegion))) 360 if (!(CheckNeighborRegion(otherRegion)))
@@ -431,8 +431,8 @@ namespace OpenSim.Region.Environment.Scenes
431 } 431 }
432 } 432 }
433 return found; 433 return found;
434 434
435 435
436 } 436 }
437 public virtual void Restart(float seconds) 437 public virtual void Restart(float seconds)
438 { 438 {
@@ -461,8 +461,8 @@ namespace OpenSim.Region.Environment.Scenes
461 } 461 }
462 } 462 }
463 463
464 // The Restart timer has occured. 464 // The Restart timer has occured.
465 // We have to figure out if this is a notification or if the number of seconds specified in Restart 465 // We have to figure out if this is a notification or if the number of seconds specified in Restart
466 // have elapsed. 466 // have elapsed.
467 // If they have elapsed, call RestartNow() 467 // If they have elapsed, call RestartNow()
468 public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e) 468 public void RestartTimer_Elapsed(object sender, ElapsedEventArgs e)
@@ -500,7 +500,7 @@ namespace OpenSim.Region.Environment.Scenes
500 } 500 }
501 501
502 // This is a helper function that notifies root agents in this region that a new sim near them has come up 502 // This is a helper function that notifies root agents in this region that a new sim near them has come up
503 // This is in the form of a timer because when an instance of OpenSim.exe is started, 503 // This is in the form of a timer because when an instance of OpenSim.exe is started,
504 // Even though the sims initialize, they don't listen until 'all of the sims are initialized' 504 // Even though the sims initialize, they don't listen until 'all of the sims are initialized'
505 // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it. 505 // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it.
506 // subsequently the agent will never see the region come back online. 506 // subsequently the agent will never see the region come back online.
@@ -730,7 +730,7 @@ namespace OpenSim.Region.Environment.Scenes
730 if (m_frame % m_update_entities == 0) 730 if (m_frame % m_update_entities == 0)
731 m_innerScene.UpdateEntities(); 731 m_innerScene.UpdateEntities();
732 732
733 // run through entities that have scheduled themselves for 733 // run through entities that have scheduled themselves for
734 // updates looking for updates(faster) 734 // updates looking for updates(faster)
735 if (m_frame % m_update_entitiesquick == 0) 735 if (m_frame % m_update_entitiesquick == 0)
736 m_innerScene.ProcessUpdates(); 736 m_innerScene.ProcessUpdates();
@@ -743,13 +743,13 @@ namespace OpenSim.Region.Environment.Scenes
743 { 743 {
744 if (m_frame % m_update_events == 0) 744 if (m_frame % m_update_events == 0)
745 UpdateEvents(); 745 UpdateEvents();
746 746
747 if (m_frame % m_update_backup == 0) 747 if (m_frame % m_update_backup == 0)
748 UpdateStorageBackup(); 748 UpdateStorageBackup();
749 749
750 if (m_frame % m_update_terrain == 0) 750 if (m_frame % m_update_terrain == 0)
751 UpdateTerrain(); 751 UpdateTerrain();
752 752
753 if (m_frame % m_update_land == 0) 753 if (m_frame % m_update_land == 0)
754 UpdateLand(); 754 UpdateLand();
755 otherMS = System.Environment.TickCount - otherMS; 755 otherMS = System.Environment.TickCount - otherMS;
@@ -800,14 +800,14 @@ namespace OpenSim.Region.Environment.Scenes
800 // Get actual time dilation 800 // Get actual time dilation
801 float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds); 801 float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds);
802 802
803 // If actual time dilation is greater then one, we're catching up, so subtract 803 // If actual time dilation is greater then one, we're catching up, so subtract
804 // the amount that's greater then 1 from the time dilation 804 // the amount that's greater then 1 from the time dilation
805 if (tmpval > 1.0) 805 if (tmpval > 1.0)
806 { 806 {
807 tmpval = tmpval - (tmpval - 1.0f); 807 tmpval = tmpval - (tmpval - 1.0f);
808 } 808 }
809 m_timedilation = tmpval; 809 m_timedilation = tmpval;
810 810
811 m_lastupdate = DateTime.Now; 811 m_lastupdate = DateTime.Now;
812 } 812 }
813 } 813 }
@@ -858,9 +858,9 @@ namespace OpenSim.Region.Environment.Scenes
858 { 858 {
859 ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); 859 ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); });
860 } 860 }
861 861
862 /// <summary> 862 /// <summary>
863 /// 863 ///
864 /// </summary> 864 /// </summary>
865 /// <returns></returns> 865 /// <returns></returns>
866 public bool Backup() 866 public bool Backup()
@@ -929,7 +929,7 @@ namespace OpenSim.Region.Environment.Scenes
929 /// <summary> 929 /// <summary>
930 /// Loads the World heightmap 930 /// Loads the World heightmap
931 /// </summary> 931 /// </summary>
932 /// 932 ///
933 public override void LoadWorldMap() 933 public override void LoadWorldMap()
934 { 934 {
935 try 935 try
@@ -946,7 +946,7 @@ namespace OpenSim.Region.Environment.Scenes
946 { 946 {
947 Heightmap = new TerrainChannel(map); 947 Heightmap = new TerrainChannel(map);
948 } 948 }
949 949
950 } 950 }
951 catch (Exception e) 951 catch (Exception e)
952 { 952 {
@@ -961,13 +961,13 @@ namespace OpenSim.Region.Environment.Scenes
961 public void RegisterRegionWithGrid() 961 public void RegisterRegionWithGrid()
962 { 962 {
963 RegisterCommsEvents(); 963 RegisterCommsEvents();
964 964
965 // These two 'commands' *must be* next to each other or sim rebooting fails. 965 // These two 'commands' *must be* next to each other or sim rebooting fails.
966 m_sceneGridService.RegisterRegion(RegionInfo); 966 m_sceneGridService.RegisterRegion(RegionInfo);
967 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo); 967 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
968 968
969 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); 969 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
970 970
971 if (dGridSettings.ContainsKey("allow_forceful_banlines")) 971 if (dGridSettings.ContainsKey("allow_forceful_banlines"))
972 { 972 {
973 if (dGridSettings["allow_forceful_banlines"] != "TRUE") 973 if (dGridSettings["allow_forceful_banlines"] != "TRUE")
@@ -984,11 +984,11 @@ namespace OpenSim.Region.Environment.Scenes
984 } 984 }
985 985
986 /// <summary> 986 /// <summary>
987 /// 987 ///
988 /// </summary> 988 /// </summary>
989 public void CreateTerrainTexture(bool temporary) 989 public void CreateTerrainTexture(bool temporary)
990 { 990 {
991 //create a texture asset of the terrain 991 //create a texture asset of the terrain
992 IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>(); 992 IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>();
993 993
994 // Cannot create a map for a nonexistant heightmap yet. 994 // Cannot create a map for a nonexistant heightmap yet.
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Environment.Scenes
1129 AssetCache.AddAsset(asset); 1129 AssetCache.AddAsset(asset);
1130 } 1130 }
1131 } 1131 }
1132 1132
1133 } 1133 }
1134 1134
1135 #endregion 1135 #endregion
@@ -1211,7 +1211,7 @@ namespace OpenSim.Region.Environment.Scenes
1211 if (RayTargetID != LLUUID.Zero) 1211 if (RayTargetID != LLUUID.Zero)
1212 { 1212 {
1213 SceneObjectPart target = GetSceneObjectPart(RayTargetID); 1213 SceneObjectPart target = GetSceneObjectPart(RayTargetID);
1214 1214
1215 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1215 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
1216 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1216 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1217 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1217 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
@@ -1220,9 +1220,9 @@ namespace OpenSim.Region.Environment.Scenes
1220 { 1220 {
1221 pos = target.AbsolutePosition; 1221 pos = target.AbsolutePosition;
1222 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString()); 1222 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString());
1223 1223
1224 // TODO: Raytrace better here 1224 // TODO: Raytrace better here
1225 1225
1226 //EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection)); 1226 //EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection));
1227 Ray NewRay = new Ray(AXOrigin, AXdirection); 1227 Ray NewRay = new Ray(AXOrigin, AXdirection);
1228 1228
@@ -1246,13 +1246,13 @@ namespace OpenSim.Region.Environment.Scenes
1246 // Set the position to the intersection point 1246 // Set the position to the intersection point
1247 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1247 LLVector3 offset = (normal * (ScaleOffset / 2f));
1248 pos = (intersectionpoint + offset); 1248 pos = (intersectionpoint + offset);
1249 1249
1250 // Un-offset the prim (it gets offset later by the consumer method) 1250 // Un-offset the prim (it gets offset later by the consumer method)
1251 pos.Z -= 0.25F; 1251 pos.Z -= 0.25F;
1252 1252
1253 } 1253 }
1254 1254
1255 1255
1256 return pos; 1256 return pos;
1257 } 1257 }
1258 else 1258 else
@@ -1267,8 +1267,8 @@ namespace OpenSim.Region.Environment.Scenes
1267 if (ei.HitTF) 1267 if (ei.HitTF)
1268 { 1268 {
1269 pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 1269 pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z);
1270 } 1270 }
1271 1271
1272 return pos; 1272 return pos;
1273 } 1273 }
1274 } 1274 }
@@ -1284,7 +1284,7 @@ namespace OpenSim.Region.Environment.Scenes
1284 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, 1284 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
1285 byte RayEndIsIntersection) 1285 byte RayEndIsIntersection)
1286 { 1286 {
1287 1287
1288 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false); 1288 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f,0.5f,0.5f), false);
1289 1289
1290 if ( ExternalChecks.ExternalChecksCanRezObject(1,ownerID,pos)) 1290 if ( ExternalChecks.ExternalChecksCanRezObject(1,ownerID,pos))
@@ -1386,11 +1386,11 @@ namespace OpenSim.Region.Environment.Scenes
1386 1386
1387 /// <summary> 1387 /// <summary>
1388 /// Locate New region Handle and offset the prim position for the new region 1388 /// Locate New region Handle and offset the prim position for the new region
1389 /// 1389 ///
1390 /// </summary> 1390 /// </summary>
1391 /// <param name="position">current position of Group</param> 1391 /// <param name="position">current position of Group</param>
1392 /// <param name="grp">Scene Object Group that we're crossing</param> 1392 /// <param name="grp">Scene Object Group that we're crossing</param>
1393 1393
1394 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) 1394 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp)
1395 { 1395 {
1396 if (grp == null) 1396 if (grp == null)
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Environment.Scenes
1424 pos.X = ((pos.X - Constants.RegionSize)); 1424 pos.X = ((pos.X - Constants.RegionSize));
1425 1425
1426 newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize)); 1426 newRegionHandle = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), (uint)(thisy * Constants.RegionSize));
1427 1427
1428 // x + 1 1428 // x + 1
1429 } 1429 }
1430 else if (position.X < -0.1f) 1430 else if (position.X < -0.1f)
@@ -1449,7 +1449,7 @@ namespace OpenSim.Region.Environment.Scenes
1449 1449
1450 // Offset the positions for the new region across the border 1450 // Offset the positions for the new region across the border
1451 grp.OffsetForNewRegion(pos); 1451 grp.OffsetForNewRegion(pos);
1452 1452
1453 CrossPrimGroupIntoNewRegion(newRegionHandle, grp); 1453 CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
1454 1454
1455 } 1455 }
@@ -1507,7 +1507,7 @@ namespace OpenSim.Region.Environment.Scenes
1507 if (sp != null) 1507 if (sp != null)
1508 { 1508 {
1509 // hack assetID until we get assetID into the XML format. 1509 // hack assetID until we get assetID into the XML format.
1510 // LastOwnerID is used for group deeding, so when you do stuff 1510 // LastOwnerID is used for group deeding, so when you do stuff
1511 // with the deeded object, it goes back to them 1511 // with the deeded object, it goes back to them
1512 1512
1513 grp.SetFromAssetID(grp.RootPart.LastOwnerID); 1513 grp.SetFromAssetID(grp.RootPart.LastOwnerID);
@@ -1515,7 +1515,7 @@ namespace OpenSim.Region.Environment.Scenes
1515 } 1515 }
1516 } 1516 }
1517 } 1517 }
1518 1518
1519 1519
1520 } 1520 }
1521 } 1521 }
@@ -1533,16 +1533,16 @@ namespace OpenSim.Region.Environment.Scenes
1533 #region Add/Remove Avatar Methods 1533 #region Add/Remove Avatar Methods
1534 1534
1535 /// <summary> 1535 /// <summary>
1536 /// 1536 ///
1537 /// </summary> 1537 /// </summary>
1538 /// <param name="client"></param 1538 /// <param name="client"></param
1539 /// <param name="child"></param> 1539 /// <param name="child"></param>
1540 public override void AddNewClient(IClientAPI client, bool child) 1540 public override void AddNewClient(IClientAPI client, bool child)
1541 { 1541 {
1542 m_log.DebugFormat( 1542 m_log.DebugFormat(
1543 "[CONNECTION DEBUGGING]: Creating new client for {0} at {1}", 1543 "[CONNECTION DEBUGGING]: Creating new client for {0} at {1}",
1544 client.AgentId, RegionInfo.RegionName); 1544 client.AgentId, RegionInfo.RegionName);
1545 1545
1546 SubscribeToClientEvents(client); 1546 SubscribeToClientEvents(client);
1547 ScenePresence presence; 1547 ScenePresence presence;
1548 1548
@@ -1618,7 +1618,7 @@ namespace OpenSim.Region.Environment.Scenes
1618 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; 1618 client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
1619 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; 1619 client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags;
1620 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; 1620 client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily;
1621 1621
1622 client.OnRequestGodlikePowers += handleRequestGodlikePowers; 1622 client.OnRequestGodlikePowers += handleRequestGodlikePowers;
1623 client.OnGodKickUser += HandleGodlikeKickUser; 1623 client.OnGodKickUser += HandleGodlikeKickUser;
1624 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 1624 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
@@ -1655,7 +1655,7 @@ namespace OpenSim.Region.Environment.Scenes
1655 1655
1656 client.OnSetStartLocationRequest += SetHomeRezPoint; 1656 client.OnSetStartLocationRequest += SetHomeRezPoint;
1657 client.OnUndo += m_innerScene.HandleUndo; 1657 client.OnUndo += m_innerScene.HandleUndo;
1658 1658
1659 EventManager.TriggerOnNewClient(client); 1659 EventManager.TriggerOnNewClient(client);
1660 } 1660 }
1661 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) 1661 public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client)
@@ -1669,14 +1669,14 @@ namespace OpenSim.Region.Environment.Scenes
1669 RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0); 1669 RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0);
1670 } 1670 }
1671 } 1671 }
1672 1672
1673 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, 1673 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
1674 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, 1674 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
1675 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 1675 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
1676 { 1676 {
1677 LLVector3 pos; 1677 LLVector3 pos;
1678 const bool frontFacesOnly = true; 1678 const bool frontFacesOnly = true;
1679 1679
1680 SceneObjectPart target = GetSceneObjectPart(localID); 1680 SceneObjectPart target = GetSceneObjectPart(localID);
1681 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); 1681 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj);
1682 1682
@@ -1685,8 +1685,8 @@ namespace OpenSim.Region.Environment.Scenes
1685 1685
1686 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1686 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
1687 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1687 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1688 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1688 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
1689 1689
1690 if (target2.ParentGroup != null) 1690 if (target2.ParentGroup != null)
1691 { 1691 {
1692 pos = target2.AbsolutePosition; 1692 pos = target2.AbsolutePosition;
@@ -1717,7 +1717,7 @@ namespace OpenSim.Region.Environment.Scenes
1717 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); 1717 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z);
1718 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1718 LLVector3 offset = (normal * (ScaleOffset / 2f));
1719 pos = (intersectionpoint + offset); 1719 pos = (intersectionpoint + offset);
1720 1720
1721 if (CopyCenters) 1721 if (CopyCenters)
1722 { 1722 {
1723 // now we cast a ray from inside the prim(absolute position) to one of it's faces along the face normal. 1723 // now we cast a ray from inside the prim(absolute position) to one of it's faces along the face normal.
@@ -1735,7 +1735,7 @@ namespace OpenSim.Region.Environment.Scenes
1735 normal.Z = ei2.normal.z; 1735 normal.Z = ei2.normal.z;
1736 } 1736 }
1737 } 1737 }
1738 1738
1739 // Set the position to the intersection point 1739 // Set the position to the intersection point
1740 offset = (normal * (ScaleOffset / 2f)); 1740 offset = (normal * (ScaleOffset / 2f));
1741 pos = (intersectionpoint + offset); 1741 pos = (intersectionpoint + offset);
@@ -1749,8 +1749,8 @@ namespace OpenSim.Region.Environment.Scenes
1749 return; 1749 return;
1750 } 1750 }
1751 return; 1751 return;
1752 1752
1753 1753
1754 } 1754 }
1755 1755
1756 1756
@@ -1776,7 +1776,7 @@ namespace OpenSim.Region.Environment.Scenes
1776 UserProfile.HomeLookAtY = (int)lookAt.Y; 1776 UserProfile.HomeLookAtY = (int)lookAt.Y;
1777 UserProfile.HomeLookAtZ = (int)lookAt.Z; 1777 UserProfile.HomeLookAtZ = (int)lookAt.Z;
1778 CommsManager.UserService.UpdateUserProfileProperties(UserProfile); 1778 CommsManager.UserService.UpdateUserProfileProperties(UserProfile);
1779 1779
1780 remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); 1780 remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false);
1781 } 1781 }
1782 else 1782 else
@@ -1784,7 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes
1784 remoteClient.SendAgentAlertMessage("Set Home request Failed",false); 1784 remoteClient.SendAgentAlertMessage("Set Home request Failed",false);
1785 } 1785 }
1786 } 1786 }
1787 1787
1788 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) 1788 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child)
1789 { 1789 {
1790 AvatarAppearance appearance; 1790 AvatarAppearance appearance;
@@ -1844,7 +1844,7 @@ namespace OpenSim.Region.Environment.Scenes
1844 m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions); 1844 m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions);
1845 1845
1846 RemoveCapsHandler(agentID); 1846 RemoveCapsHandler(agentID);
1847 1847
1848 CommsManager.UserProfileCacheService.RemoveUser(agentID); 1848 CommsManager.UserProfileCacheService.RemoveUser(agentID);
1849 } 1849 }
1850 1850
@@ -1870,7 +1870,7 @@ namespace OpenSim.Region.Environment.Scenes
1870 1870
1871 ForEachScenePresence( 1871 ForEachScenePresence(
1872 delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); 1872 delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
1873 1873
1874 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 1874 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
1875 if (agentTransactions != null) 1875 if (agentTransactions != null)
1876 { 1876 {
@@ -1921,7 +1921,7 @@ namespace OpenSim.Region.Environment.Scenes
1921 } 1921 }
1922 1922
1923 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 1923 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
1924 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 1924 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
1925 } 1925 }
1926 1926
1927 public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List<ulong> regionslst) 1927 public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List<ulong> regionslst)
@@ -1931,7 +1931,7 @@ namespace OpenSim.Region.Environment.Scenes
1931 { 1931 {
1932 lock (av) 1932 lock (av)
1933 { 1933 {
1934 1934
1935 for (int i = 0; i < regionslst.Count; i++) 1935 for (int i = 0; i < regionslst.Count; i++)
1936 { 1936 {
1937 av.KnownChildRegions.Remove(regionslst[i]); 1937 av.KnownChildRegions.Remove(regionslst[i]);
@@ -1957,7 +1957,7 @@ namespace OpenSim.Region.Environment.Scenes
1957 #region Entities 1957 #region Entities
1958 1958
1959 /// <summary> 1959 /// <summary>
1960 /// 1960 ///
1961 /// </summary> 1961 /// </summary>
1962 /// <param name="entID"></param> 1962 /// <param name="entID"></param>
1963 /// <returns></returns> 1963 /// <returns></returns>
@@ -1983,7 +1983,7 @@ namespace OpenSim.Region.Environment.Scenes
1983 #region RegionComms 1983 #region RegionComms
1984 1984
1985 /// <summary> 1985 /// <summary>
1986 /// 1986 ///
1987 /// </summary> 1987 /// </summary>
1988 public void RegisterCommsEvents() 1988 public void RegisterCommsEvents()
1989 { 1989 {
@@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes
1999 } 1999 }
2000 2000
2001 /// <summary> 2001 /// <summary>
2002 /// 2002 ///
2003 /// </summary> 2003 /// </summary>
2004 public void UnRegisterReginWithComms() 2004 public void UnRegisterReginWithComms()
2005 { 2005 {
@@ -2026,7 +2026,7 @@ namespace OpenSim.Region.Environment.Scenes
2026 if (regionHandle == m_regInfo.RegionHandle) 2026 if (regionHandle == m_regInfo.RegionHandle)
2027 { 2027 {
2028 capsPaths[agent.AgentID] = agent.CapsPath; 2028 capsPaths[agent.AgentID] = agent.CapsPath;
2029 2029
2030 if (!agent.child) 2030 if (!agent.child)
2031 { 2031 {
2032 AddCapsHandler(agent.AgentID); 2032 AddCapsHandler(agent.AgentID);
@@ -2041,44 +2041,44 @@ namespace OpenSim.Region.Environment.Scenes
2041 } 2041 }
2042 } 2042 }
2043 } 2043 }
2044 2044
2045 m_log.DebugFormat( 2045 m_log.DebugFormat(
2046 "[CONNECTION DEBUGGING]: Creating new circuit code ({0}) for avatar {1} at {2}", 2046 "[CONNECTION DEBUGGING]: Creating new circuit code ({0}) for avatar {1} at {2}",
2047 agent.circuitcode, agent.AgentID, RegionInfo.RegionName); 2047 agent.circuitcode, agent.AgentID, RegionInfo.RegionName);
2048 2048
2049 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2049 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2050 } 2050 }
2051 else 2051 else
2052 { 2052 {
2053 m_log.WarnFormat( 2053 m_log.WarnFormat(
2054 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}", 2054 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
2055 agent.AgentID, regionHandle, RegionInfo.RegionName); 2055 agent.AgentID, regionHandle, RegionInfo.RegionName);
2056 } 2056 }
2057 } 2057 }
2058 2058
2059 /// <summary> 2059 /// <summary>
2060 /// Add a caps handler for the given agent. If the CAPS handler already exists for this agent, 2060 /// Add a caps handler for the given agent. If the CAPS handler already exists for this agent,
2061 /// then it is replaced by a new CAPS handler. 2061 /// then it is replaced by a new CAPS handler.
2062 /// 2062 ///
2063 /// FIXME: On login this is called twice, once for the login and once when the connection is made. 2063 /// FIXME: On login this is called twice, once for the login and once when the connection is made.
2064 /// This is somewhat innefficient and should be fixed. The initial login creation is necessary 2064 /// This is somewhat innefficient and should be fixed. The initial login creation is necessary
2065 /// since the client asks for capabilities immediately after being informed of the seed. 2065 /// since the client asks for capabilities immediately after being informed of the seed.
2066 /// </summary> 2066 /// </summary>
2067 /// <param name="agentId"></param> 2067 /// <param name="agentId"></param>
2068 /// <param name="capsObjectPath"></param> 2068 /// <param name="capsObjectPath"></param>
2069 public void AddCapsHandler(LLUUID agentId) 2069 public void AddCapsHandler(LLUUID agentId)
2070 { 2070 {
2071 String capsObjectPath = GetCapsPath(agentId); 2071 String capsObjectPath = GetCapsPath(agentId);
2072 2072
2073 m_log.DebugFormat( 2073 m_log.DebugFormat(
2074 "[CAPS]: Setting up CAPS handler for root agent {0} in {1}", 2074 "[CAPS]: Setting up CAPS handler for root agent {0} in {1}",
2075 agentId, RegionInfo.RegionName); 2075 agentId, RegionInfo.RegionName);
2076 2076
2077 Caps cap = 2077 Caps cap =
2078 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, 2078 new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port,
2079 capsObjectPath, agentId, m_dumpAssetsToFile, RegionInfo.RegionName); 2079 capsObjectPath, agentId, m_dumpAssetsToFile, RegionInfo.RegionName);
2080 cap.RegisterHandlers(); 2080 cap.RegisterHandlers();
2081 2081
2082 EventManager.TriggerOnRegisterCaps(agentId, cap); 2082 EventManager.TriggerOnRegisterCaps(agentId, cap);
2083 2083
2084 cap.AddNewInventoryItem = AddInventoryItem; 2084 cap.AddNewInventoryItem = AddInventoryItem;
@@ -2087,7 +2087,7 @@ namespace OpenSim.Region.Environment.Scenes
2087 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS; 2087 cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
2088 cap.GetClient = m_innerScene.GetControllingClient; 2088 cap.GetClient = m_innerScene.GetControllingClient;
2089 m_capsHandlers[agentId] = cap; 2089 m_capsHandlers[agentId] = cap;
2090 } 2090 }
2091 2091
2092 /// <summary> 2092 /// <summary>
2093 /// Remove the caps handler for a given agent. 2093 /// Remove the caps handler for a given agent.
@@ -2100,9 +2100,9 @@ namespace OpenSim.Region.Environment.Scenes
2100 if (m_capsHandlers.ContainsKey(agentId)) 2100 if (m_capsHandlers.ContainsKey(agentId))
2101 { 2101 {
2102 m_log.DebugFormat( 2102 m_log.DebugFormat(
2103 "[CAPS]: Removing CAPS handler for root agent {0} in {1}", 2103 "[CAPS]: Removing CAPS handler for root agent {0} in {1}",
2104 agentId, RegionInfo.RegionName); 2104 agentId, RegionInfo.RegionName);
2105 2105
2106 m_capsHandlers[agentId].DeregisterHandlers(); 2106 m_capsHandlers[agentId].DeregisterHandlers();
2107 EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]); 2107 EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]);
2108 2108
@@ -2118,7 +2118,7 @@ namespace OpenSim.Region.Environment.Scenes
2118 } 2118 }
2119 2119
2120 /// <summary> 2120 /// <summary>
2121 /// 2121 ///
2122 /// </summary> 2122 /// </summary>
2123 /// <param name="regionHandle"></param> 2123 /// <param name="regionHandle"></param>
2124 /// <param name="agentID"></param> 2124 /// <param name="agentID"></param>
@@ -2152,8 +2152,8 @@ namespace OpenSim.Region.Environment.Scenes
2152 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); 2152 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID));
2153 if (childAgentUpdate != null) 2153 if (childAgentUpdate != null)
2154 { 2154 {
2155 // I can't imagine *yet* why we would get an update if the agent is a root agent.. 2155 // I can't imagine *yet* why we would get an update if the agent is a root agent..
2156 // however to avoid a race condition crossing borders.. 2156 // however to avoid a race condition crossing borders..
2157 if (childAgentUpdate.IsChildAgent) 2157 if (childAgentUpdate.IsChildAgent)
2158 { 2158 {
2159 uint rRegionX = (uint)(cAgentData.regionHandle >> 40); 2159 uint rRegionX = (uint)(cAgentData.regionHandle >> 40);
@@ -2193,7 +2193,7 @@ namespace OpenSim.Region.Environment.Scenes
2193 } 2193 }
2194 // Tell a single agent to disconnect from the region. 2194 // Tell a single agent to disconnect from the region.
2195 presence.ControllingClient.SendShutdownConnectionNotice(); 2195 presence.ControllingClient.SendShutdownConnectionNotice();
2196 2196
2197 presence.ControllingClient.Close(true); 2197 presence.ControllingClient.Close(true);
2198 } 2198 }
2199 } 2199 }
@@ -2202,11 +2202,11 @@ namespace OpenSim.Region.Environment.Scenes
2202 2202
2203 /// <summary> 2203 /// <summary>
2204 /// Tell neighboring regions about this agent 2204 /// Tell neighboring regions about this agent
2205 /// When the regions respond with a true value, 2205 /// When the regions respond with a true value,
2206 /// tell the agents about the region. 2206 /// tell the agents about the region.
2207 /// 2207 ///
2208 /// We have to tell the regions about the agents first otherwise it'll deny them access 2208 /// We have to tell the regions about the agents first otherwise it'll deny them access
2209 /// 2209 ///
2210 /// </summary> 2210 /// </summary>
2211 /// <param name="presence"></param> 2211 /// <param name="presence"></param>
2212 public void InformClientOfNeighbours(ScenePresence presence) 2212 public void InformClientOfNeighbours(ScenePresence presence)
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
2309 #region Module Methods 2309 #region Module Methods
2310 2310
2311 /// <summary> 2311 /// <summary>
2312 /// 2312 ///
2313 /// </summary> 2313 /// </summary>
2314 /// <param name="name"></param> 2314 /// <param name="name"></param>
2315 /// <param name="module"></param> 2315 /// <param name="module"></param>
@@ -2379,21 +2379,21 @@ namespace OpenSim.Region.Environment.Scenes
2379 m_statsReporter.SetObjectCapacity(objects); 2379 m_statsReporter.SetObjectCapacity(objects);
2380 } 2380 }
2381 objectCapacity = objects; 2381 objectCapacity = objects;
2382 2382
2383 } 2383 }
2384 2384
2385 public List<FriendListItem> GetFriendList(LLUUID avatarID) 2385 public List<FriendListItem> GetFriendList(LLUUID avatarID)
2386 { 2386 {
2387 return CommsManager.GetUserFriendList(avatarID); 2387 return CommsManager.GetUserFriendList(avatarID);
2388 } 2388 }
2389 2389
2390 2390
2391 #endregion 2391 #endregion
2392 2392
2393 #region Other Methods 2393 #region Other Methods
2394 2394
2395 /// <summary> 2395 /// <summary>
2396 /// 2396 ///
2397 /// </summary> 2397 /// </summary>
2398 /// <param name="phase"></param> 2398 /// <param name="phase"></param>
2399 public void SetTimePhase(int phase) 2399 public void SetTimePhase(int phase)
@@ -2402,7 +2402,7 @@ namespace OpenSim.Region.Environment.Scenes
2402 } 2402 }
2403 2403
2404 /// <summary> 2404 /// <summary>
2405 /// 2405 ///
2406 /// </summary> 2406 /// </summary>
2407 /// <param name="avatarID"></param> 2407 /// <param name="avatarID"></param>
2408 /// <param name="objectName"></param> 2408 /// <param name="objectName"></param>
@@ -2437,7 +2437,7 @@ namespace OpenSim.Region.Environment.Scenes
2437 } 2437 }
2438 2438
2439 /// <summary> 2439 /// <summary>
2440 /// 2440 ///
2441 /// </summary> 2441 /// </summary>
2442 /// <param name="url"></param> 2442 /// <param name="url"></param>
2443 /// <param name="type"></param> 2443 /// <param name="type"></param>
@@ -2451,14 +2451,14 @@ namespace OpenSim.Region.Environment.Scenes
2451 } 2451 }
2452 return LLUUID.Zero; 2452 return LLUUID.Zero;
2453 } 2453 }
2454 2454
2455 2455
2456 /// <summary> 2456 /// <summary>
2457 /// This method is a way for the Friends Module to create an instant 2457 /// This method is a way for the Friends Module to create an instant
2458 /// message to the avatar and for Instant Messages that travel across 2458 /// message to the avatar and for Instant Messages that travel across
2459 /// gridcomms to make it to the Instant Message Module. 2459 /// gridcomms to make it to the Instant Message Module.
2460 /// 2460 ///
2461 /// Friendship establishment and groups are unfortunately tied with instant messaging and 2461 /// Friendship establishment and groups are unfortunately tied with instant messaging and
2462 /// there's no way to separate them completely. 2462 /// there's no way to separate them completely.
2463 /// </summary> 2463 /// </summary>
2464 /// <param name="message">object containing the instant message data</param> 2464 /// <param name="message">object containing the instant message data</param>
@@ -2525,7 +2525,7 @@ namespace OpenSim.Region.Environment.Scenes
2525 } 2525 }
2526 2526
2527 /// <summary> 2527 /// <summary>
2528 /// 2528 ///
2529 /// </summary> 2529 /// </summary>
2530 /// <param name="message"></param> 2530 /// <param name="message"></param>
2531 public void SendGeneralAlert(string message) 2531 public void SendGeneralAlert(string message)
@@ -2539,7 +2539,7 @@ namespace OpenSim.Region.Environment.Scenes
2539 } 2539 }
2540 2540
2541 /// <summary> 2541 /// <summary>
2542 /// 2542 ///
2543 /// </summary> 2543 /// </summary>
2544 /// <param name="agentID"></param> 2544 /// <param name="agentID"></param>
2545 /// <param name="message"></param> 2545 /// <param name="message"></param>
@@ -2556,7 +2556,7 @@ namespace OpenSim.Region.Environment.Scenes
2556 } 2556 }
2557 2557
2558 /// <summary> 2558 /// <summary>
2559 /// 2559 ///
2560 /// </summary> 2560 /// </summary>
2561 /// <param name="agentID"></param> 2561 /// <param name="agentID"></param>
2562 /// <param name="sessionID"></param> 2562 /// <param name="sessionID"></param>
@@ -2569,7 +2569,7 @@ namespace OpenSim.Region.Environment.Scenes
2569 { 2569 {
2570 // User needs to be logged into this sim 2570 // User needs to be logged into this sim
2571 if (m_scenePresences.ContainsKey(agentID)) 2571 if (m_scenePresences.ContainsKey(agentID))
2572 { 2572 {
2573 // First check that this is the sim owner 2573 // First check that this is the sim owner
2574 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) 2574 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID))
2575 { 2575 {
@@ -2632,8 +2632,8 @@ namespace OpenSim.Region.Environment.Scenes
2632 2632
2633 /// <summary> 2633 /// <summary>
2634 /// Kicks User specified from the simulator. This logs them off of the grid 2634 /// Kicks User specified from the simulator. This logs them off of the grid
2635 /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes 2635 /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes
2636 /// that you're kicking it even if the avatar's UUID isn't the UUID that the 2636 /// that you're kicking it even if the avatar's UUID isn't the UUID that the
2637 /// agent is assigned 2637 /// agent is assigned
2638 /// </summary> 2638 /// </summary>
2639 /// <param name="godID">The person doing the kicking</param> 2639 /// <param name="godID">The person doing the kicking</param>
@@ -2662,7 +2662,7 @@ namespace OpenSim.Region.Environment.Scenes
2662 2662
2663 } 2663 }
2664 ); 2664 );
2665 2665
2666 // This is a bit crude. It seems the client will be null before it actually stops the thread 2666 // This is a bit crude. It seems the client will be null before it actually stops the thread
2667 // The thread will kill itself eventually :/ 2667 // The thread will kill itself eventually :/
2668 // Is there another way to make sure *all* clients get this 'inter region' message? 2668 // Is there another way to make sure *all* clients get this 'inter region' message?
@@ -2722,7 +2722,7 @@ namespace OpenSim.Region.Environment.Scenes
2722 } 2722 }
2723 2723
2724 /// <summary> 2724 /// <summary>
2725 /// 2725 ///
2726 /// </summary> 2726 /// </summary>
2727 /// <param name="firstName"></param> 2727 /// <param name="firstName"></param>
2728 /// <param name="lastName"></param> 2728 /// <param name="lastName"></param>
@@ -2743,7 +2743,7 @@ namespace OpenSim.Region.Environment.Scenes
2743 } 2743 }
2744 2744
2745 /// <summary> 2745 /// <summary>
2746 /// 2746 ///
2747 /// </summary> 2747 /// </summary>
2748 /// <param name="commandParams"></param> 2748 /// <param name="commandParams"></param>
2749 public void HandleAlertCommand(string[] commandParams) 2749 public void HandleAlertCommand(string[] commandParams)
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.Environment.Scenes
2931 private bool m_dumpAssetsToFile; 2931 private bool m_dumpAssetsToFile;
2932 2932
2933 /// <summary> 2933 /// <summary>
2934 /// 2934 ///
2935 /// </summary> 2935 /// </summary>
2936 /// <param name="scriptEngine"></param> 2936 /// <param name="scriptEngine"></param>
2937 public void AddScriptEngine(ScriptEngineInterface scriptEngine) 2937 public void AddScriptEngine(ScriptEngineInterface scriptEngine)
@@ -2978,7 +2978,7 @@ namespace OpenSim.Region.Environment.Scenes
2978 { 2978 {
2979 return false; 2979 return false;
2980 } 2980 }
2981 } 2981 }
2982 else 2982 else
2983 { 2983 {
2984 if (part.OwnerID == parcel.landData.ownerID) 2984 if (part.OwnerID == parcel.landData.ownerID)
@@ -2996,7 +2996,7 @@ namespace OpenSim.Region.Environment.Scenes
2996 2996
2997 if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize) 2997 if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize)
2998 { 2998 {
2999 // The only time parcel != null when an object is inside a region is when 2999 // The only time parcel != null when an object is inside a region is when
3000 // there is nothing behind the landchannel. IE, no land plugin loaded. 3000 // there is nothing behind the landchannel. IE, no land plugin loaded.
3001 return true; 3001 return true;
3002 } 3002 }
@@ -3027,7 +3027,7 @@ namespace OpenSim.Region.Environment.Scenes
3027 3027
3028 public bool pipeEventsForScript(uint localID) 3028 public bool pipeEventsForScript(uint localID)
3029 { 3029 {
3030 3030
3031 SceneObjectPart part = GetSceneObjectPart(localID); 3031 SceneObjectPart part = GetSceneObjectPart(localID);
3032 if (part != null) 3032 if (part != null)
3033 { 3033 {
@@ -3046,7 +3046,7 @@ namespace OpenSim.Region.Environment.Scenes
3046 #region InnerScene wrapper methods 3046 #region InnerScene wrapper methods
3047 3047
3048 /// <summary> 3048 /// <summary>
3049 /// 3049 ///
3050 /// </summary> 3050 /// </summary>
3051 /// <param name="localID"></param> 3051 /// <param name="localID"></param>
3052 /// <returns></returns> 3052 /// <returns></returns>
@@ -3071,7 +3071,7 @@ namespace OpenSim.Region.Environment.Scenes
3071 } 3071 }
3072 3072
3073 /// <summary> 3073 /// <summary>
3074 /// 3074 ///
3075 /// </summary> 3075 /// </summary>
3076 /// <param name="presence"></param> 3076 /// <param name="presence"></param>
3077 public void SendAllSceneObjectsToClient(ScenePresence presence) 3077 public void SendAllSceneObjectsToClient(ScenePresence presence)
@@ -3080,10 +3080,10 @@ namespace OpenSim.Region.Environment.Scenes
3080 } 3080 }
3081 3081
3082 //The idea is to have a group of method that return a list of avatars meeting some requirement 3082 //The idea is to have a group of method that return a list of avatars meeting some requirement
3083 // ie it could be all m_scenePresences within a certain range of the calling prim/avatar. 3083 // ie it could be all m_scenePresences within a certain range of the calling prim/avatar.
3084 3084
3085 /// <summary> 3085 /// <summary>
3086 /// 3086 ///
3087 /// </summary> 3087 /// </summary>
3088 /// <returns></returns> 3088 /// <returns></returns>
3089 public List<ScenePresence> GetAvatars() 3089 public List<ScenePresence> GetAvatars()
@@ -3132,7 +3132,7 @@ namespace OpenSim.Region.Environment.Scenes
3132 } 3132 }
3133 3133
3134 /// <summary> 3134 /// <summary>
3135 /// 3135 ///
3136 /// </summary> 3136 /// </summary>
3137 /// <param name="action"></param> 3137 /// <param name="action"></param>
3138 public void ForEachScenePresence(Action<ScenePresence> action) 3138 public void ForEachScenePresence(Action<ScenePresence> action)
@@ -3154,13 +3154,13 @@ namespace OpenSim.Region.Environment.Scenes
3154 } 3154 }
3155 } 3155 }
3156 } 3156 }
3157 3157
3158 /// <summary> 3158 /// <summary>
3159 /// Delete this object from the scene. 3159 /// Delete this object from the scene.
3160 /// </summary> 3160 /// </summary>
3161 /// <param name="group"></param> 3161 /// <param name="group"></param>
3162 public void DeleteSceneObjectGroup(SceneObjectGroup group) 3162 public void DeleteSceneObjectGroup(SceneObjectGroup group)
3163 { 3163 {
3164 SceneObjectPart rootPart = (group).GetChildPart(group.UUID); 3164 SceneObjectPart rootPart = (group).GetChildPart(group.UUID);
3165 if (rootPart.PhysActor != null) 3165 if (rootPart.PhysActor != null)
3166 { 3166 {
@@ -3177,18 +3177,18 @@ namespace OpenSim.Region.Environment.Scenes
3177 m_innerScene.RemoveAPrimCount(); 3177 m_innerScene.RemoveAPrimCount();
3178 } 3178 }
3179 group.DeleteParts(); 3179 group.DeleteParts();
3180 3180
3181 // In case anybody else retains a reference to this group, signal deletion by changing the name 3181 // In case anybody else retains a reference to this group, signal deletion by changing the name
3182 // to null. We can't zero out the UUID because this is taken from the root part, which has already 3182 // to null. We can't zero out the UUID because this is taken from the root part, which has already
3183 // been removed. 3183 // been removed.
3184 // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race 3184 // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race
3185 // conditions where a user deletes an entity while it is being stored. Really, the update 3185 // conditions where a user deletes an entity while it is being stored. Really, the update
3186 // code needs a redesign. 3186 // code needs a redesign.
3187 group.Name = null; 3187 group.Name = null;
3188 } 3188 }
3189 3189
3190 /// <summary> 3190 /// <summary>
3191 /// 3191 ///
3192 /// </summary> 3192 /// </summary>
3193 /// <param name="action"></param> 3193 /// <param name="action"></param>
3194 // public void ForEachObject(Action<SceneObjectGroup> action) 3194 // public void ForEachObject(Action<SceneObjectGroup> action)
@@ -3207,7 +3207,7 @@ namespace OpenSim.Region.Environment.Scenes
3207 // } 3207 // }
3208 3208
3209 /// <summary> 3209 /// <summary>
3210 /// 3210 ///
3211 /// </summary> 3211 /// </summary>
3212 /// <param name="localID"></param> 3212 /// <param name="localID"></param>
3213 /// <returns></returns> 3213 /// <returns></returns>
@@ -3217,7 +3217,7 @@ namespace OpenSim.Region.Environment.Scenes
3217 } 3217 }
3218 3218
3219 /// <summary> 3219 /// <summary>
3220 /// 3220 ///
3221 /// </summary> 3221 /// </summary>
3222 /// <param name="fullID"></param> 3222 /// <param name="fullID"></param>
3223 /// <returns></returns> 3223 /// <returns></returns>
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index dc67436..fbef367 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -77,11 +77,11 @@ namespace OpenSim.Region.Environment.Scenes
77 { 77 {
78 get { return m_externalChecks; } 78 get { return m_externalChecks; }
79 } 79 }
80 80
81 protected string m_datastore; 81 protected string m_datastore;
82 82
83 private uint m_nextLocalId = 8880000; 83 private uint m_nextLocalId = 8880000;
84 84
85 private AssetCache m_assetCache; 85 private AssetCache m_assetCache;
86 86
87 public AssetCache AssetCache 87 public AssetCache AssetCache
@@ -89,8 +89,8 @@ namespace OpenSim.Region.Environment.Scenes
89 get { return m_assetCache; } 89 get { return m_assetCache; }
90 set { m_assetCache = value; } 90 set { m_assetCache = value; }
91 } 91 }
92 92
93 protected RegionStatus m_regStatus; 93 protected RegionStatus m_regStatus;
94 94
95 public RegionStatus Region_Status 95 public RegionStatus Region_Status
96 { 96 {
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Scenes
130 #region Add/Remove Agent/Avatar 130 #region Add/Remove Agent/Avatar
131 131
132 /// <summary> 132 /// <summary>
133 /// 133 ///
134 /// </summary> 134 /// </summary>
135 /// <param name="remoteClient"></param> 135 /// <param name="remoteClient"></param>
136 /// <param name="agentID"></param> 136 /// <param name="agentID"></param>
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Scenes
138 public abstract void AddNewClient(IClientAPI client, bool child); 138 public abstract void AddNewClient(IClientAPI client, bool child);
139 139
140 /// <summary> 140 /// <summary>
141 /// 141 ///
142 /// </summary> 142 /// </summary>
143 /// <param name="agentID"></param> 143 /// <param name="agentID"></param>
144 public abstract void RemoveClient(LLUUID agentID); 144 public abstract void RemoveClient(LLUUID agentID);
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes
148 #endregion 148 #endregion
149 149
150 /// <summary> 150 /// <summary>
151 /// 151 ///
152 /// </summary> 152 /// </summary>
153 /// <returns></returns> 153 /// <returns></returns>
154 public virtual RegionInfo RegionInfo 154 public virtual RegionInfo RegionInfo
@@ -206,7 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
206 } 206 }
207 207
208 #endregion 208 #endregion
209 209
210 /// <summary> 210 /// <summary>
211 /// XXX These two methods are very temporary 211 /// XXX These two methods are very temporary
212 /// </summary> 212 /// </summary>
@@ -217,7 +217,7 @@ namespace OpenSim.Region.Environment.Scenes
217 { 217 {
218 return capsPaths[agentId]; 218 return capsPaths[agentId];
219 } 219 }
220 220
221 return null; 221 return null;
222 } 222 }
223 } 223 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 18ce61a..885d1e9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Scenes
104 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 104 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
105 regionCommsHost.OnCloseAgentConnection += CloseConnection; 105 regionCommsHost.OnCloseAgentConnection += CloseConnection;
106 regionCommsHost.OnRegionUp += newRegionUp; 106 regionCommsHost.OnRegionUp += newRegionUp;
107 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; 107 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
108 } 108 }
109 else 109 else
110 { 110 {
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Scenes
130 #region CommsManager Event handlers 130 #region CommsManager Event handlers
131 131
132 /// <summary> 132 /// <summary>
133 /// 133 ///
134 /// </summary> 134 /// </summary>
135 /// <param name="regionHandle"></param> 135 /// <param name="regionHandle"></param>
136 /// <param name="agent"></param> 136 /// <param name="agent"></param>
@@ -289,7 +289,7 @@ namespace OpenSim.Region.Environment.Scenes
289 agent.child = true; 289 agent.child = true;
290 290
291 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 291 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
292 292
293 try 293 try
294 { 294 {
295 d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, 295 d.BeginInvoke(avatar, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint,
@@ -299,20 +299,20 @@ namespace OpenSim.Region.Environment.Scenes
299 catch (Exception e) 299 catch (Exception e)
300 { 300 {
301 m_log.ErrorFormat( 301 m_log.ErrorFormat(
302 "[REGIONINFO]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}", 302 "[REGIONINFO]: Could not resolve external hostname {0} for region {1} ({2}, {3}). {4}",
303 neighbours[i].ExternalHostName, 303 neighbours[i].ExternalHostName,
304 neighbours[i].RegionHandle, 304 neighbours[i].RegionHandle,
305 neighbours[i].RegionLocX, 305 neighbours[i].RegionLocX,
306 neighbours[i].RegionLocY, 306 neighbours[i].RegionLocY,
307 e); 307 e);
308 308
309 // FIXME: Okay, even though we've failed, we're still going to throw the exception on, 309 // FIXME: Okay, even though we've failed, we're still going to throw the exception on,
310 // since I don't know what will happen if we just let the client continue 310 // since I don't know what will happen if we just let the client continue
311 311
312 // XXX: Well, decided to swallow the exception instead for now. Let us see how that goes. 312 // XXX: Well, decided to swallow the exception instead for now. Let us see how that goes.
313 // throw e; 313 // throw e;
314 314
315 } 315 }
316 } 316 }
317 } 317 }
318 } 318 }
@@ -362,12 +362,12 @@ namespace OpenSim.Region.Environment.Scenes
362 { 362 {
363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here"); 363 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
364 handlerRegionUp = OnRegionUp; 364 handlerRegionUp = OnRegionUp;
365 365
366 // yes, we're notifying ourselves. 366 // yes, we're notifying ourselves.
367 if (handlerRegionUp != null) 367 if (handlerRegionUp != null)
368 handlerRegionUp(region); 368 handlerRegionUp(region);
369 369
370 370
371 } 371 }
372 else 372 else
373 { 373 {
@@ -407,9 +407,9 @@ namespace OpenSim.Region.Environment.Scenes
407 /// <summary> 407 /// <summary>
408 /// This informs all neighboring regions about the settings of it's child agent. 408 /// This informs all neighboring regions about the settings of it's child agent.
409 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 409 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
410 /// 410 ///
411 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. 411 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc.
412 /// 412 ///
413 /// </summary> 413 /// </summary>
414 private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence) 414 private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence)
415 { 415 {
@@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes
468 if (regionAccepted) 468 if (regionAccepted)
469 { 469 {
470 m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor"); 470 m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor");
471 471
472 } 472 }
473 else 473 else
474 { 474 {
475 m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor"); 475 m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor");
476 476
477 } 477 }
478 478
479 } 479 }
480 // We remove the list of known regions from the agent's known region list through an event 480 // We remove the list of known regions from the agent's known region list through an event
481 // to scene, because, if an agent logged of, it's likely that there will be no scene presence 481 // to scene, because, if an agent logged of, it's likely that there will be no scene presence
@@ -572,25 +572,25 @@ namespace OpenSim.Region.Environment.Scenes
572 if (destRegionUp) 572 if (destRegionUp)
573 { 573 {
574 avatar.Close(); 574 avatar.Close();
575 575
576 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport 576 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport
577 // failure at this point (unlike a border crossing failure). So perhaps this can never fail 577 // failure at this point (unlike a border crossing failure). So perhaps this can never fail
578 // once we reach here... 578 // once we reach here...
579 avatar.Scene.RemoveCapsHandler(avatar.UUID); 579 avatar.Scene.RemoveCapsHandler(avatar.UUID);
580 580
581 m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent); 581 m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent);
582 m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId, 582 m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId,
583 position, false); 583 position, false);
584 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo(); 584 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo();
585 585
586 // TODO Should construct this behind a method 586 // TODO Should construct this behind a method
587 string capsPath = 587 string capsPath =
588 "http://" + reg.ExternalHostName + ":" + reg.HttpPort 588 "http://" + reg.ExternalHostName + ":" + reg.HttpPort
589 + "/CAPS/" + circuitdata.CapsPath + "0000/"; 589 + "/CAPS/" + circuitdata.CapsPath + "0000/";
590 590
591 m_log.DebugFormat( 591 m_log.DebugFormat(
592 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); 592 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID);
593 593
594 avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), 594 avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4),
595 capsPath); 595 capsPath);
596 avatar.MakeChildAgent(); 596 avatar.MakeChildAgent();
@@ -618,7 +618,7 @@ namespace OpenSim.Region.Environment.Scenes
618 } 618 }
619 619
620 /// <summary> 620 /// <summary>
621 /// 621 ///
622 /// </summary> 622 /// </summary>
623 /// <param name="regionhandle"></param> 623 /// <param name="regionhandle"></param>
624 /// <param name="agentID"></param> 624 /// <param name="agentID"></param>
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index dacd609..7ff9213 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Scenes
183 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps); 183 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps);
184 public event DeregisterCapsEvent OnDeregisterCaps; 184 public event DeregisterCapsEvent OnDeregisterCaps;
185 185
186 public class MoneyTransferArgs : EventArgs 186 public class MoneyTransferArgs : EventArgs
187 { 187 {
188 public LLUUID sender; 188 public LLUUID sender;
189 public LLUUID receiver; 189 public LLUUID receiver;
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Scenes
208 public class LandBuyArgs : EventArgs 208 public class LandBuyArgs : EventArgs
209 { 209 {
210 public LLUUID agentId = LLUUID.Zero; 210 public LLUUID agentId = LLUUID.Zero;
211 211
212 public LLUUID groupId = LLUUID.Zero; 212 public LLUUID groupId = LLUUID.Zero;
213 213
214 public LLUUID parcelOwnerID = LLUUID.Zero; 214 public LLUUID parcelOwnerID = LLUUID.Zero;
@@ -225,9 +225,9 @@ namespace OpenSim.Region.Environment.Scenes
225 public int transactionID = 0; 225 public int transactionID = 0;
226 public int amountDebited = 0; 226 public int amountDebited = 0;
227 227
228 228
229 public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, 229 public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned,
230 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, 230 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
231 bool pauthenticated) 231 bool pauthenticated)
232 { 232 {
233 agentId = pagentId; 233 agentId = pagentId;
@@ -367,7 +367,7 @@ namespace OpenSim.Region.Environment.Scenes
367 if (handlerParcelPrimCountUpdate != null) 367 if (handlerParcelPrimCountUpdate != null)
368 { 368 {
369 handlerParcelPrimCountUpdate(); 369 handlerParcelPrimCountUpdate();
370 } 370 }
371 } 371 }
372 372
373 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e) 373 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
@@ -538,7 +538,7 @@ namespace OpenSim.Region.Environment.Scenes
538 } 538 }
539 } 539 }
540 540
541 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps) 541 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps)
542 { 542 {
543 handlerRegisterCaps = OnRegisterCaps; 543 handlerRegisterCaps = OnRegisterCaps;
544 if (handlerRegisterCaps != null) 544 if (handlerRegisterCaps != null)
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
547 } 547 }
548 } 548 }
549 549
550 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps) 550 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps)
551 { 551 {
552 handlerDeregisterCaps = OnDeregisterCaps; 552 handlerDeregisterCaps = OnDeregisterCaps;
553 if (handlerDeregisterCaps != null) 553 if (handlerDeregisterCaps != null)
@@ -580,7 +580,7 @@ namespace OpenSim.Region.Environment.Scenes
580 handlerValidateLandBuy(sender, e); 580 handlerValidateLandBuy(sender, e);
581 } 581 }
582 } 582 }
583 583
584 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) 584 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos)
585 { 585 {
586 handlerScriptAtTargetEvent = OnScriptAtTargetEvent; 586 handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 645c302..040ee70 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -61,19 +61,19 @@ namespace OpenSim.Region.Environment.Scenes
61 61
62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) 62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
63 { 63 {
64 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); 64 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
65 65
66 uint perms=part.GetEffectiveObjectFlags() | 66 uint perms=part.GetEffectiveObjectFlags() |
67 (uint)LLObject.ObjectFlags.ObjectModify | 67 (uint)LLObject.ObjectFlags.ObjectModify |
68 (uint)LLObject.ObjectFlags.ObjectCopy | 68 (uint)LLObject.ObjectFlags.ObjectCopy |
69 (uint)LLObject.ObjectFlags.ObjectMove | 69 (uint)LLObject.ObjectFlags.ObjectMove |
70 (uint)LLObject.ObjectFlags.ObjectTransfer | 70 (uint)LLObject.ObjectFlags.ObjectTransfer |
71 (uint)LLObject.ObjectFlags.ObjectYouOwner | 71 (uint)LLObject.ObjectFlags.ObjectYouOwner |
72 (uint)LLObject.ObjectFlags.ObjectYouOfficer; 72 (uint)LLObject.ObjectFlags.ObjectYouOfficer;
73 73
74 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) 74 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
75 { 75 {
76 perms &= check(userID, objectID); 76 perms &= check(userID, objectID);
77 } 77 }
78 return perms; 78 return perms;
79 } 79 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 215ab75..8f3de51 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes
180 [Obsolete("TODO: Remove this warning by 0.7")] 180 [Obsolete("TODO: Remove this warning by 0.7")]
181 public bool RunTerrainCmdOnCurrentScene(string[] cmdparams, ref string result) 181 public bool RunTerrainCmdOnCurrentScene(string[] cmdparams, ref string result)
182 { 182 {
183 m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands."); 183 m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands.");
184 return false; 184 return false;
185 } 185 }
186 186
@@ -253,7 +253,7 @@ namespace OpenSim.Region.Environment.Scenes
253 public bool TrySetCurrentScene(LLUUID regionID) 253 public bool TrySetCurrentScene(LLUUID regionID)
254 { 254 {
255 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); 255 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString());
256 256
257 foreach (Scene scene in m_localScenes) 257 foreach (Scene scene in m_localScenes)
258 { 258 {
259 if (scene.RegionInfo.RegionID == regionID) 259 if (scene.RegionInfo.RegionID == regionID)
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
262 return true; 262 return true;
263 } 263 }
264 } 264 }
265 265
266 return false; 266 return false;
267 } 267 }
268 268
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 8a7096f..1ac51a6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes
50 if (part != null) 50 if (part != null)
51 { 51 {
52 part.StartScript(itemID); 52 part.StartScript(itemID);
53 53
54 } 54 }
55 else 55 else
56 { 56 {
@@ -58,9 +58,9 @@ namespace OpenSim.Region.Environment.Scenes
58 "[PRIM INVENTORY]: " + 58 "[PRIM INVENTORY]: " +
59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 59 "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
60 localID, Name, UUID, itemID); 60 localID, Name, UUID, itemID);
61 } 61 }
62 } 62 }
63 63
64// /// Start a given script. 64// /// Start a given script.
65// /// </summary> 65// /// </summary>
66// /// <param name="localID"> 66// /// <param name="localID">
@@ -79,9 +79,9 @@ namespace OpenSim.Region.Environment.Scenes
79// "[PRIM INVENTORY]: " + 79// "[PRIM INVENTORY]: " +
80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}", 80// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
81// localID, Name, UUID, itemID); 81// localID, Name, UUID, itemID);
82// } 82// }
83// } 83// }
84 84
85 /// <summary> 85 /// <summary>
86 /// Start the scripts contained in all the prims in this group. 86 /// Start the scripts contained in all the prims in this group.
87 /// </summary> 87 /// </summary>
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 /// Start a given script. 111 /// Start a given script.
112 /// </summary> 112 /// </summary>
113 /// <param name="localID"> 113 /// <param name="localID">
@@ -127,11 +127,11 @@ namespace OpenSim.Region.Environment.Scenes
127 "[PRIM INVENTORY]: " + 127 "[PRIM INVENTORY]: " +
128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}", 128 "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
129 partID, Name, UUID, itemID); 129 partID, Name, UUID, itemID);
130 } 130 }
131 } 131 }
132 132
133 /// <summary> 133 /// <summary>
134 /// 134 ///
135 /// </summary> 135 /// </summary>
136 /// <param name="remoteClient"></param> 136 /// <param name="remoteClient"></param>
137 /// <param name="localID"></param> 137 /// <param name="localID"></param>
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Scenes
172 localID, Name, UUID); 172 localID, Name, UUID);
173 } 173 }
174 } 174 }
175 175
176 /// <summary> 176 /// <summary>
177 /// Add an inventory item to a prim in this group. 177 /// Add an inventory item to a prim in this group.
178 /// </summary> 178 /// </summary>
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes
181 /// <param name="item"></param> 181 /// <param name="item"></param>
182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 182 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
183 /// <returns></returns> 183 /// <returns></returns>
184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 184 public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
185 InventoryItemBase item, LLUUID copyItemID) 185 InventoryItemBase item, LLUUID copyItemID)
186 { 186 {
187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID; 187 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID;
@@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes
190 if (part != null) 190 if (part != null)
191 { 191 {
192 TaskInventoryItem taskItem = new TaskInventoryItem(); 192 TaskInventoryItem taskItem = new TaskInventoryItem();
193 193
194 taskItem.ItemID = newItemId; 194 taskItem.ItemID = newItemId;
195 taskItem.AssetID = item.AssetID; 195 taskItem.AssetID = item.AssetID;
196 taskItem.Name = item.Name; 196 taskItem.Name = item.Name;
197 taskItem.Description = item.Description; 197 taskItem.Description = item.Description;
@@ -199,15 +199,15 @@ namespace OpenSim.Region.Environment.Scenes
199 taskItem.CreatorID = item.Creator; 199 taskItem.CreatorID = item.Creator;
200 taskItem.Type = item.AssetType; 200 taskItem.Type = item.AssetType;
201 taskItem.InvType = item.InvType; 201 taskItem.InvType = item.InvType;
202 202
203 taskItem.BaseMask = item.BasePermissions; 203 taskItem.BaseMask = item.BasePermissions;
204 taskItem.OwnerMask = item.CurrentPermissions; 204 taskItem.OwnerMask = item.CurrentPermissions;
205 // FIXME: ignoring group permissions for now as they aren't stored in item 205 // FIXME: ignoring group permissions for now as they aren't stored in item
206 taskItem.EveryoneMask = item.EveryOnePermissions; 206 taskItem.EveryoneMask = item.EveryOnePermissions;
207 taskItem.NextOwnerMask = item.NextPermissions; 207 taskItem.NextOwnerMask = item.NextPermissions;
208 208
209 part.AddInventoryItem(taskItem); 209 part.AddInventoryItem(taskItem);
210 210
211 return true; 211 return true;
212 } 212 }
213 else 213 else
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 220
221 return false; 221 return false;
222 } 222 }
223 223
224 /// <summary> 224 /// <summary>
225 /// Returns an existing inventory item. Returns the original, so any changes will be live. 225 /// Returns an existing inventory item. Returns the original, so any changes will be live.
226 /// </summary> 226 /// </summary>
@@ -240,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes
240 "[PRIM INVENTORY]: " + 240 "[PRIM INVENTORY]: " +
241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}", 241 "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
242 primID, part.Name, part.UUID, itemID); 242 primID, part.Name, part.UUID, itemID);
243 } 243 }
244 244
245 return null; 245 return null;
246 } 246 }
247 247
248 /// <summary> 248 /// <summary>
249 /// Update an existing inventory item. 249 /// Update an existing inventory item.
250 /// </summary> 250 /// </summary>
@@ -256,8 +256,8 @@ namespace OpenSim.Region.Environment.Scenes
256 SceneObjectPart part = GetChildPart(item.ParentPartID); 256 SceneObjectPart part = GetChildPart(item.ParentPartID);
257 if (part != null) 257 if (part != null)
258 { 258 {
259 part.UpdateInventoryItem(item); 259 part.UpdateInventoryItem(item);
260 260
261 return true; 261 return true;
262 } 262 }
263 else 263 else
@@ -266,55 +266,55 @@ namespace OpenSim.Region.Environment.Scenes
266 "[PRIM INVENTORY]: " + 266 "[PRIM INVENTORY]: " +
267 "Couldn't find prim ID {0} to update item {1}, {2}", 267 "Couldn't find prim ID {0} to update item {1}, {2}",
268 item.ParentPartID, item.Name, item.ItemID); 268 item.ParentPartID, item.Name, item.ItemID);
269 } 269 }
270 270
271 return false; 271 return false;
272 } 272 }
273 273
274 public int RemoveInventoryItem(uint localID, LLUUID itemID) 274 public int RemoveInventoryItem(uint localID, LLUUID itemID)
275 { 275 {
276 SceneObjectPart part = GetChildPart(localID); 276 SceneObjectPart part = GetChildPart(localID);
277 if (part != null) 277 if (part != null)
278 { 278 {
279 int type = part.RemoveInventoryItem(itemID); 279 int type = part.RemoveInventoryItem(itemID);
280 280
281 return type; 281 return type;
282 } 282 }
283 283
284 return -1; 284 return -1;
285 } 285 }
286 286
287 public uint GetEffectivePermissions() 287 public uint GetEffectivePermissions()
288 { 288 {
289 uint perms=(uint)(PermissionMask.Modify | 289 uint perms=(uint)(PermissionMask.Modify |
290 PermissionMask.Copy | 290 PermissionMask.Copy |
291 PermissionMask.Move | 291 PermissionMask.Move |
292 PermissionMask.Transfer) | 7; 292 PermissionMask.Transfer) | 7;
293 293
294 foreach (SceneObjectPart part in m_parts.Values) 294 foreach (SceneObjectPart part in m_parts.Values)
295 perms &= part.MaskEffectivePermissions(); 295 perms &= part.MaskEffectivePermissions();
296 296
297 if((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0) 297 if ((RootPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
298 perms &= ~(uint)PermissionMask.Modify; 298 perms &= ~(uint)PermissionMask.Modify;
299 if((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0) 299 if ((RootPart.OwnerMask & (uint)PermissionMask.Copy) == 0)
300 perms &= ~(uint)PermissionMask.Copy; 300 perms &= ~(uint)PermissionMask.Copy;
301 if((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0) 301 if ((RootPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
302 perms &= ~(uint)PermissionMask.Transfer; 302 perms &= ~(uint)PermissionMask.Transfer;
303 303
304 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 304 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
305 perms &= ~((uint)PermissionMask.Modify >> 13); 305 perms &= ~((uint)PermissionMask.Modify >> 13);
306 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 306 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
307 perms &= ~((uint)PermissionMask.Copy >> 13); 307 perms &= ~((uint)PermissionMask.Copy >> 13);
308 if((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 308 if ((RootPart.OwnerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
309 perms &= ~((uint)PermissionMask.Transfer >> 13); 309 perms &= ~((uint)PermissionMask.Transfer >> 13);
310 310
311 return perms; 311 return perms;
312 } 312 }
313 313
314 public void ApplyNextOwnerPermissions() 314 public void ApplyNextOwnerPermissions()
315 { 315 {
316 foreach (SceneObjectPart part in m_parts.Values) 316 foreach (SceneObjectPart part in m_parts.Values)
317 part.ApplyNextOwnerPermissions(); 317 part.ApplyNextOwnerPermissions();
318 } 318 }
319 } 319 }
320} 320}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 14bfde0..332d160 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -86,11 +86,11 @@ namespace OpenSim.Region.Environment.Scenes
86 private PrimCountTaintedDelegate handlerPrimCountTainted = null; 86 private PrimCountTaintedDelegate handlerPrimCountTainted = null;
87 87
88 /// <summary> 88 /// <summary>
89 /// Signal whether the non-inventory attributes of any prims in the group have changed 89 /// Signal whether the non-inventory attributes of any prims in the group have changed
90 /// since the group's last persistent backup 90 /// since the group's last persistent backup
91 /// </summary> 91 /// </summary>
92 public bool HasGroupChanged = false; 92 public bool HasGroupChanged = false;
93 93
94 94
95 95
96 private LLVector3 lastPhysGroupPos; 96 private LLVector3 lastPhysGroupPos;
@@ -119,7 +119,7 @@ namespace OpenSim.Region.Environment.Scenes
119 /// but not sure a object should have this 119 /// but not sure a object should have this
120 /// as what does it tell us? that some avatar has selected it (but not what Avatar/user) 120 /// as what does it tell us? that some avatar has selected it (but not what Avatar/user)
121 /// think really there should be a list (or whatever) in each scenepresence 121 /// think really there should be a list (or whatever) in each scenepresence
122 /// saying what prim(s) that user has selected. 122 /// saying what prim(s) that user has selected.
123 /// </summary> 123 /// </summary>
124 protected bool m_isSelected = false; 124 protected bool m_isSelected = false;
125 125
@@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes
134 } 134 }
135 135
136 /// <summary> 136 /// <summary>
137 /// 137 ///
138 /// </summary> 138 /// </summary>
139 public int PrimCount 139 public int PrimCount
140 { 140 {
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
153 } 153 }
154 154
155 /// <summary> 155 /// <summary>
156 /// 156 ///
157 /// </summary> 157 /// </summary>
158 public LLVector3 GroupCentrePoint 158 public LLVector3 GroupCentrePoint
159 { 159 {
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Environment.Scenes
215 part.GroupPosition = val; 215 part.GroupPosition = val;
216 } 216 }
217 } 217 }
218 218
219 //if (m_rootPart.PhysActor != null) 219 //if (m_rootPart.PhysActor != null)
220 //{ 220 //{
221 //m_rootPart.PhysActor.Position = 221 //m_rootPart.PhysActor.Position =
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Scenes
225 //} 225 //}
226 } 226 }
227 } 227 }
228 228
229 public override uint LocalId 229 public override uint LocalId
230 { 230 {
231 get 231 get
@@ -316,17 +316,17 @@ namespace OpenSim.Region.Environment.Scenes
316 #region Constructors 316 #region Constructors
317 317
318 /// <summary> 318 /// <summary>
319 /// 319 ///
320 /// </summary> 320 /// </summary>
321 public SceneObjectGroup() 321 public SceneObjectGroup()
322 { 322 {
323 } 323 }
324 324
325 /// <summary> 325 /// <summary>
326 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart. 326 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart.
327 /// The original SceneObjectPart will be used rather than a copy, preserving 327 /// The original SceneObjectPart will be used rather than a copy, preserving
328 /// its existing localID and UUID. 328 /// its existing localID and UUID.
329 /// </summary> 329 /// </summary>
330 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part) 330 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part)
331 { 331 {
332 m_scene = scene; 332 m_scene = scene;
@@ -416,7 +416,7 @@ namespace OpenSim.Region.Environment.Scenes
416 } 416 }
417 417
418 /// <summary> 418 /// <summary>
419 /// 419 ///
420 /// </summary> 420 /// </summary>
421 public SceneObjectGroup(string xmlData) 421 public SceneObjectGroup(string xmlData)
422 { 422 {
@@ -464,7 +464,7 @@ namespace OpenSim.Region.Environment.Scenes
464 } 464 }
465 465
466 /// <summary> 466 /// <summary>
467 /// 467 ///
468 /// </summary> 468 /// </summary>
469 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 469 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
470 LLQuaternion rot, PrimitiveBaseShape shape) 470 LLQuaternion rot, PrimitiveBaseShape shape)
@@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
486 } 486 }
487 487
488 /// <summary> 488 /// <summary>
489 /// 489 ///
490 /// </summary> 490 /// </summary>
491 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 491 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
492 PrimitiveBaseShape shape) 492 PrimitiveBaseShape shape)
@@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes
576 576
577 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly, faceCenters); 577 EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly, faceCenters);
578 578
579 // This may need to be updated to the maximum draw distance possible.. 579 // This may need to be updated to the maximum draw distance possible..
580 // We might (and probably will) be checking for prim creation from other sims 580 // We might (and probably will) be checking for prim creation from other sims
581 // when the camera crosses the border. 581 // when the camera crosses the border.
582 float idist = Constants.RegionSize; 582 float idist = Constants.RegionSize;
@@ -676,7 +676,7 @@ namespace OpenSim.Region.Environment.Scenes
676 } 676 }
677 677
678 /// <summary> 678 /// <summary>
679 /// 679 ///
680 /// </summary> 680 /// </summary>
681 /// <param name="part"></param> 681 /// <param name="part"></param>
682 private void SetPartAsRoot(SceneObjectPart part) 682 private void SetPartAsRoot(SceneObjectPart part)
@@ -693,7 +693,7 @@ namespace OpenSim.Region.Environment.Scenes
693 DetachFromBackup(this); 693 DetachFromBackup(this);
694 m_rootPart.m_attachedAvatar = agentID; 694 m_rootPart.m_attachedAvatar = agentID;
695 695
696 696
697 if (m_rootPart.PhysActor != null) 697 if (m_rootPart.PhysActor != null)
698 { 698 {
699 m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor); 699 m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
@@ -753,7 +753,7 @@ namespace OpenSim.Region.Environment.Scenes
753 AttachToBackup(); 753 AttachToBackup();
754 m_rootPart.ScheduleFullUpdate(); 754 m_rootPart.ScheduleFullUpdate();
755 m_rootPart.ClearUndoState(); 755 m_rootPart.ClearUndoState();
756 756
757 } 757 }
758 public void DetachToInventoryPrep() 758 public void DetachToInventoryPrep()
759 { 759 {
@@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Scenes
764 //detachedpos = avatar.AbsolutePosition; 764 //detachedpos = avatar.AbsolutePosition;
765 avatar.RemoveAttachment(this); 765 avatar.RemoveAttachment(this);
766 } 766 }
767 767
768 m_rootPart.m_attachedAvatar = LLUUID.Zero; 768 m_rootPart.m_attachedAvatar = LLUUID.Zero;
769 m_rootPart.SetParentLocalId(0); 769 m_rootPart.SetParentLocalId(0);
770 //m_rootPart.SetAttachmentPoint((byte)0); 770 //m_rootPart.SetAttachmentPoint((byte)0);
@@ -773,10 +773,10 @@ namespace OpenSim.Region.Environment.Scenes
773 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 773 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
774 //AttachToBackup(); 774 //AttachToBackup();
775 //m_rootPart.ScheduleFullUpdate(); 775 //m_rootPart.ScheduleFullUpdate();
776 776
777 } 777 }
778 /// <summary> 778 /// <summary>
779 /// 779 ///
780 /// </summary> 780 /// </summary>
781 /// <param name="part"></param> 781 /// <param name="part"></param>
782 private void SetPartAsNonRoot(SceneObjectPart part) 782 private void SetPartAsNonRoot(SceneObjectPart part)
@@ -802,7 +802,7 @@ namespace OpenSim.Region.Environment.Scenes
802 } 802 }
803 803
804 /// <summary> 804 /// <summary>
805 /// Added as a way for the storage provider to reset the scene, 805 /// Added as a way for the storage provider to reset the scene,
806 /// most likely a better way to do this sort of thing but for now... 806 /// most likely a better way to do this sort of thing but for now...
807 /// </summary> 807 /// </summary>
808 /// <param name="scene"></param> 808 /// <param name="scene"></param>
@@ -813,7 +813,7 @@ namespace OpenSim.Region.Environment.Scenes
813 } 813 }
814 814
815 /// <summary> 815 /// <summary>
816 /// 816 ///
817 /// </summary> 817 /// </summary>
818 /// <param name="part"></param> 818 /// <param name="part"></param>
819 public void AddPart(SceneObjectPart part) 819 public void AddPart(SceneObjectPart part)
@@ -826,7 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
826 try 826 try
827 { 827 {
828 m_parts.Add(part.UUID, part); 828 m_parts.Add(part.UUID, part);
829 829
830 } 830 }
831 catch (Exception e) 831 catch (Exception e)
832 { 832 {
@@ -836,7 +836,7 @@ namespace OpenSim.Region.Environment.Scenes
836 } 836 }
837 837
838 /// <summary> 838 /// <summary>
839 /// 839 ///
840 /// </summary> 840 /// </summary>
841 public void UpdateParentIDs() 841 public void UpdateParentIDs()
842 { 842 {
@@ -847,7 +847,7 @@ namespace OpenSim.Region.Environment.Scenes
847 if (part.UUID != m_rootPart.UUID) 847 if (part.UUID != m_rootPart.UUID)
848 { 848 {
849 part.ParentID = m_rootPart.LocalId; 849 part.ParentID = m_rootPart.LocalId;
850 850
851 } 851 }
852 } 852 }
853 } 853 }
@@ -860,7 +860,7 @@ namespace OpenSim.Region.Environment.Scenes
860 foreach (SceneObjectPart part in m_parts.Values) 860 foreach (SceneObjectPart part in m_parts.Values)
861 { 861 {
862 part.UUID = LLUUID.Random(); 862 part.UUID = LLUUID.Random();
863 863
864 } 864 }
865 } 865 }
866 } 866 }
@@ -897,7 +897,7 @@ namespace OpenSim.Region.Environment.Scenes
897 { 897 {
898 SceneObjectPart part = GetChildPart(localId); 898 SceneObjectPart part = GetChildPart(localId);
899 OnGrabPart(part, offsetPos, remoteClient); 899 OnGrabPart(part, offsetPos, remoteClient);
900 900
901 } 901 }
902 } 902 }
903 903
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes
905 { 905 {
906 part.StoreUndoState(); 906 part.StoreUndoState();
907 part.OnGrab(offsetPos, remoteClient); 907 part.OnGrab(offsetPos, remoteClient);
908 908
909 } 909 }
910 910
911 public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) 911 public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
@@ -1068,7 +1068,7 @@ namespace OpenSim.Region.Environment.Scenes
1068 #region Events 1068 #region Events
1069 1069
1070 /// <summary> 1070 /// <summary>
1071 /// 1071 ///
1072 /// </summary> 1072 /// </summary>
1073 public void TriggerTainted() 1073 public void TriggerTainted()
1074 { 1074 {
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes
1198 1198
1199 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); 1199 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
1200 } 1200 }
1201 // Now we've made a copy that replaces this one, we need to 1201 // Now we've made a copy that replaces this one, we need to
1202 // switch the owner to the person who did the copying 1202 // switch the owner to the person who did the copying
1203 // Second Life copies an object and duplicates the first one in it's place 1203 // Second Life copies an object and duplicates the first one in it's place
1204 // So, we have to make a copy of this one, set it in it's place then set the owner on this one 1204 // So, we have to make a copy of this one, set it in it's place then set the owner on this one
@@ -1227,7 +1227,7 @@ namespace OpenSim.Region.Environment.Scenes
1227 } 1227 }
1228 1228
1229 /// <summary> 1229 /// <summary>
1230 /// 1230 ///
1231 /// </summary> 1231 /// </summary>
1232 /// <param name="part"></param> 1232 /// <param name="part"></param>
1233 /// <param name="cAgentID"></param> 1233 /// <param name="cAgentID"></param>
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Environment.Scenes
1359 } 1359 }
1360 1360
1361 /// <summary> 1361 /// <summary>
1362 /// 1362 ///
1363 /// </summary> 1363 /// </summary>
1364 /// <param name="part"></param> 1364 /// <param name="part"></param>
1365 /// <param name="cAgentID"></param> 1365 /// <param name="cAgentID"></param>
@@ -1373,14 +1373,14 @@ namespace OpenSim.Region.Environment.Scenes
1373 { 1373 {
1374 m_parts.Add(newPart.UUID, newPart); 1374 m_parts.Add(newPart.UUID, newPart);
1375 } 1375 }
1376 1376
1377 SetPartAsNonRoot(newPart); 1377 SetPartAsNonRoot(newPart);
1378 1378
1379 } 1379 }
1380 1380
1381 /// <summary> 1381 /// <summary>
1382 /// Reset the LLUUIDs for all the prims that make up this group. 1382 /// Reset the LLUUIDs for all the prims that make up this group.
1383 /// 1383 ///
1384 /// This is called by methods which want to add a new group to an existing scene, in order 1384 /// This is called by methods which want to add a new group to an existing scene, in order
1385 /// to ensure that there are no clashes with groups already present. 1385 /// to ensure that there are no clashes with groups already present.
1386 /// </summary> 1386 /// </summary>
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.Environment.Scenes
1398 } 1398 }
1399 1399
1400 /// <summary> 1400 /// <summary>
1401 /// 1401 ///
1402 /// </summary> 1402 /// </summary>
1403 /// <param name="part"></param> 1403 /// <param name="part"></param>
1404 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags) 1404 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags)
@@ -1425,7 +1425,7 @@ namespace OpenSim.Region.Environment.Scenes
1425 /// </summary> 1425 /// </summary>
1426 public override void Update() 1426 public override void Update()
1427 { 1427 {
1428 1428
1429 lock (m_parts) 1429 lock (m_parts)
1430 { 1430 {
1431 //if (m_rootPart.m_IsAttachment) 1431 //if (m_rootPart.m_IsAttachment)
@@ -1436,7 +1436,7 @@ namespace OpenSim.Region.Environment.Scenes
1436 //} 1436 //}
1437 //return; 1437 //return;
1438 //} 1438 //}
1439 1439
1440 if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) 1440 if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
1441 { 1441 {
1442 m_rootPart.UpdateFlag = 1; 1442 m_rootPart.UpdateFlag = 1;
@@ -1447,10 +1447,10 @@ namespace OpenSim.Region.Environment.Scenes
1447 //if (part.UpdateFlag == 0) part.UpdateFlag = 1; 1447 //if (part.UpdateFlag == 0) part.UpdateFlag = 1;
1448 //} 1448 //}
1449 1449
1450 1450
1451 1451
1452 checkAtTargets(); 1452 checkAtTargets();
1453 1453
1454 1454
1455 if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) 1455 if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
1456 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) 1456 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
@@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Environment.Scenes
1508 } 1508 }
1509 1509
1510 /// <summary> 1510 /// <summary>
1511 /// 1511 ///
1512 /// </summary> 1512 /// </summary>
1513 public void ScheduleGroupForTerseUpdate() 1513 public void ScheduleGroupForTerseUpdate()
1514 { 1514 {
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Environment.Scenes
1524 } 1524 }
1525 1525
1526 /// <summary> 1526 /// <summary>
1527 /// 1527 ///
1528 /// </summary> 1528 /// </summary>
1529 public void SendGroupFullUpdate() 1529 public void SendGroupFullUpdate()
1530 { 1530 {
@@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Environment.Scenes
1545 } 1545 }
1546 1546
1547 /// <summary> 1547 /// <summary>
1548 /// 1548 ///
1549 /// </summary> 1549 /// </summary>
1550 public void SendGroupTerseUpdate() 1550 public void SendGroupTerseUpdate()
1551 { 1551 {
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.Environment.Scenes
1669 { 1669 {
1670 if (objectGroup.RootPart.UpdateFlag > 0) 1670 if (objectGroup.RootPart.UpdateFlag > 0)
1671 { 1671 {
1672 // I've never actually seen this happen, though I think it's theoretically possible 1672 // I've never actually seen this happen, though I think it's theoretically possible
1673 m_log.WarnFormat( 1673 m_log.WarnFormat(
1674 "[SCENE OBJECT GROUP]: Aborted linking {0}, {1} to {2}, {3} as it has yet to finish delinking", 1674 "[SCENE OBJECT GROUP]: Aborted linking {0}, {1} to {2}, {3} as it has yet to finish delinking",
1675 objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1675 objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -1678,7 +1678,7 @@ namespace OpenSim.Region.Environment.Scenes
1678 } 1678 }
1679 1679
1680// m_log.DebugFormat( 1680// m_log.DebugFormat(
1681// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 1681// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
1682// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1682// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
1683 1683
1684 SceneObjectPart linkPart = objectGroup.m_rootPart; 1684 SceneObjectPart linkPart = objectGroup.m_rootPart;
@@ -1747,19 +1747,19 @@ namespace OpenSim.Region.Environment.Scenes
1747 } 1747 }
1748 1748
1749 /// <summary> 1749 /// <summary>
1750 /// Delink the given prim from this group. The delinked prim is established as 1750 /// Delink the given prim from this group. The delinked prim is established as
1751 /// an independent SceneObjectGroup. 1751 /// an independent SceneObjectGroup.
1752 /// </summary> 1752 /// </summary>
1753 /// <param name="partID"></param> 1753 /// <param name="partID"></param>
1754 public void DelinkFromGroup(uint partID) 1754 public void DelinkFromGroup(uint partID)
1755 { 1755 {
1756 SceneObjectPart linkPart = GetChildPart(partID); 1756 SceneObjectPart linkPart = GetChildPart(partID);
1757 1757
1758 if (null != linkPart) 1758 if (null != linkPart)
1759 { 1759 {
1760 linkPart.ClearUndoState(); 1760 linkPart.ClearUndoState();
1761// m_log.DebugFormat( 1761// m_log.DebugFormat(
1762// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", 1762// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
1763// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); 1763// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
1764 1764
1765 LLQuaternion worldRot = linkPart.GetWorldRotation(); 1765 LLQuaternion worldRot = linkPart.GetWorldRotation();
@@ -1777,8 +1777,8 @@ namespace OpenSim.Region.Environment.Scenes
1777 m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor); 1777 m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
1778 } 1778 }
1779 1779
1780 // We need to reset the child part's position 1780 // We need to reset the child part's position
1781 // ready for life as a separate object after being a part of another object 1781 // ready for life as a separate object after being a part of another object
1782 Quaternion parentRot 1782 Quaternion parentRot
1783 = new Quaternion( 1783 = new Quaternion(
1784 m_rootPart.RotationOffset.W, 1784 m_rootPart.RotationOffset.W,
@@ -1933,7 +1933,7 @@ namespace OpenSim.Region.Environment.Scenes
1933 m_rootPart.TouchName, new byte[0], m_rootPart.SitName, m_rootPart.Name, m_rootPart.Description, 1933 m_rootPart.TouchName, new byte[0], m_rootPart.SitName, m_rootPart.Name, m_rootPart.Description,
1934 m_rootPart.OwnerMask, m_rootPart.NextOwnerMask, m_rootPart.GroupMask, m_rootPart.EveryoneMask, 1934 m_rootPart.OwnerMask, m_rootPart.NextOwnerMask, m_rootPart.GroupMask, m_rootPart.EveryoneMask,
1935 m_rootPart.BaseMask); 1935 m_rootPart.BaseMask);
1936 1936
1937 } 1937 }
1938 1938
1939 /// <summary> 1939 /// <summary>
@@ -1998,13 +1998,13 @@ namespace OpenSim.Region.Environment.Scenes
1998 } 1998 }
1999 1999
2000 /// <summary> 2000 /// <summary>
2001 /// 2001 ///
2002 /// </summary> 2002 /// </summary>
2003 /// <param name="localID"></param> 2003 /// <param name="localID"></param>
2004 /// <param name="type"></param> 2004 /// <param name="type"></param>
2005 /// <param name="inUse"></param> 2005 /// <param name="inUse"></param>
2006 /// <param name="data"></param> 2006 /// <param name="data"></param>
2007 /// 2007 ///
2008 public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) 2008 public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data)
2009 { 2009 {
2010 SceneObjectPart part = GetChildPart(localID); 2010 SceneObjectPart part = GetChildPart(localID);
@@ -2046,7 +2046,7 @@ namespace OpenSim.Region.Environment.Scenes
2046 } 2046 }
2047 2047
2048 /// <summary> 2048 /// <summary>
2049 /// 2049 ///
2050 /// </summary> 2050 /// </summary>
2051 /// <param name="localID"></param> 2051 /// <param name="localID"></param>
2052 /// <param name="textureEntry"></param> 2052 /// <param name="textureEntry"></param>
@@ -2071,7 +2071,7 @@ namespace OpenSim.Region.Environment.Scenes
2071 #region Shape 2071 #region Shape
2072 2072
2073 /// <summary> 2073 /// <summary>
2074 /// 2074 ///
2075 /// </summary> 2075 /// </summary>
2076 /// <param name="shapeBlock"></param> 2076 /// <param name="shapeBlock"></param>
2077 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 2077 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
@@ -2091,7 +2091,7 @@ namespace OpenSim.Region.Environment.Scenes
2091 #region Resize 2091 #region Resize
2092 2092
2093 /// <summary> 2093 /// <summary>
2094 /// 2094 ///
2095 /// </summary> 2095 /// </summary>
2096 /// <param name="scale"></param> 2096 /// <param name="scale"></param>
2097 /// <param name="localID"></param> 2097 /// <param name="localID"></param>
@@ -2169,7 +2169,7 @@ namespace OpenSim.Region.Environment.Scenes
2169 #region Position 2169 #region Position
2170 2170
2171 /// <summary> 2171 /// <summary>
2172 /// 2172 ///
2173 /// </summary> 2173 /// </summary>
2174 /// <param name="pos"></param> 2174 /// <param name="pos"></param>
2175 public void UpdateGroupPosition(LLVector3 pos) 2175 public void UpdateGroupPosition(LLVector3 pos)
@@ -2189,7 +2189,7 @@ namespace OpenSim.Region.Environment.Scenes
2189 } 2189 }
2190 2190
2191 /// <summary> 2191 /// <summary>
2192 /// 2192 ///
2193 /// </summary> 2193 /// </summary>
2194 /// <param name="pos"></param> 2194 /// <param name="pos"></param>
2195 /// <param name="localID"></param> 2195 /// <param name="localID"></param>
@@ -2210,7 +2210,7 @@ namespace OpenSim.Region.Environment.Scenes
2210 } 2210 }
2211 2211
2212 /// <summary> 2212 /// <summary>
2213 /// 2213 ///
2214 /// </summary> 2214 /// </summary>
2215 /// <param name="pos"></param> 2215 /// <param name="pos"></param>
2216 private void UpdateRootPosition(LLVector3 pos) 2216 private void UpdateRootPosition(LLVector3 pos)
@@ -2255,7 +2255,7 @@ namespace OpenSim.Region.Environment.Scenes
2255 #region Rotation 2255 #region Rotation
2256 2256
2257 /// <summary> 2257 /// <summary>
2258 /// 2258 ///
2259 /// </summary> 2259 /// </summary>
2260 /// <param name="rot"></param> 2260 /// <param name="rot"></param>
2261 public void UpdateGroupRotation(LLQuaternion rot) 2261 public void UpdateGroupRotation(LLQuaternion rot)
@@ -2272,7 +2272,7 @@ namespace OpenSim.Region.Environment.Scenes
2272 } 2272 }
2273 2273
2274 /// <summary> 2274 /// <summary>
2275 /// 2275 ///
2276 /// </summary> 2276 /// </summary>
2277 /// <param name="pos"></param> 2277 /// <param name="pos"></param>
2278 /// <param name="rot"></param> 2278 /// <param name="rot"></param>
@@ -2291,7 +2291,7 @@ namespace OpenSim.Region.Environment.Scenes
2291 } 2291 }
2292 2292
2293 /// <summary> 2293 /// <summary>
2294 /// 2294 ///
2295 /// </summary> 2295 /// </summary>
2296 /// <param name="rot"></param> 2296 /// <param name="rot"></param>
2297 /// <param name="localID"></param> 2297 /// <param name="localID"></param>
@@ -2312,7 +2312,7 @@ namespace OpenSim.Region.Environment.Scenes
2312 } 2312 }
2313 2313
2314 /// <summary> 2314 /// <summary>
2315 /// 2315 ///
2316 /// </summary> 2316 /// </summary>
2317 /// <param name="rot"></param> 2317 /// <param name="rot"></param>
2318 private void UpdateRootRotation(LLQuaternion rot) 2318 private void UpdateRootRotation(LLQuaternion rot)
@@ -2463,7 +2463,7 @@ namespace OpenSim.Region.Environment.Scenes
2463 // Reusing att.tolerance to hold the index of the target in the targets dictionary 2463 // Reusing att.tolerance to hold the index of the target in the targets dictionary
2464 // to avoid deadlocking the sim. 2464 // to avoid deadlocking the sim.
2465 m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition); 2465 m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition);
2466 2466
2467 2467
2468 } 2468 }
2469 } 2469 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index e1be8ff..cce263c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Scenes
67 67
68 /// <summary> 68 /// <summary>
69 /// Holds in memory prim inventory 69 /// Holds in memory prim inventory
70 /// </summary> 70 /// </summary>
71 protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); 71 protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary();
72 72
73 public TaskInventoryDictionary TaskInventory 73 public TaskInventoryDictionary TaskInventory
@@ -84,21 +84,21 @@ namespace OpenSim.Region.Environment.Scenes
84 /// <summary> 84 /// <summary>
85 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating 85 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating
86 /// new ones or setting existing UUIDs to the correct parent UUIDs. 86 /// new ones or setting existing UUIDs to the correct parent UUIDs.
87 /// 87 ///
88 /// If this method is called and there are inventory items, then we regard the inventory as having changed. 88 /// If this method is called and there are inventory items, then we regard the inventory as having changed.
89 /// </summary> 89 /// </summary>
90 /// <param name="linkNum">Link number for the part</param> 90 /// <param name="linkNum">Link number for the part</param>
91 public void ResetInventoryIDs() 91 public void ResetInventoryIDs()
92 { 92 {
93 lock (TaskInventory) 93 lock (TaskInventory)
94 { 94 {
95 if (0 == TaskInventory.Count) 95 if (0 == TaskInventory.Count)
96 { 96 {
97 return; 97 return;
98 } 98 }
99 99
100 HasInventoryChanged = true; 100 HasInventoryChanged = true;
101 101
102 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(TaskInventory.Values); 102 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(TaskInventory.Values);
103 TaskInventory.Clear(); 103 TaskInventory.Clear();
104 104
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Scenes
127 if (ownerId != item.OwnerID) 127 if (ownerId != item.OwnerID)
128 { 128 {
129 item.LastOwnerID = item.OwnerID; 129 item.LastOwnerID = item.OwnerID;
130 item.OwnerID = ownerId; 130 item.OwnerID = ownerId;
131 } 131 }
132 } 132 }
133 } 133 }
@@ -178,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes
178 { 178 {
179 // m_log.InfoFormat( 179 // m_log.InfoFormat(
180 // "[PRIM INVENTORY]: " + 180 // "[PRIM INVENTORY]: " +
181 // "Starting script {0}, {1} in prim {2}, {3}", 181 // "Starting script {0}, {1} in prim {2}, {3}",
182 // item.Name, item.ItemID, Name, UUID); 182 // item.Name, item.ItemID, Name, UUID);
183 AddFlag(LLObject.ObjectFlags.Scripted); 183 AddFlag(LLObject.ObjectFlags.Scripted);
184 184
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Scenes
211 /// </summary> 211 /// </summary>
212 /// <param name="itemId"> 212 /// <param name="itemId">
213 /// A <see cref="LLUUID"/> 213 /// A <see cref="LLUUID"/>
214 /// </param> 214 /// </param>
215 public void StartScript(LLUUID itemId) 215 public void StartScript(LLUUID itemId)
216 { 216 {
217 lock (m_taskInventory) 217 lock (m_taskInventory)
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Scenes
234 /// <summary> 234 /// <summary>
235 /// Stop a script which is in this prim's inventory. 235 /// Stop a script which is in this prim's inventory.
236 /// </summary> 236 /// </summary>
237 /// <param name="itemId"></param> 237 /// <param name="itemId"></param>
238 public void StopScript(LLUUID itemId) 238 public void StopScript(LLUUID itemId)
239 { 239 {
240 if (m_taskInventory.ContainsKey(itemId)) 240 if (m_taskInventory.ContainsKey(itemId))
@@ -306,9 +306,9 @@ namespace OpenSim.Region.Environment.Scenes
306 } 306 }
307 307
308 /// <summary> 308 /// <summary>
309 /// Restore a whole collection of items to the prim's inventory at once. 309 /// Restore a whole collection of items to the prim's inventory at once.
310 /// We assume that the items already have all their fields correctly filled out. 310 /// We assume that the items already have all their fields correctly filled out.
311 /// The items are not flagged for persistence to the database, since they are being restored 311 /// The items are not flagged for persistence to the database, since they are being restored
312 /// from persistence rather than being newly added. 312 /// from persistence rather than being newly added.
313 /// </summary> 313 /// </summary>
314 /// <param name="items"></param> 314 /// <param name="items"></param>
@@ -338,9 +338,9 @@ namespace OpenSim.Region.Environment.Scenes
338 if (m_taskInventory.ContainsKey(itemID)) 338 if (m_taskInventory.ContainsKey(itemID))
339 { 339 {
340// m_log.DebugFormat( 340// m_log.DebugFormat(
341// "[PRIM INVENTORY]: Retrieved task inventory item {0}, {1} from prim {2}, {3}", 341// "[PRIM INVENTORY]: Retrieved task inventory item {0}, {1} from prim {2}, {3}",
342// m_taskInventory[itemID].Name, itemID, Name, UUID); 342// m_taskInventory[itemID].Name, itemID, Name, UUID);
343 343
344 return m_taskInventory[itemID]; 344 return m_taskInventory[itemID];
345 } 345 }
346 else 346 else
@@ -450,11 +450,11 @@ namespace OpenSim.Region.Environment.Scenes
450 /// <param name="client"></param> 450 /// <param name="client"></param>
451 /// <param name="localID"></param> 451 /// <param name="localID"></param>
452 public bool GetInventoryFileName(IClientAPI client, uint localID) 452 public bool GetInventoryFileName(IClientAPI client, uint localID)
453 { 453 {
454// m_log.DebugFormat( 454// m_log.DebugFormat(
455// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}", 455// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}",
456// client.AgentId, Name, UUID); 456// client.AgentId, Name, UUID);
457 457
458 if (m_inventorySerial > 0) 458 if (m_inventorySerial > 0)
459 { 459 {
460 client.SendTaskInventory(m_uuid, (short)m_inventorySerial, 460 client.SendTaskInventory(m_uuid, (short)m_inventorySerial,
@@ -473,9 +473,9 @@ namespace OpenSim.Region.Environment.Scenes
473 /// </summary> 473 /// </summary>
474 /// <param name="xferManager"></param> 474 /// <param name="xferManager"></param>
475 public void RequestInventoryFile(IXfer xferManager) 475 public void RequestInventoryFile(IXfer xferManager)
476 { 476 {
477 byte[] fileData = new byte[0]; 477 byte[] fileData = new byte[0];
478 478
479 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches 479 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
480 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality 480 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
481 // isn't available (such as drag from prim inventory to agent inventory) 481 // isn't available (such as drag from prim inventory to agent inventory)
@@ -486,39 +486,39 @@ namespace OpenSim.Region.Environment.Scenes
486 foreach (TaskInventoryItem item in m_taskInventory.Values) 486 foreach (TaskInventoryItem item in m_taskInventory.Values)
487 { 487 {
488 invString.AddItemStart(); 488 invString.AddItemStart();
489 invString.AddNameValueLine("item_id", item.ItemID.ToString()); 489 invString.AddNameValueLine("item_id", item.ItemID.ToString());
490 invString.AddNameValueLine("parent_id", UUID.ToString()); 490 invString.AddNameValueLine("parent_id", UUID.ToString());
491 491
492 invString.AddPermissionsStart(); 492 invString.AddPermissionsStart();
493 493
494 invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask)); 494 invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask));
495 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask)); 495 invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask));
496 invString.AddNameValueLine("group_mask", "00000000"); 496 invString.AddNameValueLine("group_mask", "00000000");
497 invString.AddNameValueLine("everyone_mask", "00000000"); 497 invString.AddNameValueLine("everyone_mask", "00000000");
498 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); 498 invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask));
499 499
500 invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); 500 invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
501 invString.AddNameValueLine("owner_id", item.OwnerID.ToString()); 501 invString.AddNameValueLine("owner_id", item.OwnerID.ToString());
502 502
503 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); 503 invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
504// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString()); 504// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString());
505 505
506 invString.AddNameValueLine("group_id", item.GroupID.ToString()); 506 invString.AddNameValueLine("group_id", item.GroupID.ToString());
507 invString.AddSectionEnd(); 507 invString.AddSectionEnd();
508 508
509 invString.AddNameValueLine("asset_id", item.AssetID.ToString()); 509 invString.AddNameValueLine("asset_id", item.AssetID.ToString());
510 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); 510 invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
511 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); 511 invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
512 invString.AddNameValueLine("flags", "00000000"); 512 invString.AddNameValueLine("flags", "00000000");
513 513
514 invString.AddSaleStart(); 514 invString.AddSaleStart();
515 invString.AddNameValueLine("sale_type", "not"); 515 invString.AddNameValueLine("sale_type", "not");
516 invString.AddNameValueLine("sale_price", "0"); 516 invString.AddNameValueLine("sale_price", "0");
517 invString.AddSectionEnd(); 517 invString.AddSectionEnd();
518 518
519 invString.AddNameValueLine("name", item.Name + "|"); 519 invString.AddNameValueLine("name", item.Name + "|");
520 invString.AddNameValueLine("desc", item.Description + "|"); 520 invString.AddNameValueLine("desc", item.Description + "|");
521 521
522 invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); 522 invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
523 invString.AddSectionEnd(); 523 invString.AddSectionEnd();
524 } 524 }
@@ -576,13 +576,13 @@ namespace OpenSim.Region.Environment.Scenes
576 BuildString += "\tpermissions 0\n"; 576 BuildString += "\tpermissions 0\n";
577 AddSectionStart(); 577 AddSectionStart();
578 } 578 }
579 579
580 public void AddSaleStart() 580 public void AddSaleStart()
581 { 581 {
582 BuildString += "\tsale_info\t0\n"; 582 BuildString += "\tsale_info\t0\n";
583 AddSectionStart(); 583 AddSectionStart();
584 } 584 }
585 585
586 protected void AddSectionStart() 586 protected void AddSectionStart()
587 { 587 {
588 BuildString += "\t{\n"; 588 BuildString += "\t{\n";
@@ -610,64 +610,64 @@ namespace OpenSim.Region.Environment.Scenes
610 } 610 }
611 } 611 }
612 612
613 public uint MaskEffectivePermissions() 613 public uint MaskEffectivePermissions()
614 { 614 {
615 uint mask=0x7fffffff; 615 uint mask=0x7fffffff;
616 616
617 foreach (TaskInventoryItem item in m_taskInventory.Values) 617 foreach (TaskInventoryItem item in m_taskInventory.Values)
618 { 618 {
619 if(item.InvType != 6) 619 if (item.InvType != 6)
620 { 620 {
621 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0) 621 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
622 mask &= ~((uint)PermissionMask.Copy >> 13); 622 mask &= ~((uint)PermissionMask.Copy >> 13);
623 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) 623 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
624 mask &= ~((uint)PermissionMask.Transfer >> 13); 624 mask &= ~((uint)PermissionMask.Transfer >> 13);
625 if((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0) 625 if ((item.OwnerMask & item.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
626 mask &= ~((uint)PermissionMask.Modify >> 13); 626 mask &= ~((uint)PermissionMask.Modify >> 13);
627 } 627 }
628 else 628 else
629 { 629 {
630 if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 630 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
631 mask &= ~((uint)PermissionMask.Copy >> 13); 631 mask &= ~((uint)PermissionMask.Copy >> 13);
632 if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 632 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
633 mask &= ~((uint)PermissionMask.Transfer >> 13); 633 mask &= ~((uint)PermissionMask.Transfer >> 13);
634 if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 634 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
635 mask &= ~((uint)PermissionMask.Modify >> 13); 635 mask &= ~((uint)PermissionMask.Modify >> 13);
636 } 636 }
637 637
638 if((item.OwnerMask & (uint)PermissionMask.Copy) == 0) 638 if ((item.OwnerMask & (uint)PermissionMask.Copy) == 0)
639 mask &= ~(uint)PermissionMask.Copy; 639 mask &= ~(uint)PermissionMask.Copy;
640 if((item.OwnerMask & (uint)PermissionMask.Transfer) == 0) 640 if ((item.OwnerMask & (uint)PermissionMask.Transfer) == 0)
641 mask &= ~(uint)PermissionMask.Transfer; 641 mask &= ~(uint)PermissionMask.Transfer;
642 if((item.OwnerMask & (uint)PermissionMask.Modify) == 0) 642 if ((item.OwnerMask & (uint)PermissionMask.Modify) == 0)
643 mask &= ~(uint)PermissionMask.Modify; 643 mask &= ~(uint)PermissionMask.Modify;
644 } 644 }
645 return mask; 645 return mask;
646 } 646 }
647 647
648 public void ApplyNextOwnerPermissions() 648 public void ApplyNextOwnerPermissions()
649 { 649 {
650 BaseMask &= NextOwnerMask; 650 BaseMask &= NextOwnerMask;
651 OwnerMask &= NextOwnerMask; 651 OwnerMask &= NextOwnerMask;
652 EveryoneMask &= NextOwnerMask; 652 EveryoneMask &= NextOwnerMask;
653 653
654 foreach (TaskInventoryItem item in m_taskInventory.Values) 654 foreach (TaskInventoryItem item in m_taskInventory.Values)
655 { 655 {
656 if(item.InvType == 6) 656 if (item.InvType == 6)
657 { 657 {
658 if((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0) 658 if ((item.OwnerMask & ((uint)PermissionMask.Copy >> 13)) == 0)
659 item.OwnerMask &= ~(uint)PermissionMask.Copy; 659 item.OwnerMask &= ~(uint)PermissionMask.Copy;
660 if((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0) 660 if ((item.OwnerMask & ((uint)PermissionMask.Transfer >> 13)) == 0)
661 item.OwnerMask &= ~(uint)PermissionMask.Transfer; 661 item.OwnerMask &= ~(uint)PermissionMask.Transfer;
662 if((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0) 662 if ((item.OwnerMask & ((uint)PermissionMask.Modify >> 13)) == 0)
663 item.OwnerMask &= ~(uint)PermissionMask.Modify; 663 item.OwnerMask &= ~(uint)PermissionMask.Modify;
664 } 664 }
665 item.OwnerMask &= item.NextOwnerMask; 665 item.OwnerMask &= item.NextOwnerMask;
666 item.BaseMask &= item.NextOwnerMask; 666 item.BaseMask &= item.NextOwnerMask;
667 item.EveryoneMask &= item.NextOwnerMask; 667 item.EveryoneMask &= item.NextOwnerMask;
668 } 668 }
669 669
670 TriggerScriptChangedEvent(Changed.OWNER); 670 TriggerScriptChangedEvent(Changed.OWNER);
671 } 671 }
672 } 672 }
673} 673}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0196b91..a52d5f9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -41,7 +41,7 @@ using OpenSim.Region.Physics.Manager;
41 41
42namespace OpenSim.Region.Environment.Scenes 42namespace OpenSim.Region.Environment.Scenes
43{ 43{
44 // I don't really know where to put this except here. 44 // I don't really know where to put this except here.
45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants 45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants
46 [Flags] 46 [Flags]
47 public enum ExtraParamType 47 public enum ExtraParamType
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Environment.Scenes
81 SCALE = 0x40 81 SCALE = 0x40
82 } 82 }
83 83
84 84
85 [Serializable] 85 [Serializable]
86 public partial class SceneObjectPart : IScriptHost, ISerializable 86 public partial class SceneObjectPart : IScriptHost, ISerializable
87 { 87 {
88 88
89 [XmlIgnore] public PhysicsActor PhysActor = null; 89 [XmlIgnore] public PhysicsActor PhysActor = null;
90 90
91 public LLUUID LastOwnerID; 91 public LLUUID LastOwnerID;
92 public LLUUID OwnerID; 92 public LLUUID OwnerID;
93 public LLUUID GroupID; 93 public LLUUID GroupID;
@@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Scenes
95 public byte ObjectSaleType; 95 public byte ObjectSaleType;
96 public int SalePrice; 96 public int SalePrice;
97 public uint Category; 97 public uint Category;
98 98
99 // TODO: This needs to be persisted in next XML version update! 99 // TODO: This needs to be persisted in next XML version update!
100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2}; 100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2};
101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); 101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
139 set { Flags = (LLObject.ObjectFlags)value; } 139 set { Flags = (LLObject.ObjectFlags)value; }
140 } 140 }
141 141
142 #endregion 142 #endregion
143 143
144 protected byte[] m_particleSystem = new byte[0]; 144 protected byte[] m_particleSystem = new byte[0];
145 145
@@ -152,13 +152,13 @@ namespace OpenSim.Region.Environment.Scenes
152 /// 0 - no update is scheduled 152 /// 0 - no update is scheduled
153 /// 1 - terse update scheduled 153 /// 1 - terse update scheduled
154 /// 2 - full update scheduled 154 /// 2 - full update scheduled
155 /// 155 ///
156 /// TODO - This should be an enumeration 156 /// TODO - This should be an enumeration
157 /// </summary> 157 /// </summary>
158 private byte m_updateFlag; 158 private byte m_updateFlag;
159 159
160 #region Properties 160 #region Properties
161 161
162 public LLUUID CreatorID; 162 public LLUUID CreatorID;
163 163
164 public LLUUID ObjectCreator 164 public LLUUID ObjectCreator
@@ -230,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes
230 /// <returns>A Linked Child Prim objects position in world</returns> 230 /// <returns>A Linked Child Prim objects position in world</returns>
231 public LLVector3 GetWorldPosition() 231 public LLVector3 GetWorldPosition()
232 { 232 {
233 233
234 Quaternion parentRot = new Quaternion( 234 Quaternion parentRot = new Quaternion(
235 ParentGroup.RootPart.RotationOffset.W, 235 ParentGroup.RootPart.RotationOffset.W,
236 ParentGroup.RootPart.RotationOffset.X, 236 ParentGroup.RootPart.RotationOffset.X,
@@ -256,13 +256,13 @@ namespace OpenSim.Region.Environment.Scenes
256 /// <returns></returns> 256 /// <returns></returns>
257 public LLQuaternion GetWorldRotation() 257 public LLQuaternion GetWorldRotation()
258 { 258 {
259 259
260 Quaternion newRot; 260 Quaternion newRot;
261 261
262 if (this.LinkNum == 0) 262 if (this.LinkNum == 0)
263 { 263 {
264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z); 264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z);
265 265
266 } 266 }
267 else 267 else
268 { 268 {
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); 286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
287 287
288 } 288 }
289 289
290 public void StoreUndoState() 290 public void StoreUndoState()
291 { 291 {
292 if (!m_undoing) 292 if (!m_undoing)
@@ -307,7 +307,7 @@ namespace OpenSim.Region.Environment.Scenes
307 if (m_parentGroup.GetSceneMaxUndo() > 0) 307 if (m_parentGroup.GetSceneMaxUndo() > 0)
308 { 308 {
309 UndoState nUndo = new UndoState(this); 309 UndoState nUndo = new UndoState(this);
310 310
311 m_undo.Push(nUndo); 311 m_undo.Push(nUndo);
312 312
313 } 313 }
@@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
362 } 362 }
363 else 363 else
364 { 364 {
365 365
366 // To move the child prim in respect to the group position and rotation we have to calculate 366 // To move the child prim in respect to the group position and rotation we have to calculate
367 367
368 LLVector3 resultingposition = GetWorldPosition(); 368 LLVector3 resultingposition = GetWorldPosition();
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
370 LLQuaternion resultingrot = GetWorldRotation(); 370 LLQuaternion resultingrot = GetWorldRotation();
371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z); 371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z);
372 } 372 }
373 373
374 // Tell the physics engines that this prim changed. 374 // Tell the physics engines that this prim changed.
375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
376 } 376 }
@@ -379,12 +379,12 @@ namespace OpenSim.Region.Environment.Scenes
379 Console.WriteLine(e.Message); 379 Console.WriteLine(e.Message);
380 } 380 }
381 } 381 }
382 382
383 } 383 }
384 } 384 }
385 385
386 private byte[] m_TextureAnimation; 386 private byte[] m_TextureAnimation;
387 387
388 protected LLVector3 m_offsetPosition; 388 protected LLVector3 m_offsetPosition;
389 389
390 public LLVector3 OffsetPosition 390 public LLVector3 OffsetPosition
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Environment.Scenes
398 { 398 {
399 // Hack to get the child prim to update world positions in the physics engine 399 // Hack to get the child prim to update world positions in the physics engine
400 ParentGroup.ResetChildPrimPhysicsPositions(); 400 ParentGroup.ResetChildPrimPhysicsPositions();
401 401
402 } 402 }
403 catch (NullReferenceException) 403 catch (NullReferenceException)
404 { 404 {
@@ -467,7 +467,7 @@ namespace OpenSim.Region.Environment.Scenes
467 Console.WriteLine(ex.Message); 467 Console.WriteLine(ex.Message);
468 } 468 }
469 } 469 }
470 470
471 } 471 }
472 } 472 }
473 473
@@ -494,8 +494,8 @@ namespace OpenSim.Region.Environment.Scenes
494 494
495 return m_velocity; 495 return m_velocity;
496 } 496 }
497 set { 497 set {
498 498
499 m_velocity = value; 499 m_velocity = value;
500 if (PhysActor != null) 500 if (PhysActor != null)
501 { 501 {
@@ -505,7 +505,7 @@ namespace OpenSim.Region.Environment.Scenes
505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
506 } 506 }
507 } 507 }
508 508
509 } 509 }
510 } 510 }
511 511
@@ -565,7 +565,7 @@ namespace OpenSim.Region.Environment.Scenes
565 { 565 {
566 m_color = value; 566 m_color = value;
567 TriggerScriptChangedEvent(Changed.COLOR); 567 TriggerScriptChangedEvent(Changed.COLOR);
568 568
569 /* ScheduleFullUpdate() need not be called b/c after 569 /* ScheduleFullUpdate() need not be called b/c after
570 * setting the color, the text will be set, so then 570 * setting the color, the text will be set, so then
571 * ScheduleFullUpdate() will be called. */ 571 * ScheduleFullUpdate() will be called. */
@@ -615,11 +615,11 @@ namespace OpenSim.Region.Environment.Scenes
615 public int LinkNum 615 public int LinkNum
616 { 616 {
617 get { return m_linkNum; } 617 get { return m_linkNum; }
618 set 618 set
619 { 619 {
620 m_linkNum = value; 620 m_linkNum = value;
621 TriggerScriptChangedEvent(Changed.LINK); 621 TriggerScriptChangedEvent(Changed.LINK);
622 622
623 } 623 }
624 } 624 }
625 625
@@ -646,7 +646,7 @@ namespace OpenSim.Region.Environment.Scenes
646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) 646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF)
647 { 647 {
648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); 648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z);
649 649
650 if (localGlobalTF) 650 if (localGlobalTF)
651 { 651 {
652 652
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Environment.Scenes
659 } 659 }
660 else 660 else
661 { 661 {
662 662
663 if (m_parentGroup != null) 663 if (m_parentGroup != null)
664 { 664 {
665 m_parentGroup.applyImpulse(impulse); 665 m_parentGroup.applyImpulse(impulse);
@@ -698,9 +698,9 @@ namespace OpenSim.Region.Environment.Scenes
698 public PrimitiveBaseShape Shape 698 public PrimitiveBaseShape Shape
699 { 699 {
700 get { return m_shape; } 700 get { return m_shape; }
701 set 701 set
702 { 702 {
703 703
704 m_shape = value; 704 m_shape = value;
705 TriggerScriptChangedEvent(Changed.SHAPE); 705 TriggerScriptChangedEvent(Changed.SHAPE);
706 } 706 }
@@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Scenes
709 public LLVector3 Scale 709 public LLVector3 Scale
710 { 710 {
711 get { return m_shape.Scale; } 711 get { return m_shape.Scale; }
712 set 712 set
713 { 713 {
714 StoreUndoState(); 714 StoreUndoState();
715 m_shape.Scale = value; 715 m_shape.Scale = value;
@@ -731,7 +731,7 @@ namespace OpenSim.Region.Environment.Scenes
731 } 731 }
732 732
733 #endregion 733 #endregion
734 734
735 public LLUUID ObjectOwner 735 public LLUUID ObjectOwner
736 { 736 {
737 get { return OwnerID; } 737 get { return OwnerID; }
@@ -809,9 +809,9 @@ namespace OpenSim.Region.Environment.Scenes
809 Acceleration = new LLVector3(0, 0, 0); 809 Acceleration = new LLVector3(0, 0, 0);
810 m_TextureAnimation = new byte[0]; 810 m_TextureAnimation = new byte[0];
811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp";
812 812
813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from 814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log 815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
816 816
817 Flags = 0; 817 Flags = 0;
@@ -819,7 +819,7 @@ namespace OpenSim.Region.Environment.Scenes
819 819
820 TrimPermissions(); 820 TrimPermissions();
821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); 821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());
822 822
823 ScheduleFullUpdate(); 823 ScheduleFullUpdate();
824 } 824 }
825 825
@@ -855,14 +855,14 @@ namespace OpenSim.Region.Environment.Scenes
855 OffsetPosition = position; 855 OffsetPosition = position;
856 RotationOffset = rotation; 856 RotationOffset = rotation;
857 ObjectFlags = flags; 857 ObjectFlags = flags;
858 858
859 // Since we don't store script state, this is only a 'temporary' objectflag now 859 // Since we don't store script state, this is only a 'temporary' objectflag now
860 // If the object is scripted, the script will get loaded and this will be set again 860 // If the object is scripted, the script will get loaded and this will be set again
861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch); 861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch);
862 862
863 TrimPermissions(); 863 TrimPermissions();
864 // ApplyPhysics(); 864 // ApplyPhysics();
865 865
866 ScheduleFullUpdate(); 866 ScheduleFullUpdate();
867 } 867 }
868 868
@@ -881,7 +881,7 @@ namespace OpenSim.Region.Environment.Scenes
881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); 881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader);
882 return newobject; 882 return newobject;
883 } 883 }
884 884
885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) 885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim)
886 { 886 {
887 887
@@ -902,7 +902,7 @@ namespace OpenSim.Region.Environment.Scenes
902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
903 new Quaternion(RotationOffset.W, RotationOffset.X, 903 new Quaternion(RotationOffset.W, RotationOffset.X,
904 RotationOffset.Y, RotationOffset.Z), RigidBody); 904 RotationOffset.Y, RotationOffset.Z), RigidBody);
905 905
906 // Basic Physics returns null.. joy joy joy. 906 // Basic Physics returns null.. joy joy joy.
907 if (PhysActor != null) 907 if (PhysActor != null)
908 { 908 {
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 Vector3 rOrigin = iray.Origin; 954 Vector3 rOrigin = iray.Origin;
955 Vector3 rDirection = iray.Direction; 955 Vector3 rDirection = iray.Direction;
956 956
957 957
958 958
959 //rDirection = rDirection.Normalize(); 959 //rDirection = rDirection.Normalize();
960 // Buidling the first part of the Quadratic equation 960 // Buidling the first part of the Quadratic equation
@@ -985,7 +985,7 @@ namespace OpenSim.Region.Environment.Scenes
985 radius = vScale.z; 985 radius = vScale.z;
986 986
987 // the second part of this is the default prim size 987 // the second part of this is the default prim size
988 // once we factor in the aabb of the prim we're adding we can 988 // once we factor in the aabb of the prim we're adding we can
989 // change this to; 989 // change this to;
990 // radius = (radius / 2) - 0.01f; 990 // radius = (radius / 2) - 0.01f;
991 // 991 //
@@ -1018,7 +1018,7 @@ namespace OpenSim.Region.Environment.Scenes
1018 } 1018 }
1019 } 1019 }
1020 1020
1021 // We got an intersection. putting together an EntityIntersection object with the 1021 // We got an intersection. putting together an EntityIntersection object with the
1022 // intersection information 1022 // intersection information
1023 Vector3 ipoint = 1023 Vector3 ipoint =
1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root), 1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root),
@@ -1089,16 +1089,16 @@ namespace OpenSim.Region.Environment.Scenes
1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z); 1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z);
1090 1090
1091 // tScale is the offset to derive the vertex based on the scale. 1091 // tScale is the offset to derive the vertex based on the scale.
1092 // it's different for each vertex because we've got to rotate it 1092 // it's different for each vertex because we've got to rotate it
1093 // to get the world position of the vertex to produce the Oriented Bounding Box 1093 // to get the world position of the vertex to produce the Oriented Bounding Box
1094 1094
1095 Vector3 tScale = new Vector3(); 1095 Vector3 tScale = new Vector3();
1096 1096
1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f); 1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f);
1098 1098
1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale)); 1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale));
1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1)); 1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1));
1101 1101
1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation. 1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation.
1103 Vector3 rScale = new Vector3(); 1103 Vector3 rScale = new Vector3();
1104 1104
@@ -1109,14 +1109,14 @@ namespace OpenSim.Region.Environment.Scenes
1109 // | | 1109 // | |
1110 // | 4 top | 1110 // | 4 top |
1111 // |_________| 1111 // |_________|
1112 // C D 1112 // C D
1113 1113
1114 // A _________ B 1114 // A _________ B
1115 // | Back | 1115 // | Back |
1116 // | 3 | 1116 // | 3 |
1117 // |_________| 1117 // |_________|
1118 // C D 1118 // C D
1119 1119
1120 // A _________ B B _________ A 1120 // A _________ B B _________ A
1121 // | Left | | Right | 1121 // | Left | | Right |
1122 // | 0 | | 2 | 1122 // | 0 | | 2 |
@@ -1127,13 +1127,13 @@ namespace OpenSim.Region.Environment.Scenes
1127 // | Front | 1127 // | Front |
1128 // | 1 | 1128 // | 1 |
1129 // |_________| 1129 // |_________|
1130 // C D 1130 // C D
1131 1131
1132 // C _________ D 1132 // C _________ D
1133 // | | 1133 // | |
1134 // | 5 bot | 1134 // | 5 bot |
1135 // |_________| 1135 // |_________|
1136 // A B 1136 // A B
1137 #endregion 1137 #endregion
1138 1138
1139 #region Plane Decomposition of Oriented Bounding Box 1139 #region Plane Decomposition of Oriented Bounding Box
@@ -1238,22 +1238,22 @@ namespace OpenSim.Region.Environment.Scenes
1238 for (int i = 0; i < 6; i++) 1238 for (int i = 0; i < 6; i++)
1239 { 1239 {
1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]); 1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]);
1241 1241
1242 // Our Plane direction 1242 // Our Plane direction
1243 AmBa = FaceA[i] - FaceB[i]; 1243 AmBa = FaceA[i] - FaceB[i];
1244 AmBb = FaceB[i] - FaceC[i]; 1244 AmBb = FaceB[i] - FaceC[i];
1245 1245
1246 cross = AmBb.Cross(AmBa); 1246 cross = AmBb.Cross(AmBa);
1247 1247
1248 // normalize the cross product to get the normal. 1248 // normalize the cross product to get the normal.
1249 normals[i] = cross / cross.Length; 1249 normals[i] = cross / cross.Length;
1250 1250
1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString()); 1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString());
1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1; 1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1;
1253 } 1253 }
1254 1254
1255 EntityIntersection returnresult = new EntityIntersection(); 1255 EntityIntersection returnresult = new EntityIntersection();
1256 1256
1257 returnresult.distance = 1024; 1257 returnresult.distance = 1024;
1258 float c = 0; 1258 float c = 0;
1259 float a = 0; 1259 float a = 0;
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.Environment.Scenes
1276 //{ 1276 //{
1277 //return returnresult; 1277 //return returnresult;
1278 //} 1278 //}
1279 // else 1279 // else
1280 //{ 1280 //{
1281 //continue; 1281 //continue;
1282 //} 1282 //}
@@ -1294,9 +1294,9 @@ namespace OpenSim.Region.Environment.Scenes
1294 //} 1294 //}
1295 1295
1296 //} 1296 //}
1297 //else 1297 //else
1298 //{ 1298 //{
1299 //if (a < fmin) 1299 //if (a < fmin)
1300 //{ 1300 //{
1301 //if (a < 0 || a < fmax) 1301 //if (a < 0 || a < fmax)
1302 //{ 1302 //{
@@ -1339,7 +1339,7 @@ namespace OpenSim.Region.Environment.Scenes
1339 1339
1340 // If the normal is pointing outside the object 1340 // If the normal is pointing outside the object
1341 1341
1342 1342
1343 1343
1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly) 1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly)
1345 { 1345 {
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Environment.Scenes
1359 { 1359 {
1360 distance2 = (float)GetDistanceTo(q, iray.Origin); 1360 distance2 = (float)GetDistanceTo(q, iray.Origin);
1361 } 1361 }
1362 1362
1363 1363
1364 if (distance2 < returnresult.distance) 1364 if (distance2 < returnresult.distance)
1365 { 1365 {
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Environment.Scenes
1378 } 1378 }
1379 return returnresult; 1379 return returnresult;
1380 } 1380 }
1381 1381
1382 // Use this for attachments! LocalID should be avatar's localid 1382 // Use this for attachments! LocalID should be avatar's localid
1383 public void SetParentLocalId(uint localID) 1383 public void SetParentLocalId(uint localID)
1384 { 1384 {
@@ -1388,16 +1388,16 @@ namespace OpenSim.Region.Environment.Scenes
1388 public void SetAttachmentPoint(uint AttachmentPoint) 1388 public void SetAttachmentPoint(uint AttachmentPoint)
1389 { 1389 {
1390 m_attachmentPoint = AttachmentPoint; 1390 m_attachmentPoint = AttachmentPoint;
1391 1391
1392 // save the attachment point. 1392 // save the attachment point.
1393 //if (AttachmentPoint != 0) 1393 //if (AttachmentPoint != 0)
1394 //{ 1394 //{
1395 m_shape.State = (byte)AttachmentPoint; 1395 m_shape.State = (byte)AttachmentPoint;
1396 //} 1396 //}
1397 1397
1398 } 1398 }
1399 /// <summary> 1399 /// <summary>
1400 /// 1400 ///
1401 /// </summary> 1401 /// </summary>
1402 public void SetParent(SceneObjectGroup parent) 1402 public void SetParent(SceneObjectGroup parent)
1403 { 1403 {
@@ -1417,7 +1417,7 @@ namespace OpenSim.Region.Environment.Scenes
1417 PhysActor.Buoyancy = fvalue; 1417 PhysActor.Buoyancy = fvalue;
1418 } 1418 }
1419 } 1419 }
1420 1420
1421 public void SetAxisRotation(int axis, int rotate) 1421 public void SetAxisRotation(int axis, int rotate)
1422 { 1422 {
1423 if (m_parentGroup != null) 1423 if (m_parentGroup != null)
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.Environment.Scenes
1448 1448
1449 } 1449 }
1450 } 1450 }
1451 1451
1452 1452
1453 public LLVector3 GetSitTargetPositionLL() 1453 public LLVector3 GetSitTargetPositionLL()
1454 { 1454 {
@@ -1547,9 +1547,9 @@ namespace OpenSim.Region.Environment.Scenes
1547 dupe.ObjectSaleType = ObjectSaleType; 1547 dupe.ObjectSaleType = ObjectSaleType;
1548 dupe.SalePrice = SalePrice; 1548 dupe.SalePrice = SalePrice;
1549 dupe.Category = Category; 1549 dupe.Category = Category;
1550 1550
1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone(); 1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone();
1552 1552
1553 dupe.ResetIDs(linkNum); 1553 dupe.ResetIDs(linkNum);
1554 1554
1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. 1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Environment.Scenes
1569 } 1569 }
1570 1570
1571 #endregion 1571 #endregion
1572 1572
1573 /// <summary> 1573 /// <summary>
1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and 1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and
1575 /// generating new LLUUIDs for all the items in the inventory. 1575 /// generating new LLUUIDs for all the items in the inventory.
@@ -1578,8 +1578,8 @@ namespace OpenSim.Region.Environment.Scenes
1578 public void ResetIDs(int linkNum) 1578 public void ResetIDs(int linkNum)
1579 { 1579 {
1580 UUID = LLUUID.Random(); 1580 UUID = LLUUID.Random();
1581 LinkNum = linkNum; 1581 LinkNum = linkNum;
1582 1582
1583 ResetInventoryIDs(); 1583 ResetInventoryIDs();
1584 } 1584 }
1585 1585
@@ -1603,9 +1603,9 @@ namespace OpenSim.Region.Environment.Scenes
1603 m_parentGroup.HasGroupChanged = true; 1603 m_parentGroup.HasGroupChanged = true;
1604 m_parentGroup.QueueForUpdateCheck(); 1604 m_parentGroup.QueueForUpdateCheck();
1605 } 1605 }
1606 1606
1607 int timeNow = Util.UnixTimeSinceEpoch(); 1607 int timeNow = Util.UnixTimeSinceEpoch();
1608 1608
1609 // If multiple updates are scheduled on the same second, we still need to perform all of them 1609 // If multiple updates are scheduled on the same second, we still need to perform all of them
1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need 1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need
1611 // to be performed. 1611 // to be performed.
@@ -1617,11 +1617,11 @@ namespace OpenSim.Region.Environment.Scenes
1617 { 1617 {
1618 TimeStampFull = (uint)timeNow; 1618 TimeStampFull = (uint)timeNow;
1619 } 1619 }
1620 1620
1621 m_updateFlag = 2; 1621 m_updateFlag = 2;
1622 1622
1623// m_log.DebugFormat( 1623// m_log.DebugFormat(
1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", 1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
1625// UUID, Name, TimeStampFull); 1625// UUID, Name, TimeStampFull);
1626 } 1626 }
1627 1627
@@ -1668,13 +1668,13 @@ namespace OpenSim.Region.Environment.Scenes
1668 m_updateFlag = 1; 1668 m_updateFlag = 1;
1669 1669
1670// m_log.DebugFormat( 1670// m_log.DebugFormat(
1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", 1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
1672// UUID, Name, TimeStampTerse); 1672// UUID, Name, TimeStampTerse);
1673 } 1673 }
1674 } 1674 }
1675 1675
1676 /// <summary> 1676 /// <summary>
1677 /// Tell all the prims which have had updates scheduled 1677 /// Tell all the prims which have had updates scheduled
1678 /// </summary> 1678 /// </summary>
1679 public void SendScheduledUpdates() 1679 public void SendScheduledUpdates()
1680 { 1680 {
@@ -1687,7 +1687,7 @@ namespace OpenSim.Region.Environment.Scenes
1687 // bad, so it's been replaced by an event driven method. 1687 // bad, so it's been replaced by an event driven method.
1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0) 1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0)
1689 //{ 1689 //{
1690 // Only send the constant terse updates on physical objects! 1690 // Only send the constant terse updates on physical objects!
1691 //ScheduleTerseUpdate(); 1691 //ScheduleTerseUpdate();
1692 //} 1692 //}
1693 } 1693 }
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Environment.Scenes
1706 #region Shape 1706 #region Shape
1707 1707
1708 /// <summary> 1708 /// <summary>
1709 /// 1709 ///
1710 /// </summary> 1710 /// </summary>
1711 /// <param name="shapeBlock"></param> 1711 /// <param name="shapeBlock"></param>
1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) 1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.Environment.Scenes
1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4)); 1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4));
1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5)); 1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5));
1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6)); 1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6));
1753 1753
1754 bool usePhysics = false; 1754 bool usePhysics = false;
1755 bool IsTemporary = false; 1755 bool IsTemporary = false;
1756 bool IsPhantom = false; 1756 bool IsPhantom = false;
@@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Environment.Scenes
1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); 1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0);
1759 //bool IsLocked = false; 1759 //bool IsLocked = false;
1760 int i = 0; 1760 int i = 0;
1761 1761
1762 1762
1763 try 1763 try
1764 { 1764 {
@@ -1975,7 +1975,7 @@ namespace OpenSim.Region.Environment.Scenes
1975 #region Texture 1975 #region Texture
1976 1976
1977 /// <summary> 1977 /// <summary>
1978 /// 1978 ///
1979 /// </summary> 1979 /// </summary>
1980 /// <param name="textureEntry"></param> 1980 /// <param name="textureEntry"></param>
1981 public void UpdateTextureEntry(byte[] textureEntry) 1981 public void UpdateTextureEntry(byte[] textureEntry)
@@ -1985,7 +1985,7 @@ namespace OpenSim.Region.Environment.Scenes
1985 ScheduleFullUpdate(); 1985 ScheduleFullUpdate();
1986 } 1986 }
1987 1987
1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes() 1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes()
1989 // not handling RGBA properly. Cycles through, and "fixes" the color 1989 // not handling RGBA properly. Cycles through, and "fixes" the color
1990 // info 1990 // info
1991 public void UpdateTexture(LLObject.TextureEntry tex) 1991 public void UpdateTexture(LLObject.TextureEntry tex)
@@ -2030,7 +2030,7 @@ namespace OpenSim.Region.Environment.Scenes
2030 byte[] data = new byte[16]; 2030 byte[] data = new byte[16];
2031 int pos = 0; 2031 int pos = 0;
2032 2032
2033 // The flags don't like conversion from uint to byte, so we have to do 2033 // The flags don't like conversion from uint to byte, so we have to do
2034 // it the crappy way. See the above function :( 2034 // it the crappy way. See the above function :(
2035 2035
2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; 2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++;
@@ -2059,7 +2059,7 @@ namespace OpenSim.Region.Environment.Scenes
2059 #region Position 2059 #region Position
2060 2060
2061 /// <summary> 2061 /// <summary>
2062 /// 2062 ///
2063 /// </summary> 2063 /// </summary>
2064 /// <param name="pos"></param> 2064 /// <param name="pos"></param>
2065 public void UpdateOffSet(LLVector3 pos) 2065 public void UpdateOffSet(LLVector3 pos)
@@ -2115,7 +2115,7 @@ namespace OpenSim.Region.Environment.Scenes
2115 foreach (ScenePresence p in avatarts) 2115 foreach (ScenePresence p in avatarts)
2116 { 2116 {
2117 // TODO: some filtering by distance of avatar 2117 // TODO: some filtering by distance of avatar
2118 2118
2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); 2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2120 } 2120 }
2121 } 2121 }
@@ -2193,14 +2193,14 @@ namespace OpenSim.Region.Environment.Scenes
2193 #region Resizing/Scale 2193 #region Resizing/Scale
2194 2194
2195 /// <summary> 2195 /// <summary>
2196 /// 2196 ///
2197 /// </summary> 2197 /// </summary>
2198 /// <param name="scale"></param> 2198 /// <param name="scale"></param>
2199 public void Resize(LLVector3 scale) 2199 public void Resize(LLVector3 scale)
2200 { 2200 {
2201 StoreUndoState(); 2201 StoreUndoState();
2202 m_shape.Scale = scale; 2202 m_shape.Scale = scale;
2203 2203
2204 ScheduleFullUpdate(); 2204 ScheduleFullUpdate();
2205 } 2205 }
2206 2206
@@ -2261,7 +2261,7 @@ namespace OpenSim.Region.Environment.Scenes
2261 } 2261 }
2262 2262
2263 #region Client Update Methods 2263 #region Client Update Methods
2264 2264
2265 /// <summary> 2265 /// <summary>
2266 /// Tell all scene presences that they should send updates for this part to their clients 2266 /// Tell all scene presences that they should send updates for this part to their clients
2267 /// </summary> 2267 /// </summary>
@@ -2287,7 +2287,7 @@ namespace OpenSim.Region.Environment.Scenes
2287 } 2287 }
2288 } 2288 }
2289 } 2289 }
2290 2290
2291 2291
2292 public void AddFullUpdateToAvatar(ScenePresence presence) 2292 public void AddFullUpdateToAvatar(ScenePresence presence)
2293 { 2293 {
@@ -2295,7 +2295,7 @@ namespace OpenSim.Region.Environment.Scenes
2295 } 2295 }
2296 2296
2297 /// <summary> 2297 /// <summary>
2298 /// 2298 ///
2299 /// </summary> 2299 /// </summary>
2300 public void SendFullUpdateToAllClients() 2300 public void SendFullUpdateToAllClients()
2301 { 2301 {
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
2309 } 2309 }
2310 2310
2311 /// <summary> 2311 /// <summary>
2312 /// 2312 ///
2313 /// </summary> 2313 /// </summary>
2314 /// <param name="remoteClient"></param> 2314 /// <param name="remoteClient"></param>
2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) 2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
@@ -2328,7 +2328,7 @@ namespace OpenSim.Region.Environment.Scenes
2328 lPos = OffsetPosition; 2328 lPos = OffsetPosition;
2329 SendFullUpdateToClient(remoteClient, lPos, clientflags); 2329 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2330 } 2330 }
2331 2331
2332 /// <summary> 2332 /// <summary>
2333 /// Sends a full update to the client 2333 /// Sends a full update to the client
2334 /// </summary> 2334 /// </summary>
@@ -2338,7 +2338,7 @@ namespace OpenSim.Region.Environment.Scenes
2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags) 2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags)
2339 { 2339 {
2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected; 2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected;
2341 2341
2342 if (remoteClient.AgentId == OwnerID) 2342 if (remoteClient.AgentId == OwnerID)
2343 { 2343 {
2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0) 2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0)
@@ -2351,7 +2351,7 @@ namespace OpenSim.Region.Environment.Scenes
2351 2351
2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; 2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
2353 remoteClient.SendPrimitiveToClient( 2353 remoteClient.SendPrimitiveToClient(
2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, 2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape,
2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, 2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid,
2356 OwnerID, 2356 OwnerID,
2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID); 2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID);
@@ -2373,7 +2373,7 @@ namespace OpenSim.Region.Environment.Scenes
2373 } 2373 }
2374 2374
2375 /// <summary> 2375 /// <summary>
2376 /// 2376 ///
2377 /// </summary> 2377 /// </summary>
2378 public void SendTerseUpdateToAllClients() 2378 public void SendTerseUpdateToAllClients()
2379 { 2379 {
@@ -2451,7 +2451,7 @@ namespace OpenSim.Region.Environment.Scenes
2451 m_parentGroup.AbsolutePosition = newpos; 2451 m_parentGroup.AbsolutePosition = newpos;
2452 return; 2452 return;
2453 } 2453 }
2454 2454
2455 } 2455 }
2456 ScheduleTerseUpdate(); 2456 ScheduleTerseUpdate();
2457 2457
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 28507cd..ba8bbd9 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -40,7 +40,7 @@ using OpenSim.Region.Physics.Manager;
40 40
41namespace OpenSim.Region.Environment.Scenes 41namespace OpenSim.Region.Environment.Scenes
42{ 42{
43 enum ScriptControlled : int 43 enum ScriptControlled : int
44 { 44 {
45 CONTROL_ZERO = 0, 45 CONTROL_ZERO = 0,
46 CONTROL_FWD = 1, 46 CONTROL_FWD = 1,
@@ -63,14 +63,14 @@ namespace OpenSim.Region.Environment.Scenes
63 public ScriptControlled eventControls; 63 public ScriptControlled eventControls;
64 } 64 }
65 65
66 [Serializable] 66 [Serializable]
67 public class ScenePresence : EntityBase, ISerializable 67 public class ScenePresence : EntityBase, ISerializable
68 { 68 {
69// ~ScenePresence() 69// ~ScenePresence()
70// { 70// {
71// System.Console.WriteLine("[ScenePresence] Destructor called"); 71// System.Console.WriteLine("[ScenePresence] Destructor called");
72// } 72// }
73 73
74 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 74 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
75 75
76 public static byte[] DefaultTexture; 76 public static byte[] DefaultTexture;
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes
92 private LLVector3 m_requestedSitOffset = new LLVector3(); 92 private LLVector3 m_requestedSitOffset = new LLVector3();
93 private float m_sitAvatarHeight = 2.0f; 93 private float m_sitAvatarHeight = 2.0f;
94 private float m_godlevel = 0; 94 private float m_godlevel = 0;
95 95
96 private bool m_invulnerable = true; 96 private bool m_invulnerable = true;
97 97
98 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3(); 98 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3();
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
114 private float m_health = 100f; 114 private float m_health = 100f;
115 115
116 private LLVector3 m_lastVelocity = LLVector3.Zero; 116 private LLVector3 m_lastVelocity = LLVector3.Zero;
117 117
118 // Default AV Height 118 // Default AV Height
119 private float m_avHeight = 127.0f; 119 private float m_avHeight = 127.0f;
120 120
@@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes
213 get { return m_invulnerable; } 213 get { return m_invulnerable; }
214 } 214 }
215 215
216 public float GodLevel 216 public float GodLevel
217 { 217 {
218 get { return m_godlevel; } 218 get { return m_godlevel; }
219 } 219 }
220 220
221 private readonly ulong m_regionHandle; 221 private readonly ulong m_regionHandle;
222 222
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Scenes
260 /// <summary> 260 /// <summary>
261 /// This works out to be the ClientView object associated with this avatar, or it's client connection manager 261 /// This works out to be the ClientView object associated with this avatar, or it's client connection manager
262 /// </summary> 262 /// </summary>
263 private IClientAPI m_controllingClient; 263 private IClientAPI m_controllingClient;
264 264
265 protected PhysicsActor m_physicsActor; 265 protected PhysicsActor m_physicsActor;
266 266
@@ -350,7 +350,7 @@ namespace OpenSim.Region.Environment.Scenes
350 /// <summary> 350 /// <summary>
351 /// If this is true, agent doesn't have a representation in this scene. 351 /// If this is true, agent doesn't have a representation in this scene.
352 /// this is an agent 'looking into' this scene from a nearby scene(region) 352 /// this is an agent 'looking into' this scene from a nearby scene(region)
353 /// 353 ///
354 /// if False, this agent has a representation in this scene 354 /// if False, this agent has a representation in this scene
355 /// </summary> 355 /// </summary>
356 private bool m_isChildAgent = true; 356 private bool m_isChildAgent = true;
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Environment.Scenes
482 } 482 }
483 483
484 /// <summary> 484 /// <summary>
485 /// Send updates to the client about prims which have been placed on the update queue. We don't 485 /// Send updates to the client about prims which have been placed on the update queue. We don't
486 /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent 486 /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent
487 /// timestamp has already been sent. 487 /// timestamp has already been sent.
488 /// </summary> 488 /// </summary>
@@ -498,12 +498,12 @@ namespace OpenSim.Region.Environment.Scenes
498 if (!m_gotAllObjectsInScene) 498 if (!m_gotAllObjectsInScene)
499 { 499 {
500 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) 500 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor)
501 { 501 {
502 m_scene.SendAllSceneObjectsToClient(this); 502 m_scene.SendAllSceneObjectsToClient(this);
503 m_gotAllObjectsInScene = true; 503 m_gotAllObjectsInScene = true;
504 } 504 }
505 } 505 }
506 506
507 if (m_partsUpdateQueue.Count > 0) 507 if (m_partsUpdateQueue.Count > 0)
508 { 508 {
509 bool runUpdate = true; 509 bool runUpdate = true;
@@ -520,12 +520,12 @@ namespace OpenSim.Region.Environment.Scenes
520 if (update.LastFullUpdateTime < part.TimeStampFull) 520 if (update.LastFullUpdateTime < part.TimeStampFull)
521 { 521 {
522// m_log.DebugFormat( 522// m_log.DebugFormat(
523// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}", 523// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
524// part.Name, part.UUID, part.TimeStampFull); 524// part.Name, part.UUID, part.TimeStampFull);
525 525
526 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID)); 526 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID));
527 527
528 // We'll update to the part's timestamp rather than the current time to 528 // We'll update to the part's timestamp rather than the current time to
529 // avoid the race condition whereby the next tick occurs while we are 529 // avoid the race condition whereby the next tick occurs while we are
530 // doing this update. If this happened, then subsequent updates which occurred 530 // doing this update. If this happened, then subsequent updates which occurred
531 // on the same tick or the next tick of the last update would be ignored. 531 // on the same tick or the next tick of the last update would be ignored.
@@ -536,9 +536,9 @@ namespace OpenSim.Region.Environment.Scenes
536 else if (update.LastTerseUpdateTime <= part.TimeStampTerse) 536 else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
537 { 537 {
538// m_log.DebugFormat( 538// m_log.DebugFormat(
539// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", 539// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
540// part.Name, part.UUID, part.TimeStampTerse); 540// part.Name, part.UUID, part.TimeStampTerse);
541 541
542 part.SendTerseUpdate(ControllingClient); 542 part.SendTerseUpdate(ControllingClient);
543 543
544 update.LastTerseUpdateTime = part.TimeStampTerse; 544 update.LastTerseUpdateTime = part.TimeStampTerse;
@@ -575,15 +575,15 @@ namespace OpenSim.Region.Environment.Scenes
575 575
576 /// <summary> 576 /// <summary>
577 /// This turns a child agent, into a root agent 577 /// This turns a child agent, into a root agent
578 /// This is called when an agent teleports into a region, or if an 578 /// This is called when an agent teleports into a region, or if an
579 /// agent crosses into this region from a neighbor over the border 579 /// agent crosses into this region from a neighbor over the border
580 /// </summary> 580 /// </summary>
581 public void MakeRootAgent(LLVector3 pos, bool isFlying) 581 public void MakeRootAgent(LLVector3 pos, bool isFlying)
582 { 582 {
583// m_log.DebugFormat( 583// m_log.DebugFormat(
584// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}", 584// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}",
585// Name, UUID, m_scene.RegionInfo.RegionName); 585// Name, UUID, m_scene.RegionInfo.RegionName);
586 586
587 m_isChildAgent = false; 587 m_isChildAgent = false;
588 588
589 AbsolutePosition = pos; 589 AbsolutePosition = pos;
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Environment.Scenes
599 //{ 599 //{
600 m_scene.SendAllSceneObjectsToClient(this); 600 m_scene.SendAllSceneObjectsToClient(this);
601 m_scene.LandChannel.SendLandUpdate(this, true); 601 m_scene.LandChannel.SendLandUpdate(this, true);
602 602
603 //m_gotAllObjectsInScene = true; 603 //m_gotAllObjectsInScene = true;
604 //} 604 //}
605 } 605 }
@@ -607,8 +607,8 @@ namespace OpenSim.Region.Environment.Scenes
607 /// <summary> 607 /// <summary>
608 /// This turns a root agent into a child agent 608 /// This turns a root agent into a child agent
609 /// when an agent departs this region for a neighbor, this gets called. 609 /// when an agent departs this region for a neighbor, this gets called.
610 /// 610 ///
611 /// It doesn't get called for a teleport. Reason being, an agent that 611 /// It doesn't get called for a teleport. Reason being, an agent that
612 /// teleports out may not be anywhere near this region 612 /// teleports out may not be anywhere near this region
613 /// </summary> 613 /// </summary>
614 public void MakeChildAgent() 614 public void MakeChildAgent()
@@ -616,15 +616,15 @@ namespace OpenSim.Region.Environment.Scenes
616 m_animations.Clear(); 616 m_animations.Clear();
617 617
618// m_log.DebugFormat( 618// m_log.DebugFormat(
619// "[SCENEPRESENCE]: Downgrading child agent {0}, {1} to a root agent in {2}", 619// "[SCENEPRESENCE]: Downgrading child agent {0}, {1} to a root agent in {2}",
620// Name, UUID, m_scene.RegionInfo.RegionName); 620// Name, UUID, m_scene.RegionInfo.RegionName);
621 621
622 Velocity = new LLVector3(0, 0, 0); 622 Velocity = new LLVector3(0, 0, 0);
623 m_isChildAgent = true; 623 m_isChildAgent = true;
624 m_scene.SwapRootAgentCount(true); 624 m_scene.SwapRootAgentCount(true);
625 RemoveFromPhysicalScene(); 625 RemoveFromPhysicalScene();
626 m_scene.EventManager.TriggerOnMakeChildAgent(this); 626 m_scene.EventManager.TriggerOnMakeChildAgent(this);
627 //this.Pos = new LLVector3(128, 128, 70); 627 //this.Pos = new LLVector3(128, 128, 70);
628 } 628 }
629 629
630 /// <summary> 630 /// <summary>
@@ -643,7 +643,7 @@ namespace OpenSim.Region.Environment.Scenes
643 } 643 }
644 644
645 /// <summary> 645 /// <summary>
646 /// 646 ///
647 /// </summary> 647 /// </summary>
648 /// <param name="pos"></param> 648 /// <param name="pos"></param>
649 public void Teleport(LLVector3 pos) 649 public void Teleport(LLVector3 pos)
@@ -656,7 +656,7 @@ namespace OpenSim.Region.Environment.Scenes
656 } 656 }
657 657
658 /// <summary> 658 /// <summary>
659 /// 659 ///
660 /// </summary> 660 /// </summary>
661 public void StopMovement() 661 public void StopMovement()
662 { 662 {
@@ -762,7 +762,7 @@ namespace OpenSim.Region.Environment.Scenes
762 uint flags = agentData.ControlFlags; 762 uint flags = agentData.ControlFlags;
763 LLQuaternion bodyRotation = agentData.BodyRotation; 763 LLQuaternion bodyRotation = agentData.BodyRotation;
764 764
765 // Camera location in world. We'll need to raytrace 765 // Camera location in world. We'll need to raytrace
766 // from this location from time to time. 766 // from this location from time to time.
767 m_CameraCenter.x = agentData.CameraCenter.X; 767 m_CameraCenter.x = agentData.CameraCenter.X;
768 m_CameraCenter.y = agentData.CameraCenter.Y; 768 m_CameraCenter.y = agentData.CameraCenter.Y;
@@ -815,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes
815 // m_AgentControlFlags = flags; 815 // m_AgentControlFlags = flags;
816 // m_headrotation = agentData.AgentData.HeadRotation; 816 // m_headrotation = agentData.AgentData.HeadRotation;
817 // m_state = agentData.AgentData.State; 817 // m_state = agentData.AgentData.State;
818 818
819 if (m_allowMovement) 819 if (m_allowMovement)
820 { 820 {
821 int i = 0; 821 int i = 0;
@@ -870,7 +870,7 @@ namespace OpenSim.Region.Environment.Scenes
870 i++; 870 i++;
871 } 871 }
872 } 872 }
873 // Cause the avatar to stop flying if it's colliding 873 // Cause the avatar to stop flying if it's colliding
874 // with something with the down arrow pressed. 874 // with something with the down arrow pressed.
875 875
876 // Skip if there's no physicsactor 876 // Skip if there's no physicsactor
@@ -886,7 +886,7 @@ namespace OpenSim.Region.Environment.Scenes
886 // Are the collision requirements fulfilled? 886 // Are the collision requirements fulfilled?
887 bool colliding = (m_physicsActor.IsColliding == true); 887 bool colliding = (m_physicsActor.IsColliding == true);
888 888
889 889
890 890
891 if (m_physicsActor.Flying && colliding && controlland) 891 if (m_physicsActor.Flying && colliding && controlland)
892 { 892 {
@@ -903,9 +903,9 @@ namespace OpenSim.Region.Environment.Scenes
903 UpdateMovementAnimations(); 903 UpdateMovementAnimations();
904 } 904 }
905 } 905 }
906 906
907 m_scene.EventManager.TriggerOnClientMovement(this); 907 m_scene.EventManager.TriggerOnClientMovement(this);
908 908
909 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 909 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
910 } 910 }
911 911
@@ -934,7 +934,7 @@ namespace OpenSim.Region.Environment.Scenes
934 934
935 m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); 935 m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
936 m_parentPosition = new LLVector3(); 936 m_parentPosition = new LLVector3();
937 937
938 m_parentID = 0; 938 m_parentID = 0;
939 SendFullUpdateToAllClients(); 939 SendFullUpdateToAllClients();
940 940
@@ -949,10 +949,10 @@ namespace OpenSim.Region.Environment.Scenes
949 949
950 private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) 950 private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset)
951 { 951 {
952
953 952
954 953
955 954
955
956 bool autopilot = true; 956 bool autopilot = true;
957 LLVector3 pos = new LLVector3(); 957 LLVector3 pos = new LLVector3();
958 LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); 958 LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1);
@@ -1008,10 +1008,10 @@ namespace OpenSim.Region.Environment.Scenes
1008 } 1008 }
1009 1009
1010 ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false); 1010 ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false);
1011 1011
1012 // This calls HandleAgentSit twice, once from here, and the client calls 1012 // This calls HandleAgentSit twice, once from here, and the client calls
1013 // HandleAgentSit itself after it gets to the location 1013 // HandleAgentSit itself after it gets to the location
1014 // It doesn't get to the location until we've moved them there though 1014 // It doesn't get to the location until we've moved them there though
1015 // which happens in HandleAgentSit :P 1015 // which happens in HandleAgentSit :P
1016 if (!autopilot) 1016 if (!autopilot)
1017 HandleAgentSit(remoteClient, UUID); 1017 HandleAgentSit(remoteClient, UUID);
@@ -1256,7 +1256,7 @@ namespace OpenSim.Region.Environment.Scenes
1256 } 1256 }
1257 1257
1258 m_perfMonMS = System.Environment.TickCount; 1258 m_perfMonMS = System.Environment.TickCount;
1259 1259
1260 m_rotation = rotation; 1260 m_rotation = rotation;
1261 NewForce newVelocity = new NewForce(); 1261 NewForce newVelocity = new NewForce();
1262 Vector3 direc = rotation*vec; 1262 Vector3 direc = rotation*vec;
@@ -1268,9 +1268,9 @@ namespace OpenSim.Region.Environment.Scenes
1268 direc *= 4; 1268 direc *= 4;
1269 //bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); 1269 //bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
1270 //bool colliding = (m_physicsActor.IsColliding==true); 1270 //bool colliding = (m_physicsActor.IsColliding==true);
1271 //if (controlland) 1271 //if (controlland)
1272 // m_log.Info("[AGENT]: landCommand"); 1272 // m_log.Info("[AGENT]: landCommand");
1273 //if (colliding) 1273 //if (colliding)
1274 // m_log.Info("[AGENT]: colliding"); 1274 // m_log.Info("[AGENT]: colliding");
1275 //if (m_physicsActor.Flying && colliding && controlland) 1275 //if (m_physicsActor.Flying && colliding && controlland)
1276 //{ 1276 //{
@@ -1306,7 +1306,7 @@ namespace OpenSim.Region.Environment.Scenes
1306 #region Overridden Methods 1306 #region Overridden Methods
1307 1307
1308 /// <summary> 1308 /// <summary>
1309 /// 1309 ///
1310 /// </summary> 1310 /// </summary>
1311 public override void Update() 1311 public override void Update()
1312 { 1312 {
@@ -1383,7 +1383,7 @@ namespace OpenSim.Region.Environment.Scenes
1383 lastPhysPos = AbsolutePosition; 1383 lastPhysPos = AbsolutePosition;
1384 1384
1385 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 1385 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1386 1386
1387 } 1387 }
1388 1388
1389 public void SendCoarseLocations() 1389 public void SendCoarseLocations()
@@ -1433,7 +1433,7 @@ namespace OpenSim.Region.Environment.Scenes
1433 foreach (ScenePresence avatar in avatars) 1433 foreach (ScenePresence avatar in avatars)
1434 { 1434 {
1435 SendFullUpdateToOtherClient(avatar); 1435 SendFullUpdateToOtherClient(avatar);
1436 1436
1437 if (avatar.LocalId != LocalId) 1437 if (avatar.LocalId != LocalId)
1438 { 1438 {
1439 if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) 1439 if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor)
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.Environment.Scenes
1448 } 1448 }
1449 1449
1450 /// <summary> 1450 /// <summary>
1451 /// 1451 ///
1452 /// </summary> 1452 /// </summary>
1453 public void SendInitialData() 1453 public void SendInitialData()
1454 { 1454 {
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Environment.Scenes
1472 } 1472 }
1473 1473
1474 /// <summary> 1474 /// <summary>
1475 /// 1475 ///
1476 /// </summary> 1476 /// </summary>
1477 /// <param name="client"></param> 1477 /// <param name="client"></param>
1478 public void SendOwnAppearance() 1478 public void SendOwnAppearance()
@@ -1481,7 +1481,7 @@ namespace OpenSim.Region.Environment.Scenes
1481 } 1481 }
1482 1482
1483 /// <summary> 1483 /// <summary>
1484 /// 1484 ///
1485 /// </summary> 1485 /// </summary>
1486 public void SendAppearanceToAllOtherAgents() 1486 public void SendAppearanceToAllOtherAgents()
1487 { 1487 {
@@ -1498,7 +1498,7 @@ namespace OpenSim.Region.Environment.Scenes
1498 } 1498 }
1499 1499
1500 public void SendAppearanceToOtherAgent(ScenePresence avatar) 1500 public void SendAppearanceToOtherAgent(ScenePresence avatar)
1501 { 1501 {
1502 avatar.ControllingClient.SendAppearance( 1502 avatar.ControllingClient.SendAppearance(
1503 m_appearance.Owner, 1503 m_appearance.Owner,
1504 m_appearance.VisualParams, 1504 m_appearance.VisualParams,
@@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Environment.Scenes
1522 } 1522 }
1523 1523
1524 /// <summary> 1524 /// <summary>
1525 /// 1525 ///
1526 /// </summary> 1526 /// </summary>
1527 /// <param name="animations"></param> 1527 /// <param name="animations"></param>
1528 /// <param name="seqs"></param> 1528 /// <param name="seqs"></param>
@@ -1536,7 +1536,7 @@ namespace OpenSim.Region.Environment.Scenes
1536 } 1536 }
1537 1537
1538 /// <summary> 1538 /// <summary>
1539 /// 1539 ///
1540 /// </summary> 1540 /// </summary>
1541 public void SendAnimPack() 1541 public void SendAnimPack()
1542 { 1542 {
@@ -1568,7 +1568,7 @@ namespace OpenSim.Region.Environment.Scenes
1568 } 1568 }
1569 1569
1570 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m 1570 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m
1571 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32) 1571 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32)
1572 { 1572 {
1573 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); 1573 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate();
1574 cadu.ActiveGroupID=LLUUID.Zero.UUID; 1574 cadu.ActiveGroupID=LLUUID.Zero.UUID;
@@ -1593,14 +1593,14 @@ namespace OpenSim.Region.Environment.Scenes
1593 multiplier = 0.25f; 1593 multiplier = 0.25f;
1594 } 1594 }
1595 1595
1596 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); 1596 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
1597 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 1597 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
1598
1599 1598
1600
1601 1599
1602 1600
1603 cadu.Velocity = new sLLVector3(Velocity); 1601
1602
1603 cadu.Velocity = new sLLVector3(Velocity);
1604 m_scene.SendOutChildAgentUpdates(cadu,this); 1604 m_scene.SendOutChildAgentUpdates(cadu,this);
1605 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; 1605 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;
1606 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; 1606 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y;
@@ -1681,9 +1681,9 @@ namespace OpenSim.Region.Environment.Scenes
1681 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 1681 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
1682 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 1682 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
1683 if (neighbourRegion != null) 1683 if (neighbourRegion != null)
1684 { 1684 {
1685 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar 1685 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar
1686 // This means we need to remove the current caps handler here and possibly compensate later, 1686 // This means we need to remove the current caps handler here and possibly compensate later,
1687 // in case both scenes are being hosted on the same region server. Messy 1687 // in case both scenes are being hosted on the same region server. Messy
1688 m_scene.RemoveCapsHandler(UUID); 1688 m_scene.RemoveCapsHandler(UUID);
1689 newpos = newpos + (vel); 1689 newpos = newpos + (vel);
@@ -1691,17 +1691,17 @@ namespace OpenSim.Region.Environment.Scenes
1691 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, 1691 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
1692 m_physicsActor.Flying); 1692 m_physicsActor.Flying);
1693 if (res) 1693 if (res)
1694 { 1694 {
1695 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); 1695 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
1696 1696
1697 // TODO Should construct this behind a method 1697 // TODO Should construct this behind a method
1698 string capsPath = 1698 string capsPath =
1699 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort 1699 "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
1700 + "/CAPS/" + circuitdata.CapsPath + "0000/"; 1700 + "/CAPS/" + circuitdata.CapsPath + "0000/";
1701 1701
1702 m_log.DebugFormat( 1702 m_log.DebugFormat(
1703 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, m_uuid); 1703 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, m_uuid);
1704 1704
1705 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, 1705 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
1706 capsPath); 1706 capsPath);
1707 MakeChildAgent(); 1707 MakeChildAgent();
@@ -1742,17 +1742,17 @@ namespace OpenSim.Region.Environment.Scenes
1742 /// </summary> 1742 /// </summary>
1743 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) 1743 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY)
1744 { 1744 {
1745 // 1745 //
1746 int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; 1746 int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize;
1747 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; 1747 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize;
1748 1748
1749 m_DrawDistance = cAgentData.drawdistance; 1749 m_DrawDistance = cAgentData.drawdistance;
1750 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z); 1750 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z);
1751 1751
1752 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region 1752 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region
1753 m_CameraCenter = 1753 m_CameraCenter =
1754 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); 1754 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z);
1755 1755
1756 1756
1757 m_godlevel = cAgentData.godlevel; 1757 m_godlevel = cAgentData.godlevel;
1758 SetHeight(cAgentData.AVHeight); 1758 SetHeight(cAgentData.AVHeight);
@@ -1793,8 +1793,8 @@ namespace OpenSim.Region.Environment.Scenes
1793 } 1793 }
1794 catch (NullReferenceException) 1794 catch (NullReferenceException)
1795 { 1795 {
1796 // Under extreme load, this returns a NullReference Exception that we can ignore. 1796 // Under extreme load, this returns a NullReference Exception that we can ignore.
1797 // Ignoring this causes no movement to be sent to the physics engine... 1797 // Ignoring this causes no movement to be sent to the physics engine...
1798 // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter! 1798 // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter!
1799 } 1799 }
1800 m_newForce = true; 1800 m_newForce = true;
@@ -1809,12 +1809,12 @@ namespace OpenSim.Region.Environment.Scenes
1809 1809
1810 static ScenePresence() 1810 static ScenePresence()
1811 { 1811 {
1812 1812
1813 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 1813 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
1814 DefaultTexture = textu.ToBytes(); 1814 DefaultTexture = textu.ToBytes();
1815 } 1815 }
1816 1816
1817 [Serializable] 1817 [Serializable]
1818 public class NewForce 1818 public class NewForce
1819 { 1819 {
1820 public float X; 1820 public float X;
@@ -1826,8 +1826,8 @@ namespace OpenSim.Region.Environment.Scenes
1826 } 1826 }
1827 } 1827 }
1828 1828
1829 [Serializable] 1829 [Serializable]
1830 public class ScenePartUpdate : ISerializable 1830 public class ScenePartUpdate : ISerializable
1831 { 1831 {
1832 public LLUUID FullID; 1832 public LLUUID FullID;
1833 public uint LastFullUpdateTime; 1833 public uint LastFullUpdateTime;
@@ -1883,7 +1883,7 @@ namespace OpenSim.Region.Environment.Scenes
1883 public void AddToPhysicalScene() 1883 public void AddToPhysicalScene()
1884 { 1884 {
1885 PhysicsScene scene = m_scene.PhysicsScene; 1885 PhysicsScene scene = m_scene.PhysicsScene;
1886 1886
1887 PhysicsVector pVec = 1887 PhysicsVector pVec =
1888 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 1888 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
1889 AbsolutePosition.Z); 1889 AbsolutePosition.Z);
@@ -1936,7 +1936,7 @@ namespace OpenSim.Region.Environment.Scenes
1936 if (m_health <= 0) 1936 if (m_health <= 0)
1937 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 1937 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
1938 } 1938 }
1939 1939
1940 if (Velocity.X > 0 || Velocity.Y > 0) 1940 if (Velocity.X > 0 || Velocity.Y > 0)
1941 UpdateMovementAnimations(); 1941 UpdateMovementAnimations();
1942 } 1942 }
@@ -2161,7 +2161,7 @@ namespace OpenSim.Region.Environment.Scenes
2161 // m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue)); 2161 // m_partsUpdateQueue = (UpdateQueue)info.GetValue("m_partsUpdateQueue", typeof(UpdateQueue));
2162 2162
2163 /* 2163 /*
2164 Dictionary<Guid, ScenePartUpdate> updateTimes_work 2164 Dictionary<Guid, ScenePartUpdate> updateTimes_work
2165 = (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>)); 2165 = (Dictionary<Guid, ScenePartUpdate>)info.GetValue("m_updateTimes", typeof(Dictionary<Guid, ScenePartUpdate>));
2166 2166
2167 foreach (Guid id in updateTimes_work.Keys) 2167 foreach (Guid id in updateTimes_work.Keys)
@@ -2188,7 +2188,7 @@ namespace OpenSim.Region.Environment.Scenes
2188 (float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)), 2188 (float)info.GetValue("lastKnownAllowedPosition.X", typeof(float)),
2189 (float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)), 2189 (float)info.GetValue("lastKnownAllowedPosition.Y", typeof(float)),
2190 (float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float))); 2190 (float)info.GetValue("lastKnownAllowedPosition.Z", typeof(float)));
2191 2191
2192 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool)); 2192 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool));
2193 2193
2194 m_LastChildAgentUpdatePosition 2194 m_LastChildAgentUpdatePosition
@@ -2196,7 +2196,7 @@ namespace OpenSim.Region.Environment.Scenes
2196 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)), 2196 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)),
2197 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)), 2197 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)),
2198 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float))); 2198 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float)));
2199 2199
2200 m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int)); 2200 m_perfMonMS = (int)info.GetValue("m_perfMonMS", typeof(int));
2201 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint)); 2201 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint));
2202 2202
@@ -2246,7 +2246,7 @@ namespace OpenSim.Region.Environment.Scenes
2246 info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight); 2246 info.AddValue("m_sitAvatarHeight", m_sitAvatarHeight);
2247 info.AddValue("m_godlevel", m_godlevel); 2247 info.AddValue("m_godlevel", m_godlevel);
2248 info.AddValue("m_setAlwaysRun", m_setAlwaysRun); 2248 info.AddValue("m_setAlwaysRun", m_setAlwaysRun);
2249 2249
2250 // Quaternion 2250 // Quaternion
2251 info.AddValue("m_bodyRot.w", m_bodyRot.w); 2251 info.AddValue("m_bodyRot.w", m_bodyRot.w);
2252 info.AddValue("m_bodyRot.x", m_bodyRot.x); 2252 info.AddValue("m_bodyRot.x", m_bodyRot.x);
@@ -2374,7 +2374,7 @@ namespace OpenSim.Region.Environment.Scenes
2374 2374
2375 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID) 2375 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID)
2376 { 2376 {
2377 2377
2378 ScriptControllers obj = new ScriptControllers(); 2378 ScriptControllers obj = new ScriptControllers();
2379 obj.ignoreControls = ScriptControlled.CONTROL_ZERO; 2379 obj.ignoreControls = ScriptControlled.CONTROL_ZERO;
2380 obj.eventControls = ScriptControlled.CONTROL_ZERO; 2380 obj.eventControls = ScriptControlled.CONTROL_ZERO;
@@ -2386,7 +2386,7 @@ namespace OpenSim.Region.Environment.Scenes
2386 IgnoredControls |= (ScriptControlled)controls; 2386 IgnoredControls |= (ScriptControlled)controls;
2387 obj.ignoreControls = (ScriptControlled)controls; 2387 obj.ignoreControls = (ScriptControlled)controls;
2388 } 2388 }
2389 2389
2390 if (pass_on == 0 && accept == 1) 2390 if (pass_on == 0 && accept == 1)
2391 { 2391 {
2392 IgnoredControls |= (ScriptControlled)controls; 2392 IgnoredControls |= (ScriptControlled)controls;
@@ -2432,7 +2432,7 @@ namespace OpenSim.Region.Environment.Scenes
2432 lock (scriptedcontrols) 2432 lock (scriptedcontrols)
2433 { 2433 {
2434 scriptedcontrols.Clear(); 2434 scriptedcontrols.Clear();
2435 } 2435 }
2436 ControllingClient.SendTakeControls(int.MaxValue, false, false); 2436 ControllingClient.SendTakeControls(int.MaxValue, false, false);
2437 } 2437 }
2438 2438
@@ -2454,7 +2454,7 @@ namespace OpenSim.Region.Environment.Scenes
2454 2454
2455 internal void SendControlToScripts(uint flags, ScriptControlled lastFlags) 2455 internal void SendControlToScripts(uint flags, ScriptControlled lastFlags)
2456 { 2456 {
2457 2457
2458 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; 2458 ScriptControlled allflags = ScriptControlled.CONTROL_ZERO;
2459 2459
2460 if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) 2460 if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0)
@@ -2497,10 +2497,10 @@ namespace OpenSim.Region.Environment.Scenes
2497 { 2497 {
2498 allflags |= ScriptControlled.CONTROL_LBUTTON; 2498 allflags |= ScriptControlled.CONTROL_LBUTTON;
2499 } 2499 }
2500 2500
2501 ScriptControlled held = ScriptControlled.CONTROL_ZERO; 2501 ScriptControlled held = ScriptControlled.CONTROL_ZERO;
2502 ScriptControlled change = ScriptControlled.CONTROL_ZERO; 2502 ScriptControlled change = ScriptControlled.CONTROL_ZERO;
2503 2503
2504 foreach (ScriptControlled DCF in Enum.GetValues(typeof (ScriptControlled))) 2504 foreach (ScriptControlled DCF in Enum.GetValues(typeof (ScriptControlled)))
2505 { 2505 {
2506 // Held 2506 // Held
@@ -2539,7 +2539,7 @@ namespace OpenSim.Region.Environment.Scenes
2539 } 2539 }
2540 } 2540 }
2541 LastCommands = allflags; 2541 LastCommands = allflags;
2542 2542
2543 } 2543 }
2544 internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) 2544 internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored)
2545 { 2545 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
index 8390f64..7d048a3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes
70 obj.ResetIDs(); 70 obj.ResetIDs();
71 } 71 }
72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes 72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes
73 //obj.RegenerateFullIDs(); 73 //obj.RegenerateFullIDs();
74 m_innerScene.AddEntity(obj); 74 m_innerScene.AddEntity(obj);
75 75
76 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 76 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes
143 { 143 {
144 XmlDocument doc = new XmlDocument(); 144 XmlDocument doc = new XmlDocument();
145 XmlNode rootNode; 145 XmlNode rootNode;
146 146
147 XmlTextReader reader = new XmlTextReader(new StringReader(xmlString)); 147 XmlTextReader reader = new XmlTextReader(new StringReader(xmlString));
148 reader.WhitespaceHandling = WhitespaceHandling.None; 148 reader.WhitespaceHandling = WhitespaceHandling.None;
149 doc.Load(reader); 149 doc.Load(reader);
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
153 { 153 {
154 CreatePrimFromXml(aPrimNode.OuterXml); 154 CreatePrimFromXml(aPrimNode.OuterXml);
155 } 155 }
156 156
157 } 157 }
158 158
159 public void LoadPrimsFromXml2(string fileName) 159 public void LoadPrimsFromXml2(string fileName)
@@ -206,7 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
206 rootPart.PhysActor.LocalID = rootPart.LocalId; 206 rootPart.PhysActor.LocalID = rootPart.LocalId;
207 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 207 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
208 } 208 }
209 rootPart.Velocity = receivedVelocity; 209 rootPart.Velocity = receivedVelocity;
210 } 210 }
211 211
212 obj.ScheduleGroupForFullUpdate(); 212 obj.ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index a150164..90a971f 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -97,12 +97,12 @@ namespace OpenSim.Region.Environment.Scenes
97 private int m_scriptLinesPerSecond = 0; 97 private int m_scriptLinesPerSecond = 0;
98 98
99 private int objectCapacity = 45000; 99 private int objectCapacity = 45000;
100 100
101 101
102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21]; 102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21];
103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
105 105
106 106
107 private RegionInfo ReportingRegion; 107 private RegionInfo ReportingRegion;
108 108
@@ -138,8 +138,8 @@ namespace OpenSim.Region.Environment.Scenes
138 lock (m_report) 138 lock (m_report)
139 { 139 {
140 // Packet is already initialized and ready for data insert 140 // Packet is already initialized and ready for data insert
141 141
142 142
143 statpack.Region = rb; 143 statpack.Region = rb;
144 statpack.Region.RegionX = ReportingRegion.RegionLocX; 144 statpack.Region.RegionX = ReportingRegion.RegionLocX;
145 statpack.Region.RegionY = ReportingRegion.RegionLocY; 145 statpack.Region.RegionY = ReportingRegion.RegionLocY;
@@ -152,99 +152,99 @@ namespace OpenSim.Region.Environment.Scenes
152 statpack.Region.RegionFlags = (uint) 0; 152 statpack.Region.RegionFlags = (uint) 0;
153 } 153 }
154 statpack.Region.ObjectCapacity = (uint) objectCapacity; 154 statpack.Region.ObjectCapacity = (uint) objectCapacity;
155 155
156#region various statistic googly moogly 156#region various statistic googly moogly
157 157
158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there 158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
159 // 0-50 is pretty close to 0-45 159 // 0-50 is pretty close to 0-45
160 float simfps = (int) ((m_fps * 5)); 160 float simfps = (int) ((m_fps * 5));
161 161
162 //if (simfps > 45) 162 //if (simfps > 45)
163 //simfps = simfps - (simfps - 45); 163 //simfps = simfps - (simfps - 45);
164 //if (simfps < 0) 164 //if (simfps < 0)
165 //simfps = 0; 165 //simfps = 0;
166 166
167 // 167 //
168 float physfps = ((m_pfps / 1000)); 168 float physfps = ((m_pfps / 1000));
169 169
170 //if (physfps > 600) 170 //if (physfps > 600)
171 //physfps = physfps - (physfps - 600); 171 //physfps = physfps - (physfps - 600);
172 172
173 if (physfps < 0) 173 if (physfps < 0)
174 physfps = 0; 174 physfps = 0;
175 175
176#endregion 176#endregion
177 177
178 //Our time dilation is 0.91 when we're running a full speed, 178 //Our time dilation is 0.91 when we're running a full speed,
179 // therefore to make sure we get an appropriate range, 179 // therefore to make sure we get an appropriate range,
180 // we have to factor in our error. (0.10f * statsUpdateFactor) 180 // we have to factor in our error. (0.10f * statsUpdateFactor)
181 // multiplies the fix for the error times the amount of times it'll occur a second 181 // multiplies the fix for the error times the amount of times it'll occur a second
182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps) 182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps)
183 // Then we divide the whole amount by the amount of seconds pass in between stats updates. 183 // Then we divide the whole amount by the amount of seconds pass in between stats updates.
184 184
185 sb[0].StatID = (uint) Stats.TimeDilation; 185 sb[0].StatID = (uint) Stats.TimeDilation;
186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); 186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
187 187
188 sb[1].StatID = (uint) Stats.SimFPS; 188 sb[1].StatID = (uint) Stats.SimFPS;
189 sb[1].StatValue = simfps/statsUpdateFactor; 189 sb[1].StatValue = simfps/statsUpdateFactor;
190 190
191 sb[2].StatID = (uint) Stats.PhysicsFPS; 191 sb[2].StatID = (uint) Stats.PhysicsFPS;
192 sb[2].StatValue = physfps / statsUpdateFactor; 192 sb[2].StatValue = physfps / statsUpdateFactor;
193 193
194 sb[3].StatID = (uint) Stats.AgentUpdates; 194 sb[3].StatID = (uint) Stats.AgentUpdates;
195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor); 195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor);
196 196
197 sb[4].StatID = (uint) Stats.Agents; 197 sb[4].StatID = (uint) Stats.Agents;
198 sb[4].StatValue = m_rootAgents; 198 sb[4].StatValue = m_rootAgents;
199 199
200 sb[5].StatID = (uint) Stats.ChildAgents; 200 sb[5].StatID = (uint) Stats.ChildAgents;
201 sb[5].StatValue = m_childAgents; 201 sb[5].StatValue = m_childAgents;
202 202
203 sb[6].StatID = (uint) Stats.TotalPrim; 203 sb[6].StatID = (uint) Stats.TotalPrim;
204 sb[6].StatValue = m_numPrim; 204 sb[6].StatValue = m_numPrim;
205 205
206 sb[7].StatID = (uint) Stats.ActivePrim; 206 sb[7].StatID = (uint) Stats.ActivePrim;
207 sb[7].StatValue = m_activePrim; 207 sb[7].StatValue = m_activePrim;
208 208
209 sb[8].StatID = (uint)Stats.FrameMS; 209 sb[8].StatID = (uint)Stats.FrameMS;
210 sb[8].StatValue = m_frameMS / statsUpdateFactor; 210 sb[8].StatValue = m_frameMS / statsUpdateFactor;
211 211
212 sb[9].StatID = (uint)Stats.NetMS; 212 sb[9].StatID = (uint)Stats.NetMS;
213 sb[9].StatValue = m_netMS / statsUpdateFactor; 213 sb[9].StatValue = m_netMS / statsUpdateFactor;
214 214
215 sb[10].StatID = (uint)Stats.PhysicsMS; 215 sb[10].StatID = (uint)Stats.PhysicsMS;
216 sb[10].StatValue = m_physicsMS / statsUpdateFactor; 216 sb[10].StatValue = m_physicsMS / statsUpdateFactor;
217 217
218 sb[11].StatID = (uint)Stats.ImageMS ; 218 sb[11].StatID = (uint)Stats.ImageMS ;
219 sb[11].StatValue = m_imageMS / statsUpdateFactor; 219 sb[11].StatValue = m_imageMS / statsUpdateFactor;
220 220
221 sb[12].StatID = (uint)Stats.OtherMS; 221 sb[12].StatID = (uint)Stats.OtherMS;
222 sb[12].StatValue = m_otherMS / statsUpdateFactor; 222 sb[12].StatValue = m_otherMS / statsUpdateFactor;
223 223
224 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 224 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
225 sb[13].StatValue = (m_inPacketsPerSecond); 225 sb[13].StatValue = (m_inPacketsPerSecond);
226 226
227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond; 227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond;
228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); 228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
229 229
230 sb[15].StatID = (uint)Stats.UnAckedBytes; 230 sb[15].StatID = (uint)Stats.UnAckedBytes;
231 sb[15].StatValue = m_unAckedBytes; 231 sb[15].StatValue = m_unAckedBytes;
232 232
233 sb[16].StatID = (uint)Stats.AgentMS; 233 sb[16].StatID = (uint)Stats.AgentMS;
234 sb[16].StatValue = m_agentMS / statsUpdateFactor; 234 sb[16].StatValue = m_agentMS / statsUpdateFactor;
235 235
236 sb[17].StatID = (uint)Stats.PendingDownloads; 236 sb[17].StatID = (uint)Stats.PendingDownloads;
237 sb[17].StatValue = m_pendingDownloads; 237 sb[17].StatValue = m_pendingDownloads;
238 238
239 sb[18].StatID = (uint)Stats.PendingUploads; 239 sb[18].StatID = (uint)Stats.PendingUploads;
240 sb[18].StatValue = m_pendingUploads; 240 sb[18].StatValue = m_pendingUploads;
241 241
242 sb[19].StatID = (uint)Stats.ActiveScripts; 242 sb[19].StatID = (uint)Stats.ActiveScripts;
243 sb[19].StatValue = m_activeScripts; 243 sb[19].StatValue = m_activeScripts;
244 244
245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; 245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; 246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
247 247
248 statpack.Stat = sb; 248 statpack.Stat = sb;
249 249
250 handlerSendStatResult = OnSendStatsResult; 250 handlerSendStatResult = OnSendStatsResult;
@@ -255,7 +255,7 @@ namespace OpenSim.Region.Environment.Scenes
255 resetvalues(); 255 resetvalues();
256 } 256 }
257 } 257 }
258 258
259 private void resetvalues() 259 private void resetvalues()
260 { 260 {
261 m_timeDilation = 0; 261 m_timeDilation = 0;
@@ -274,13 +274,13 @@ namespace OpenSim.Region.Environment.Scenes
274 m_imageMS = 0; 274 m_imageMS = 0;
275 m_otherMS = 0; 275 m_otherMS = 0;
276 276
277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used. 277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
278//Ckrinke m_scriptMS = 0; 278//Ckrinke m_scriptMS = 0;
279 } 279 }
280 280
281 # region methods called from Scene 281 # region methods called from Scene
282 // The majority of these functions are additive 282 // The majority of these functions are additive
283 // so that you can easily change the amount of 283 // so that you can easily change the amount of
284 // seconds in between sim stats updates 284 // seconds in between sim stats updates
285 285
286 public void AddTimeDilation(float td) 286 public void AddTimeDilation(float td)
@@ -368,14 +368,14 @@ namespace OpenSim.Region.Environment.Scenes
368 { 368 {
369 m_otherMS += ms; 369 m_otherMS += ms;
370 } 370 }
371 371
372// private static readonly log4net.ILog m_log 372// private static readonly log4net.ILog m_log
373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
374 374
375 public void addPendingDownload(int count) 375 public void addPendingDownload(int count)
376 { 376 {
377 m_pendingDownloads += count; 377 m_pendingDownloads += count;
378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); 378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads);
379 } 379 }
380 380
381 public void addScriptLines(int count) 381 public void addScriptLines(int count)
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs
index ec1ffd2..e9133ac 100644
--- a/OpenSim/Region/Environment/Types/UpdateQueue.cs
+++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs
@@ -34,8 +34,8 @@ using OpenSim.Region.Environment.Scenes;
34 34
35namespace OpenSim.Region.Environment.Types 35namespace OpenSim.Region.Environment.Types
36{ 36{
37 [Serializable] 37 [Serializable]
38 public class UpdateQueue : ISerializable 38 public class UpdateQueue : ISerializable
39 { 39 {
40 private Queue<SceneObjectPart> m_queue; 40 private Queue<SceneObjectPart> m_queue;
41 41