aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMW2007-08-26 17:57:25 +0000
committerMW2007-08-26 17:57:25 +0000
commit291eb48fb0338d80e3baeed65664d7a72fea1892 (patch)
tree8fa18a9474cb998a2e20fa9a124979b01bd41a8f /OpenSim/Region
parentDanxors patch for >30prims with ODE (diff)
downloadopensim-SC_OLD-291eb48fb0338d80e3baeed65664d7a72fea1892.zip
opensim-SC_OLD-291eb48fb0338d80e3baeed65664d7a72fea1892.tar.gz
opensim-SC_OLD-291eb48fb0338d80e3baeed65664d7a72fea1892.tar.bz2
opensim-SC_OLD-291eb48fb0338d80e3baeed65664d7a72fea1892.tar.xz
Another attempt to fix the image sending bug (next week, I intend to rewrite the assetcache and asset server).
Attempt to fix bug # 326. (crashing when using save-xml and hollow prims) Attempt to fix bug # 328 (limit of 50 items in a folder)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs57
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs5
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs46
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs13
-rw-r--r--OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs1
7 files changed, 89 insertions, 43 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 6209beb..edc1268 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -531,13 +531,19 @@ namespace OpenSim.Region.ClientStack
531 { 531 {
532 Encoding enc = Encoding.ASCII; 532 Encoding enc = Encoding.ASCII;
533 uint FULL_MASK_PERMISSIONS = 2147483647; 533 uint FULL_MASK_PERMISSIONS = 2147483647;
534 InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); 534 InventoryDescendentsPacket descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
535 descend.AgentData.AgentID = this.AgentId; 535
536 descend.AgentData.OwnerID = ownerID; 536 int count = 0;
537 descend.AgentData.FolderID = folderID; 537 if (items.Count < 40)
538 descend.AgentData.Descendents = items.Count; 538 {
539 descend.AgentData.Version = 0; 539 descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
540 descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; 540 descend.AgentData.Descendents = items.Count;
541 }
542 else
543 {
544 descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
545 descend.AgentData.Descendents = 40;
546 }
541 int i = 0; 547 int i = 0;
542 foreach (InventoryItemBase item in items) 548 foreach (InventoryItemBase item in items)
543 { 549 {
@@ -564,10 +570,45 @@ namespace OpenSim.Region.ClientStack
564 descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 570 descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
565 571
566 i++; 572 i++;
573 count++;
574 if (i == 40)
575 {
576 this.OutPacket(descend);
577
578 if ((items.Count - count) > 0)
579 {
580 descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
581 if ((items.Count - count) < 40)
582 {
583 descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count];
584 descend.AgentData.Descendents = items.Count - count;
585 }
586 else
587 {
588 descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
589 descend.AgentData.Descendents = 40;
590 }
591 i = 0;
592 }
593 }
594 }
595
596 if (i < 40)
597 {
598 this.OutPacket(descend);
567 } 599 }
568 600
569 this.OutPacket(descend); 601 }
602
603 private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)
604 {
605 InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
606 descend.AgentData.AgentID = this.AgentId;
607 descend.AgentData.OwnerID = ownerID;
608 descend.AgentData.FolderID = folderID;
609 descend.AgentData.Version = 0;
570 610
611 return descend;
571 } 612 }
572 613
573 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) 614 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 0163528..ade7a0d 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack
351 #region Inventory/Asset/Other related packets 351 #region Inventory/Asset/Other related packets
352 case PacketType.RequestImage: 352 case PacketType.RequestImage:
353 RequestImagePacket imageRequest = (RequestImagePacket)Pack; 353 RequestImagePacket imageRequest = (RequestImagePacket)Pack;
354 354 //Console.WriteLine("image request: " + Pack.ToString());
355 for (int i = 0; i < imageRequest.RequestImage.Length; i++) 355 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
356 { 356 {
357 m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet); 357 m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet);
@@ -363,10 +363,11 @@ namespace OpenSim.Region.ClientStack
363 m_assetCache.AddAssetRequest(this, transfer); 363 m_assetCache.AddAssetRequest(this, transfer);
364 break; 364 break;
365 case PacketType.AssetUploadRequest: 365 case PacketType.AssetUploadRequest:
366 //Console.WriteLine("upload request " + Pack.ToString());
366 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; 367 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
367 if (OnAssetUploadRequest != null) 368 if (OnAssetUploadRequest != null)
368 { 369 {
369 OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData); 370 OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
370 } 371 }
371 break; 372 break;
372 case PacketType.RequestXfer: 373 case PacketType.RequestXfer:
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index 55660c5..3e481e8 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment
86 if (!permission) 86 if (!permission)
87 SendPermissionError(user, reason); 87 SendPermissionError(user, reason);
88 88
89 return true; 89 return permission;
90 } 90 }
91 91
92 #region Object Permissions 92 #region Object Permissions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 4b30a80..e0fd459 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
262 if (rezAsset != null) 262 if (rezAsset != null)
263 { 263 {
264 string script = Util.FieldToString(rezAsset.Data); 264 string script = Util.FieldToString(rezAsset.Data);
265 // Console.WriteLine("rez script " + script); 265 // Console.WriteLine("rez script " + script);
266 this.EventManager.TriggerRezScript(localID, copyID, script); 266 this.EventManager.TriggerRezScript(localID, copyID, script);
267 rezzed = true; 267 rezzed = true;
268 } 268 }
@@ -270,22 +270,22 @@ namespace OpenSim.Region.Environment.Scenes
270 270
271 if (rezzed) 271 if (rezzed)
272 { 272 {
273 bool hasPrim = false; 273 bool hasPrim = false;
274 foreach (EntityBase ent in Entities.Values) 274 foreach (EntityBase ent in Entities.Values)
275 { 275 {
276 if (ent is SceneObjectGroup) 276 if (ent is SceneObjectGroup)
277 { 277 {
278 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 278 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
279 if (hasPrim != false) 279 if (hasPrim != false)
280 { 280 {
281 281
282 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID); 282 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
283 ((SceneObjectGroup)ent).GetProperites(remoteClient); 283 ((SceneObjectGroup)ent).GetProperites(remoteClient);
284 284
285 } 285 }
286 } 286 }
287 } 287 }
288 288
289 } 289 }
290 } 290 }
291 } 291 }
@@ -361,7 +361,7 @@ namespace OpenSim.Region.Environment.Scenes
361 this.phyScene.RemovePrim(rootPart.PhysActor); 361 this.phyScene.RemovePrim(rootPart.PhysActor);
362 rootPart.PhysActor = null; 362 rootPart.PhysActor = null;
363 } 363 }
364 364
365 storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID); 365 storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
366 ((SceneObjectGroup)selectedEnt).DeleteGroup(); 366 ((SceneObjectGroup)selectedEnt).DeleteGroup();
367 367
@@ -415,11 +415,11 @@ namespace OpenSim.Region.Environment.Scenes
415 this.AddEntity(group); 415 this.AddEntity(group);
416 group.AbsolutePosition = pos; 416 group.AbsolutePosition = pos;
417 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 417 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
418 rootPart.PhysActor = phyScene.AddPrim( 418 rootPart.PhysActor = phyScene.AddPrim(
419 new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), 419 new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
420 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 420 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
421 new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 421 new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
422 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 422 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
423 } 423 }
424 424
425 425
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 282e548..dcc3e16 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -544,11 +544,14 @@ namespace OpenSim.Region.Environment.Scenes
544 /// <param name="ownerID"></param> 544 /// <param name="ownerID"></param>
545 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) 545 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
546 { 546 {
547 SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); 547 if (this.PermissionsMngr.CanRezObject(ownerID, pos))
548 AddEntity(sceneOb); 548 {
549 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 549 SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
550 rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 550 AddEntity(sceneOb);
551 new Axiom.Math.Quaternion()); 551 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
552 rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
553 new Axiom.Math.Quaternion());
554 }
552 } 555 }
553 556
554 public void RemovePrim(uint localID, LLUUID avatar_deleter) 557 public void RemovePrim(uint localID, LLUUID avatar_deleter)
diff --git a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs b/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs
index a1cc10a..835212e 100644
--- a/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs
+++ b/OpenSim/Region/GridInterfaces/Local/LocalAssetServer.cs
@@ -144,13 +144,15 @@ namespace OpenSim.Region.GridInterfaces.Local
144 asset.InvType = foundAsset.Type; 144 asset.InvType = foundAsset.Type;
145 asset.Name = foundAsset.Name; 145 asset.Name = foundAsset.Name;
146 idata = foundAsset.Data; 146 idata = foundAsset.Data;
147 asset.Data = idata;
148 _receiver.AssetReceived(asset, req.IsTexture);
147 } 149 }
148 else 150 else
149 { 151 {
150 asset.FullID = LLUUID.Zero; 152 //asset.FullID = ;
153 _receiver.AssetNotFound(req.AssetID);
151 } 154 }
152 asset.Data = idata; 155
153 _receiver.AssetReceived(asset, req.IsTexture);
154 } 156 }
155 157
156 } 158 }
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index f941bc0..3b7bd7b 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -260,7 +260,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
260 Return += Script; 260 Return += Script;
261 Return += "} }\r\n"; 261 Return += "} }\r\n";
262 262
263
264 return Return; 263 return Return;
265 } 264 }
266 265