aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/SimClient.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.cs43
1 files changed, 26 insertions, 17 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index 4359646..1564238 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -345,16 +345,19 @@ namespace OpenSim
345 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; 345 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
346 this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); 346 this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
347 break; 347 break;
348 case PacketType.RequestXfer:
349 //Console.WriteLine(Pack.ToString());
350 break;
348 case PacketType.SendXferPacket: 351 case PacketType.SendXferPacket:
349 this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); 352 this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack);
350 break; 353 break;
351 case PacketType.CreateInventoryFolder: 354 case PacketType.CreateInventoryFolder:
352 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; 355 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
353 m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Helpers.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); 356 m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Helpers.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
354 Console.WriteLine(Pack.ToString()); 357 //Console.WriteLine(Pack.ToString());
355 break; 358 break;
356 case PacketType.CreateInventoryItem: 359 case PacketType.CreateInventoryItem:
357 Console.WriteLine(Pack.ToString()); 360 //Console.WriteLine(Pack.ToString());
358 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; 361 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
359 if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) 362 if (createItem.InventoryBlock.TransactionID != LLUUID.Zero)
360 { 363 {
@@ -362,7 +365,7 @@ namespace OpenSim
362 } 365 }
363 else 366 else
364 { 367 {
365 Console.Write(Pack.ToString()); 368 // Console.Write(Pack.ToString());
366 this.CreateInventoryItem(createItem); 369 this.CreateInventoryItem(createItem);
367 } 370 }
368 break; 371 break;
@@ -385,7 +388,7 @@ namespace OpenSim
385 AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); 388 AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
386 if (asset != null) 389 if (asset != null)
387 { 390 {
388 Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache"); 391 // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");
389 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); 392 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
390 } 393 }
391 else 394 else
@@ -393,12 +396,12 @@ namespace OpenSim
393 asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); 396 asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID);
394 if (asset != null) 397 if (asset != null)
395 { 398 {
396 Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache"); 399 //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache");
397 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); 400 m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
398 } 401 }
399 else 402 else
400 { 403 {
401 Console.WriteLine("trying to update inventory item, but asset is null"); 404 //Console.WriteLine("trying to update inventory item, but asset is null");
402 } 405 }
403 } 406 }
404 } 407 }
@@ -441,24 +444,30 @@ namespace OpenSim
441 } 444 }
442 break; 445 break;
443 case PacketType.UpdateTaskInventory: 446 case PacketType.UpdateTaskInventory:
444 Console.WriteLine(Pack.ToString()); 447 // Console.WriteLine(Pack.ToString());
445 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; 448 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
446 AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID); 449 AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
447 if (myinventory != null) 450 if (myinventory != null)
448 { 451 {
449 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null) 452 if (updatetask.UpdateData.Key == 0)
450 { 453 {
451 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7) 454 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
452 { 455 {
453 LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID; 456 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7)
454 AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
455 if (assBase != null)
456 { 457 {
457 foreach (Entity ent in m_world.Entities.Values) 458 LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID;
459 AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
460 if (assBase != null)
458 { 461 {
459 if (ent.localid == updatetask.UpdateData.LocalID) 462 foreach (Entity ent in m_world.Entities.Values)
460 { 463 {
461 this.m_world.AddScript(ent, Helpers.FieldToString(assBase.Data)); 464 if (ent.localid == updatetask.UpdateData.LocalID)
465 {
466 if (ent is OpenSim.world.Primitive)
467 {
468 this.m_world.AddScript(ent, Helpers.FieldToString(assBase.Data));
469 }
470 }
462 } 471 }
463 } 472 }
464 } 473 }
@@ -520,7 +529,7 @@ namespace OpenSim
520 return; 529 return;
521 } 530 }
522 531
523 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck"); 532 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck");
524 533
525 534
526 int i = 0; 535 int i = 0;
@@ -817,7 +826,7 @@ namespace OpenSim
817 826
818 protected bool AgentTextureCached(SimClient simclient, Packet packet) 827 protected bool AgentTextureCached(SimClient simclient, Packet packet)
819 { 828 {
820 Console.WriteLine(packet.ToString()); 829 // Console.WriteLine(packet.ToString());
821 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; 830 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
822 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); 831 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
823 cachedresp.AgentData.AgentID = this.AgentID; 832 cachedresp.AgentData.AgentID = this.AgentID;