aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs88
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs9
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs19
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityManager.cs69
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/IMesher.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs6
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs4
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs45
18 files changed, 166 insertions, 151 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 1c463ea..b027882 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -321,12 +321,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
321 private readonly IGroupsModule m_GroupsModule; 321 private readonly IGroupsModule m_GroupsModule;
322 322
323 private int m_cachedTextureSerial; 323 private int m_cachedTextureSerial;
324 private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates = 324 private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates;
325 new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); 325 private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates;
326 private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates = 326 private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates;
327 new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
328 private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates =
329 new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>();
330 private int m_moneyBalance; 327 private int m_moneyBalance;
331 private int m_animationSequenceNumber = 1; 328 private int m_animationSequenceNumber = 1;
332 private bool m_SendLogoutPacketWhenClosing = true; 329 private bool m_SendLogoutPacketWhenClosing = true;
@@ -335,7 +332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
335 332
336 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); 333 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>();
337 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers 334 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
338 protected IScene m_scene; 335 protected Scene m_scene;
339 protected LLImageManager m_imageManager; 336 protected LLImageManager m_imageManager;
340 protected string m_firstName; 337 protected string m_firstName;
341 protected string m_lastName; 338 protected string m_lastName;
@@ -408,16 +405,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
408 /// <summary> 405 /// <summary>
409 /// Constructor 406 /// Constructor
410 /// </summary> 407 /// </summary>
411 public LLClientView(EndPoint remoteEP, IScene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, 408 public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
412 UUID agentId, UUID sessionId, uint circuitCode) 409 UUID agentId, UUID sessionId, uint circuitCode)
413 { 410 {
414 RegisterInterface<IClientIM>(this); 411 RegisterInterface<IClientIM>(this);
415 RegisterInterface<IClientChat>(this); 412 RegisterInterface<IClientChat>(this);
416 RegisterInterface<IClientIPEndpoint>(this); 413 RegisterInterface<IClientIPEndpoint>(this);
417 414
418 InitDefaultAnimations(); 415 InitDefaultAnimations();
419 416
420 m_scene = scene; 417 m_scene = scene;
418
419 m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
420 m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
421 m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count);
422
421 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 423 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
422 m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); 424 m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
423 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 425 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
@@ -3288,10 +3290,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3288 } 3290 }
3289 3291
3290 Quaternion rotation = data.Rotation; 3292 Quaternion rotation = data.Rotation;
3291 3293 if (rotation.W == 0.0f && rotation.X == 0.0f && rotation.Y == 0.0f && rotation.Z == 0.0f)
3292 if (rotation.X == rotation.Y &&
3293 rotation.Y == rotation.Z &&
3294 rotation.Z == rotation.W && rotation.W == 0.0f)
3295 rotation = Quaternion.Identity; 3294 rotation = Quaternion.Identity;
3296 3295
3297 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateImprovedTerseBlock(data); 3296 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateImprovedTerseBlock(data);
@@ -3377,15 +3376,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3377 } 3376 }
3378 3377
3379 Quaternion rotation = data.rotation; 3378 Quaternion rotation = data.rotation;
3379 if (rotation.W == 0.0f && rotation.X == 0.0f && rotation.Y == 0.0f && rotation.Z == 0.0f)
3380 rotation = Quaternion.Identity;
3380 3381
3381 if (data.AttachPoint > 30 && data.ownerID != AgentId) // Someone else's HUD 3382 if (data.AttachPoint > 30 && data.ownerID != AgentId) // Someone else's HUD
3382 return; 3383 return;
3383 if (data.primShape.PCode == 9 && data.primShape.State != 0 && data.parentID == 0) 3384 if (data.primShape.State != 0 && data.parentID == 0 && data.primShape.PCode == 9)
3384 return; 3385 return;
3385 3386
3386 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0.0f)
3387 rotation = Quaternion.Identity;
3388
3389 ObjectUpdatePacket.ObjectDataBlock objectData = CreatePrimUpdateBlock(data); 3387 ObjectUpdatePacket.ObjectDataBlock objectData = CreatePrimUpdateBlock(data);
3390 3388
3391 lock (m_primFullUpdates.SyncRoot) 3389 lock (m_primFullUpdates.SyncRoot)
@@ -3397,7 +3395,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3397 ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); 3395 ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
3398 outPacket.Header.Zerocoded = true; 3396 outPacket.Header.Zerocoded = true;
3399 3397
3400 //outPacket.RegionData = new ObjectUpdatePacket.RegionDataBlock();
3401 outPacket.RegionData.RegionHandle = Scene.RegionInfo.RegionHandle; 3398 outPacket.RegionData.RegionHandle = Scene.RegionInfo.RegionHandle;
3402 outPacket.RegionData.TimeDilation = (ushort)(Scene.TimeDilation * ushort.MaxValue); 3399 outPacket.RegionData.TimeDilation = (ushort)(Scene.TimeDilation * ushort.MaxValue);
3403 3400
@@ -3424,13 +3421,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3424 } 3421 }
3425 3422
3426 Quaternion rotation = data.Rotation; 3423 Quaternion rotation = data.Rotation;
3424 if (rotation.W == 0.0f && rotation.X == 0.0f && rotation.Y == 0.0f && rotation.Z == 0.0f)
3425 rotation = Quaternion.Identity;
3427 3426
3428 if (data.AttachPoint > 30 && data.OwnerID != AgentId) // Someone else's HUD 3427 if (data.AttachPoint > 30 && data.OwnerID != AgentId) // Someone else's HUD
3429 return; 3428 return;
3430 3429
3431 if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0)
3432 rotation = Quaternion.Identity;
3433
3434 ImprovedTerseObjectUpdatePacket.ObjectDataBlock objectData = CreateImprovedTerseBlock(data); 3430 ImprovedTerseObjectUpdatePacket.ObjectDataBlock objectData = CreateImprovedTerseBlock(data);
3435 3431
3436 lock (m_primTerseUpdates.SyncRoot) 3432 lock (m_primTerseUpdates.SyncRoot)
@@ -10238,10 +10234,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10238 { 10234 {
10239 internal delegate bool UpdatePriorityHandler(ref TPriority priority, uint local_id); 10235 internal delegate bool UpdatePriorityHandler(ref TPriority priority, uint local_id);
10240 10236
10241 private MinHeap<MinHeapItem>[] heaps = new MinHeap<MinHeapItem>[1]; 10237 private MinHeap<MinHeapItem>[] m_heaps = new MinHeap<MinHeapItem>[1];
10242 private Dictionary<uint, LookupItem> lookup_table = new Dictionary<uint, LookupItem>(); 10238 private Dictionary<uint, LookupItem> m_lookupTable;
10243 private Comparison<TPriority> comparison; 10239 private Comparison<TPriority> m_comparison;
10244 private object sync_root = new object(); 10240 private object m_syncRoot = new object();
10245 10241
10246 internal PriorityQueue() : 10242 internal PriorityQueue() :
10247 this(MinHeap<MinHeapItem>.DEFAULT_CAPACITY, Comparer<TPriority>.Default) { } 10243 this(MinHeap<MinHeapItem>.DEFAULT_CAPACITY, Comparer<TPriority>.Default) { }
@@ -10255,19 +10251,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10255 this(capacity, new Comparison<TPriority>(comparer.Compare)) { } 10251 this(capacity, new Comparison<TPriority>(comparer.Compare)) { }
10256 internal PriorityQueue(int capacity, Comparison<TPriority> comparison) 10252 internal PriorityQueue(int capacity, Comparison<TPriority> comparison)
10257 { 10253 {
10258 for (int i = 0; i < heaps.Length; ++i) 10254 m_lookupTable = new Dictionary<uint, LookupItem>(capacity);
10259 heaps[i] = new MinHeap<MinHeapItem>(capacity); 10255
10260 this.comparison = comparison; 10256 for (int i = 0; i < m_heaps.Length; ++i)
10257 m_heaps[i] = new MinHeap<MinHeapItem>(capacity);
10258 this.m_comparison = comparison;
10261 } 10259 }
10262 10260
10263 internal object SyncRoot { get { return this.sync_root; } } 10261 internal object SyncRoot { get { return this.m_syncRoot; } }
10264 internal int Count 10262 internal int Count
10265 { 10263 {
10266 get 10264 get
10267 { 10265 {
10268 int count = 0; 10266 int count = 0;
10269 for (int i = 0; i < heaps.Length; ++i) 10267 for (int i = 0; i < m_heaps.Length; ++i)
10270 count = heaps[i].Count; 10268 count = m_heaps[i].Count;
10271 return count; 10269 return count;
10272 } 10270 }
10273 } 10271 }
@@ -10276,36 +10274,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10276 { 10274 {
10277 LookupItem item; 10275 LookupItem item;
10278 10276
10279 if (lookup_table.TryGetValue(local_id, out item)) 10277 if (m_lookupTable.TryGetValue(local_id, out item))
10280 { 10278 {
10281 item.Heap[item.Handle] = new MinHeapItem(priority, value, local_id, this.comparison); 10279 item.Heap[item.Handle] = new MinHeapItem(priority, value, local_id, this.m_comparison);
10282 return false; 10280 return false;
10283 } 10281 }
10284 else 10282 else
10285 { 10283 {
10286 item.Heap = heaps[0]; 10284 item.Heap = m_heaps[0];
10287 item.Heap.Add(new MinHeapItem(priority, value, local_id, this.comparison), ref item.Handle); 10285 item.Heap.Add(new MinHeapItem(priority, value, local_id, this.m_comparison), ref item.Handle);
10288 lookup_table.Add(local_id, item); 10286 m_lookupTable.Add(local_id, item);
10289 return true; 10287 return true;
10290 } 10288 }
10291 } 10289 }
10292 10290
10293 internal TValue Peek() 10291 internal TValue Peek()
10294 { 10292 {
10295 for (int i = 0; i < heaps.Length; ++i) 10293 for (int i = 0; i < m_heaps.Length; ++i)
10296 if (heaps[i].Count > 0) 10294 if (m_heaps[i].Count > 0)
10297 return heaps[i].Min().Value; 10295 return m_heaps[i].Min().Value;
10298 throw new InvalidOperationException(string.Format("The {0} is empty", this.GetType().ToString())); 10296 throw new InvalidOperationException(string.Format("The {0} is empty", this.GetType().ToString()));
10299 } 10297 }
10300 10298
10301 internal TValue Dequeue() 10299 internal TValue Dequeue()
10302 { 10300 {
10303 for (int i = 0; i < heaps.Length; ++i) 10301 for (int i = 0; i < m_heaps.Length; ++i)
10304 { 10302 {
10305 if (heaps[i].Count > 0) 10303 if (m_heaps[i].Count > 0)
10306 { 10304 {
10307 MinHeapItem item = heaps[i].RemoveMin(); 10305 MinHeapItem item = m_heaps[i].RemoveMin();
10308 lookup_table.Remove(item.LocalID); 10306 m_lookupTable.Remove(item.LocalID);
10309 return item.Value; 10307 return item.Value;
10310 } 10308 }
10311 } 10309 }
@@ -10317,7 +10315,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10317 MinHeapItem item; 10315 MinHeapItem item;
10318 TPriority priority; 10316 TPriority priority;
10319 10317
10320 foreach (LookupItem lookup in new List<LookupItem>(this.lookup_table.Values)) 10318 foreach (LookupItem lookup in new List<LookupItem>(this.m_lookupTable.Values))
10321 { 10319 {
10322 if (lookup.Heap.TryGetValue(lookup.Handle, out item)) 10320 if (lookup.Heap.TryGetValue(lookup.Handle, out item))
10323 { 10321 {
@@ -10332,7 +10330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10332 { 10330 {
10333 m_log.Warn("[LLCLIENTVIEW]: UpdatePriorityHandler returned false, dropping update"); 10331 m_log.Warn("[LLCLIENTVIEW]: UpdatePriorityHandler returned false, dropping update");
10334 lookup.Heap.Remove(lookup.Handle); 10332 lookup.Heap.Remove(lookup.Handle);
10335 this.lookup_table.Remove(item.LocalID); 10333 this.m_lookupTable.Remove(item.LocalID);
10336 } 10334 }
10337 } 10335 }
10338 } 10336 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index d25bf95..938cf50 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -51,7 +51,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
51 51
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private bool m_shuttingdown; 53 private bool m_shuttingdown;
54 private long m_lastloopprocessed;
55 private AssetBase m_missingImage; 54 private AssetBase m_missingImage;
56 private LLClientView m_client; //Client we're assigned to 55 private LLClientView m_client; //Client we're assigned to
57 private IAssetService m_assetCache; //Asset Cache 56 private IAssetService m_assetCache; //Asset Cache
@@ -169,7 +168,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
169 168
170 public bool ProcessImageQueue(int packetsToSend) 169 public bool ProcessImageQueue(int packetsToSend)
171 { 170 {
172 m_lastloopprocessed = DateTime.Now.Ticks;
173 int packetsSent = 0; 171 int packetsSent = 0;
174 172
175 while (packetsSent < packetsToSend) 173 while (packetsSent < packetsToSend)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 9476eed..4b6a358 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -506,8 +506,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
506 /// for</param> 506 /// for</param>
507 private void BeginFireQueueEmpty(int throttleIndex) 507 private void BeginFireQueueEmpty(int throttleIndex)
508 { 508 {
509 if (!m_onQueueEmptyRunning[throttleIndex]) 509 // Unknown is -1 and Resend is 0. Make sure we are only firing the
510 Util.FireAndForget(FireQueueEmpty, throttleIndex); 510 // callback for categories other than those
511 if (throttleIndex > 0)
512 {
513 if (!m_onQueueEmptyRunning[throttleIndex])
514 Util.FireAndForget(FireQueueEmpty, throttleIndex);
515 }
511 } 516 }
512 517
513 /// <summary> 518 /// <summary>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 66e1468..74175d0 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
107 /// <summary>Manages authentication for agent circuits</summary> 107 /// <summary>Manages authentication for agent circuits</summary>
108 private AgentCircuitManager m_circuitManager; 108 private AgentCircuitManager m_circuitManager;
109 /// <summary>Reference to the scene this UDP server is attached to</summary> 109 /// <summary>Reference to the scene this UDP server is attached to</summary>
110 private IScene m_scene; 110 private Scene m_scene;
111 /// <summary>The X/Y coordinates of the scene this UDP server is attached to</summary> 111 /// <summary>The X/Y coordinates of the scene this UDP server is attached to</summary>
112 private Location m_location; 112 private Location m_location;
113 /// <summary>The measured resolution of Environment.TickCount</summary> 113 /// <summary>The measured resolution of Environment.TickCount</summary>
@@ -184,15 +184,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
184 184
185 public void AddScene(IScene scene) 185 public void AddScene(IScene scene)
186 { 186 {
187 if (m_scene == null) 187 if (m_scene != null)
188 { 188 {
189 m_scene = scene; 189 m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene");
190 m_location = new Location(m_scene.RegionInfo.RegionHandle); 190 return;
191 } 191 }
192 else 192
193 if (!(scene is Scene))
193 { 194 {
194 m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); 195 m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType());
196 return;
195 } 197 }
198
199 m_scene = (Scene)scene;
200 m_location = new Location(m_scene.RegionInfo.RegionHandle);
196 } 201 }
197 202
198 public bool HandlesRegion(Location x) 203 public bool HandlesRegion(Location x)
@@ -794,7 +799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
794 elapsed500MS = 0; 799 elapsed500MS = 0;
795 } 800 }
796 801
797 m_scene.ClientManager.ForEach( 802 m_scene.ClientManager.ForEachSync(
798 delegate(IClientAPI client) 803 delegate(IClientAPI client)
799 { 804 {
800 if (client is LLClientView) 805 if (client is LLClientView)
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 4041b63..5ca4178 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -730,7 +730,7 @@ namespace Flotsam.RegionModules.AssetCache
730 int fileCount = GetFileCacheCount(m_CacheDirectory); 730 int fileCount = GetFileCacheCount(m_CacheDirectory);
731 m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount); 731 m_log.InfoFormat("[FLOTSAM ASSET CACHE] File Cache : {0} assets", fileCount);
732 732
733 foreach ( string s in Directory.GetFiles(m_CacheDirectory, "*.fac" ) ) 733 foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac"))
734 { 734 {
735 m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:"); 735 m_log.Info("[FLOTSAM ASSET CACHE] Deep Scans were performed on the following regions:");
736 736
@@ -770,7 +770,7 @@ namespace Flotsam.RegionModules.AssetCache
770 int assetsCached = CacheScenes(); 770 int assetsCached = CacheScenes();
771 m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached); 771 m_log.InfoFormat("[FLOTSAM ASSET CACHE] Completed Scene Caching, {0} assets found.", assetsCached);
772 772
773 }); 773 });
774 774
775 break; 775 break;
776 776
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 332d3ce..53c64cb 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -147,9 +147,10 @@ namespace OpenSim.Region.CoreModules.World.Land
147 client.OnParcelDwellRequest += ClientOnParcelDwellRequest; 147 client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
148 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; 148 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
149 149
150 if (m_scene.Entities.ContainsKey(client.AgentId)) 150 EntityBase presenceEntity;
151 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
151 { 152 {
152 SendLandUpdate((ScenePresence)m_scene.Entities[client.AgentId], true); 153 SendLandUpdate((ScenePresence)presenceEntity, true);
153 SendParcelOverlay(client); 154 SendParcelOverlay(client);
154 } 155 }
155 } 156 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index b9b7da5..bfe85f1 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -139,10 +139,8 @@ namespace OpenSim.Region.CoreModules.World.Land
139 } 139 }
140 else 140 else
141 { 141 {
142 //Normal Calculations 142 // Normal Calculations
143 return Convert.ToInt32( 143 return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.objectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
144 Math.Round((Convert.ToDecimal(LandData.Area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
145 Convert.ToDecimal(m_scene.RegionInfo.RegionSettings.ObjectBonus))); ;
146 } 144 }
147 } 145 }
148 public int GetSimulatorMaxPrimCount(ILandObject thisObject) 146 public int GetSimulatorMaxPrimCount(ILandObject thisObject)
diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs
index 0ceef39..099fcce 100644
--- a/OpenSim/Region/Framework/Scenes/EntityManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs
@@ -93,40 +93,31 @@ namespace OpenSim.Region.Framework.Scenes
93 { 93 {
94 get 94 get
95 { 95 {
96 lock (m_lock) 96 return m_eb_uuid.Count;
97 {
98 return m_eb_uuid.Count;
99 }
100 } 97 }
101 } 98 }
102 99
103 public bool ContainsKey(UUID id) 100 public bool ContainsKey(UUID id)
104 { 101 {
105 lock (m_lock) 102 try
106 { 103 {
107 try 104 return m_eb_uuid.ContainsKey(id);
108 { 105 }
109 return m_eb_uuid.ContainsKey(id); 106 catch
110 } 107 {
111 catch 108 return false;
112 {
113 return false;
114 }
115 } 109 }
116 } 110 }
117 111
118 public bool ContainsKey(uint localID) 112 public bool ContainsKey(uint localID)
119 { 113 {
120 lock (m_lock) 114 try
121 { 115 {
122 try 116 return m_eb_localID.ContainsKey(localID);
123 { 117 }
124 return m_eb_localID.ContainsKey(localID); 118 catch
125 } 119 {
126 catch 120 return false;
127 {
128 return false;
129 }
130 } 121 }
131 } 122 }
132 123
@@ -136,7 +127,11 @@ namespace OpenSim.Region.Framework.Scenes
136 { 127 {
137 try 128 try
138 { 129 {
139 bool a = m_eb_uuid.Remove(m_eb_localID[localID].UUID); 130 bool a = false;
131 EntityBase entity;
132 if (m_eb_localID.TryGetValue(localID, out entity))
133 a = m_eb_uuid.Remove(entity.UUID);
134
140 bool b = m_eb_localID.Remove(localID); 135 bool b = m_eb_localID.Remove(localID);
141 return a && b; 136 return a && b;
142 } 137 }
@@ -154,7 +149,11 @@ namespace OpenSim.Region.Framework.Scenes
154 { 149 {
155 try 150 try
156 { 151 {
157 bool a = m_eb_localID.Remove(m_eb_uuid[id].LocalId); 152 bool a = false;
153 EntityBase entity;
154 if (m_eb_uuid.TryGetValue(id, out entity))
155 a = m_eb_localID.Remove(entity.LocalId);
156
158 bool b = m_eb_uuid.Remove(id); 157 bool b = m_eb_uuid.Remove(id);
159 return a && b; 158 return a && b;
160 } 159 }
@@ -206,14 +205,11 @@ namespace OpenSim.Region.Framework.Scenes
206 { 205 {
207 lock (m_lock) 206 lock (m_lock)
208 { 207 {
209 try 208 EntityBase entity;
210 { 209 if (m_eb_uuid.TryGetValue(id, out entity))
211 return m_eb_uuid[id]; 210 return entity;
212 } 211 else
213 catch
214 {
215 return null; 212 return null;
216 }
217 } 213 }
218 } 214 }
219 set 215 set
@@ -228,14 +224,11 @@ namespace OpenSim.Region.Framework.Scenes
228 { 224 {
229 lock (m_lock) 225 lock (m_lock)
230 { 226 {
231 try 227 EntityBase entity;
232 { 228 if (m_eb_localID.TryGetValue(localID, out entity))
233 return m_eb_localID[localID]; 229 return entity;
234 } 230 else
235 catch
236 {
237 return null; 231 return null;
238 }
239 } 232 }
240 } 233 }
241 set 234 set
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index c44c4c7..c2b9e73 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2351,12 +2351,6 @@ namespace OpenSim.Region.Framework.Scenes
2351 item = InventoryService.GetItem(item); 2351 item = InventoryService.GetItem(item);
2352 2352
2353 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 2353 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
2354 IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
2355 if (ava != null)
2356 {
2357 ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2358 }
2359
2360 } 2354 }
2361 return att.UUID; 2355 return att.UUID;
2362 } 2356 }
@@ -2402,12 +2396,6 @@ namespace OpenSim.Region.Framework.Scenes
2402 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 2396 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
2403 item = InventoryService.GetItem(item); 2397 item = InventoryService.GetItem(item);
2404 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 2398 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
2405
2406 if (m_AvatarFactory != null)
2407 {
2408 m_log.InfoFormat("[SCENE INVENTORY]: Saving avatar attachment. AgentID:{0} ItemID:{1} AttachmentPoint:{2}", remoteClient.AgentId, itemID, AttachmentPt);
2409 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2410 }
2411 } 2399 }
2412 } 2400 }
2413 2401
@@ -2447,12 +2435,13 @@ namespace OpenSim.Region.Framework.Scenes
2447 if (TryGetAvatar(remoteClient.AgentId, out presence)) 2435 if (TryGetAvatar(remoteClient.AgentId, out presence))
2448 { 2436 {
2449 presence.Appearance.DetachAttachment(itemID); 2437 presence.Appearance.DetachAttachment(itemID);
2450 IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); 2438
2451 if (ava != null) 2439 // Save avatar attachment information
2440 if (m_AvatarFactory != null)
2452 { 2441 {
2453 ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 2442 m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID);
2443 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2454 } 2444 }
2455
2456 } 2445 }
2457 2446
2458 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); 2447 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 70b11c3..2dbc090 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -228,6 +228,10 @@ namespace OpenSim.Region.Framework.Scenes
228 protected IXMLRPC m_xmlrpcModule; 228 protected IXMLRPC m_xmlrpcModule;
229 protected IWorldComm m_worldCommModule; 229 protected IWorldComm m_worldCommModule;
230 protected IAvatarFactory m_AvatarFactory; 230 protected IAvatarFactory m_AvatarFactory;
231 public IAvatarFactory AvatarFactory
232 {
233 get { return m_AvatarFactory; }
234 }
231 protected IConfigSource m_config; 235 protected IConfigSource m_config;
232 protected IRegionSerialiserModule m_serialiser; 236 protected IRegionSerialiserModule m_serialiser;
233 protected IInterregionCommsOut m_interregionCommsOut; 237 protected IInterregionCommsOut m_interregionCommsOut;
@@ -1148,13 +1152,13 @@ namespace OpenSim.Region.Framework.Scenes
1148 1152
1149 public void AddGroupTarget(SceneObjectGroup grp) 1153 public void AddGroupTarget(SceneObjectGroup grp)
1150 { 1154 {
1151 lock(m_groupsWithTargets) 1155 lock (m_groupsWithTargets)
1152 m_groupsWithTargets[grp.UUID] = grp; 1156 m_groupsWithTargets[grp.UUID] = grp;
1153 } 1157 }
1154 1158
1155 public void RemoveGroupTarget(SceneObjectGroup grp) 1159 public void RemoveGroupTarget(SceneObjectGroup grp)
1156 { 1160 {
1157 lock(m_groupsWithTargets) 1161 lock (m_groupsWithTargets)
1158 m_groupsWithTargets.Remove(grp.UUID); 1162 m_groupsWithTargets.Remove(grp.UUID);
1159 } 1163 }
1160 1164
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 8ee26c3..e51f6ef 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -467,7 +467,6 @@ namespace OpenSim.Region.Framework.Scenes
467 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) 467 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
468 { 468 {
469 // If we can't take it, we can't attach it! 469 // If we can't take it, we can't attach it!
470 //
471 SceneObjectPart part = m_parentScene.GetSceneObjectPart(objectLocalID); 470 SceneObjectPart part = m_parentScene.GetSceneObjectPart(objectLocalID);
472 if (part == null) 471 if (part == null)
473 return; 472 return;
@@ -477,9 +476,16 @@ namespace OpenSim.Region.Framework.Scenes
477 return; 476 return;
478 477
479 // Calls attach with a Zero position 478 // Calls attach with a Zero position
480 //
481 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false); 479 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false);
482 m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); 480 m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
481
482 // Save avatar attachment information
483 ScenePresence presence;
484 if (m_parentScene.AvatarFactory != null && m_parentScene.TryGetAvatar(remoteClient.AgentId, out presence))
485 {
486 m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", AttachmentPoint: " + AttachmentPt);
487 m_parentScene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
488 }
483 } 489 }
484 490
485 public SceneObjectGroup RezSingleAttachment( 491 public SceneObjectGroup RezSingleAttachment(
@@ -574,7 +580,7 @@ namespace OpenSim.Region.Framework.Scenes
574 } 580 }
575 581
576 582
577 group.SetAttachmentPoint(Convert.ToByte(AttachmentPt)); 583 group.SetAttachmentPoint((byte)AttachmentPt);
578 group.AbsolutePosition = attachPos; 584 group.AbsolutePosition = attachPos;
579 585
580 // Saves and gets itemID 586 // Saves and gets itemID
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2153b9b..810dfd1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -899,7 +899,7 @@ namespace OpenSim.Region.Framework.Scenes
899 SetAttachmentPoint(Convert.ToByte(attachmentpoint)); 899 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
900 900
901 avatar.AddAttachment(this); 901 avatar.AddAttachment(this);
902 m_log.DebugFormat("[SOG]: Added att {0} to avie {1}", UUID, avatar.UUID); 902 m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
903 903
904 if (!silent) 904 if (!silent)
905 { 905 {
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs
index ac14292..1a8c948 100644
--- a/OpenSim/Region/Physics/Manager/IMesher.cs
+++ b/OpenSim/Region/Physics/Manager/IMesher.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Physics.Manager
48 int[] getIndexListAsIntLocked(); 48 int[] getIndexListAsIntLocked();
49 float[] getVertexListAsFloatLocked(); 49 float[] getVertexListAsFloatLocked();
50 void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); 50 void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount);
51 void getVertexListAsPtrToFloatArray( out IntPtr vertexList, out int vertexStride, out int vertexCount ); 51 void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount);
52 void releaseSourceMeshData(); 52 void releaseSourceMeshData();
53 void releasePinned(); 53 void releasePinned();
54 void Append(IMesh newMesh); 54 void Append(IMesh newMesh);
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index 94d926a..4c3cf33 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Physics.Meshing
70 throw new NotSupportedException("Attempt to Add to a pinned Mesh"); 70 throw new NotSupportedException("Attempt to Add to a pinned Mesh");
71 // If a vertex of the triangle is not yet in the vertices list, 71 // If a vertex of the triangle is not yet in the vertices list,
72 // add it and set its index to the current index count 72 // add it and set its index to the current index count
73 if( !m_vertices.ContainsKey(triangle.v1) ) 73 if (!m_vertices.ContainsKey(triangle.v1))
74 m_vertices[triangle.v1] = m_vertices.Count; 74 m_vertices[triangle.v1] = m_vertices.Count;
75 if (!m_vertices.ContainsKey(triangle.v2)) 75 if (!m_vertices.ContainsKey(triangle.v2))
76 m_vertices[triangle.v2] = m_vertices.Count; 76 m_vertices[triangle.v2] = m_vertices.Count;
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.Meshing
153 153
154 private float[] getVertexListAsFloat() 154 private float[] getVertexListAsFloat()
155 { 155 {
156 if(m_vertices == null) 156 if (m_vertices == null)
157 throw new NotSupportedException(); 157 throw new NotSupportedException();
158 float[] result = new float[m_vertices.Count * 3]; 158 float[] result = new float[m_vertices.Count * 3];
159 foreach (KeyValuePair<Vertex, int> kvp in m_vertices) 159 foreach (KeyValuePair<Vertex, int> kvp in m_vertices)
@@ -169,7 +169,7 @@ namespace OpenSim.Region.Physics.Meshing
169 169
170 public float[] getVertexListAsFloatLocked() 170 public float[] getVertexListAsFloatLocked()
171 { 171 {
172 if( m_pinnedVertexes.IsAllocated ) 172 if (m_pinnedVertexes.IsAllocated)
173 return (float[])(m_pinnedVertexes.Target); 173 return (float[])(m_pinnedVertexes.Target);
174 174
175 float[] result = getVertexListAsFloat(); 175 float[] result = getVertexListAsFloat();
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 496e097..63bfc90 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -816,8 +816,8 @@ namespace OpenSim.Region.Physics.OdePlugin
816 IntPtr vertices, indices; 816 IntPtr vertices, indices;
817 int vertexCount, indexCount; 817 int vertexCount, indexCount;
818 int vertexStride, triStride; 818 int vertexStride, triStride;
819 mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap 819 mesh.getVertexListAsPtrToFloatArray(out vertices, out vertexStride, out vertexCount); // Note, that vertices are fixed in unmanaged heap
820 mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage 820 mesh.getIndexListAsPtrToIntArray(out indices, out triStride, out indexCount); // Also fixed, needs release after usage
821 821
822 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory 822 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
823 823
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index aba3667..ba289f7 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -3809,7 +3809,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3809 } 3809 }
3810 3810
3811 public void start(int unused) 3811 public void start(int unused)
3812 { 3812 {
3813 ds.SetViewpoint(ref xyz, ref hpr); 3813 ds.SetViewpoint(ref xyz, ref hpr);
3814 } 3814 }
3815#endif 3815#endif
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 97166cf..2b858ec 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -353,15 +353,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
353 // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml); 353 // m_log.ErrorFormat("[Script] Unable to load script state from xml: {0}\n"+e.ToString(), xml);
354 } 354 }
355 } 355 }
356 else 356// else
357 { 357// {
358 ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID); 358// ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
359 359
360 if (presence != null && (!postOnRez)) 360// if (presence != null && (!postOnRez))
361 presence.ControllingClient.SendAgentAlertMessage("Compile successful", false); 361// presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
362 362
363// // m_log.ErrorFormat("[Script] Unable to load script state, file not found"); 363// }
364 }
365 } 364 }
366 365
367 public void Init() 366 public void Init()
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 847da8c..7b19ce3 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -604,9 +604,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
604 604
605 if (warnings != null && warnings.Length != 0) 605 if (warnings != null && warnings.Length != 0)
606 { 606 {
607 if (presence != null && (!postOnRez))
608 presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
609
610 foreach (string warning in warnings) 607 foreach (string warning in warnings)
611 { 608 {
612 try 609 try
@@ -615,10 +612,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
615 string text = "Warning:\n" + warning; 612 string text = "Warning:\n" + warning;
616 if (text.Length > 1000) 613 if (text.Length > 1000)
617 text = text.Substring(0, 1000); 614 text = text.Substring(0, 1000);
618 World.SimChat(Utils.StringToBytes(text), 615 if (!ShowScriptSaveResponse(item.OwnerID,
619 ChatTypeEnum.DebugChannel, 2147483647, 616 assetID, text, true))
620 part.AbsolutePosition, 617 {
621 part.Name, part.UUID, false); 618 if (presence != null && (!postOnRez))
619 presence.ControllingClient.SendAgentAlertMessage("Script saved with warnings, check debug window!", false);
620
621 World.SimChat(Utils.StringToBytes(text),
622 ChatTypeEnum.DebugChannel, 2147483647,
623 part.AbsolutePosition,
624 part.Name, part.UUID, false);
625 }
622 } 626 }
623 catch (Exception e2) // LEGIT: User Scripting 627 catch (Exception e2) // LEGIT: User Scripting
624 { 628 {
@@ -634,8 +638,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
634 } 638 }
635 catch (Exception e) 639 catch (Exception e)
636 { 640 {
637 if (presence != null && (!postOnRez))
638 presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
639 try 641 try
640 { 642 {
641 // DISPLAY ERROR INWORLD 643 // DISPLAY ERROR INWORLD
@@ -645,10 +647,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
645 string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString(); 647 string text = "Error compiling script '" + item.Name + "':\n" + e.Message.ToString();
646 if (text.Length > 1000) 648 if (text.Length > 1000)
647 text = text.Substring(0, 1000); 649 text = text.Substring(0, 1000);
648 World.SimChat(Utils.StringToBytes(text), 650 if (!ShowScriptSaveResponse(item.OwnerID,
649 ChatTypeEnum.DebugChannel, 2147483647, 651 assetID, text, false))
650 part.AbsolutePosition, 652 {
651 part.Name, part.UUID, false); 653 if (presence != null && (!postOnRez))
654 presence.ControllingClient.SendAgentAlertMessage("Script saved with errors, check debug window!", false);
655 World.SimChat(Utils.StringToBytes(text),
656 ChatTypeEnum.DebugChannel, 2147483647,
657 part.AbsolutePosition,
658 part.Name, part.UUID, false);
659 }
652 } 660 }
653 catch (Exception e2) // LEGIT: User Scripting 661 catch (Exception e2) // LEGIT: User Scripting
654 { 662 {
@@ -732,6 +740,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
732 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", 740 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
733 part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); 741 part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
734 742
743 if (presence != null)
744 {
745 ShowScriptSaveResponse(item.OwnerID,
746 assetID, "Compile successful", true);
747 }
748
735 instance.AppDomain = appDomain; 749 instance.AppDomain = appDomain;
736 instance.LineMap = linemap; 750 instance.LineMap = linemap;
737 751
@@ -1250,5 +1264,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1250 1264
1251 return instance.CanBeDeleted(); 1265 return instance.CanBeDeleted();
1252 } 1266 }
1267
1268 private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
1269 {
1270 return false;
1271 }
1253 } 1272 }
1254} 1273}