aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorMW2007-03-30 11:09:51 +0000
committerMW2007-03-30 11:09:51 +0000
commit00579d3581cc2c16657fd64c488835b9630fefb5 (patch)
treec369a62a1c4eb10e4bee9377849f442aef991de0 /OpenSim.RegionServer
parentStarted to add a few features to the web front end that should be useful duri... (diff)
downloadopensim-SC-00579d3581cc2c16657fd64c488835b9630fefb5.zip
opensim-SC-00579d3581cc2c16657fd64c488835b9630fefb5.tar.gz
opensim-SC-00579d3581cc2c16657fd64c488835b9630fefb5.tar.bz2
opensim-SC-00579d3581cc2c16657fd64c488835b9630fefb5.tar.xz
Should now be able to create and edit Notecards
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r--OpenSim.RegionServer/AgentAssetUpload.cs4
-rw-r--r--OpenSim.RegionServer/Assets/AssetCache.cs3
-rw-r--r--OpenSim.RegionServer/SimClient.cs25
3 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs
index bf8531a..f6b388d 100644
--- a/OpenSim.RegionServer/AgentAssetUpload.cs
+++ b/OpenSim.RegionServer/AgentAssetUpload.cs
@@ -84,14 +84,14 @@ namespace OpenSim
84 84
85 85
86 } 86 }
87 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5) 87 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7)
88 { 88 {
89 89
90 asset = new AssetBase(); 90 asset = new AssetBase();
91 asset.FullID = assetID; 91 asset.FullID = assetID;
92 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated()); 92 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
93 asset.Type = pack.AssetBlock.Type; 93 asset.Type = pack.AssetBlock.Type;
94 asset.InvType = asset.Type; 94 asset.InvType = asset.Type ;
95 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000"); 95 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
96 asset.Data = pack.AssetBlock.AssetData; 96 asset.Data = pack.AssetBlock.AssetData;
97 97
diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs
index 244f562..196fb57 100644
--- a/OpenSim.RegionServer/Assets/AssetCache.cs
+++ b/OpenSim.RegionServer/Assets/AssetCache.cs
@@ -329,6 +329,7 @@ namespace OpenSim.Assets
329 /// <param name="transferRequest"></param> 329 /// <param name="transferRequest"></param>
330 public void AddAssetRequest(SimClient userInfo, TransferRequestPacket transferRequest) 330 public void AddAssetRequest(SimClient userInfo, TransferRequestPacket transferRequest)
331 { 331 {
332 Console.WriteLine("AssetCache- got asset request: " + transferRequest.TransferInfo.TransferID.ToString());
332 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0); 333 LLUUID requestID = new LLUUID(transferRequest.TransferInfo.Params, 0);
333 //check to see if asset is in local cache, if not we need to request it from asset server. 334 //check to see if asset is in local cache, if not we need to request it from asset server.
334 if (!this.Assets.ContainsKey(requestID)) 335 if (!this.Assets.ContainsKey(requestID))
@@ -337,6 +338,7 @@ namespace OpenSim.Assets
337 // so request from asset server 338 // so request from asset server
338 if (!this.RequestedAssets.ContainsKey(requestID)) 339 if (!this.RequestedAssets.ContainsKey(requestID))
339 { 340 {
341 Console.WriteLine("which isn't in our cache, so requesting from asset server");
340 AssetRequest request = new AssetRequest(); 342 AssetRequest request = new AssetRequest();
341 request.RequestUser = userInfo; 343 request.RequestUser = userInfo;
342 request.RequestAssetID = requestID; 344 request.RequestAssetID = requestID;
@@ -347,6 +349,7 @@ namespace OpenSim.Assets
347 return; 349 return;
348 } 350 }
349 //it is in our cache 351 //it is in our cache
352 Console.WriteLine("which is in our cache so will be sending it");
350 AssetInfo asset = this.Assets[requestID]; 353 AssetInfo asset = this.Assets[requestID];
351 354
352 //work out how many packets it should be sent in 355 //work out how many packets it should be sent in
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index ec6d3dc..9411dac 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -341,6 +341,10 @@ namespace OpenSim
341 { 341 {
342 this.UploadAssets.CreateInventoryItem(createItem); 342 this.UploadAssets.CreateInventoryItem(createItem);
343 } 343 }
344 else
345 {
346 this.CreateInventoryItem(createItem);
347 }
344 break; 348 break;
345 case PacketType.FetchInventory: 349 case PacketType.FetchInventory:
346 //Console.WriteLine("fetch item packet"); 350 //Console.WriteLine("fetch item packet");
@@ -735,5 +739,26 @@ namespace OpenSim
735 } 739 }
736 return inventory; 740 return inventory;
737 } 741 }
742
743 private void CreateInventoryItem(CreateInventoryItemPacket packet)
744 {
745 if (packet.InventoryBlock.Type == 7)
746 {
747 Console.WriteLine(packet.ToString());
748 this.debug = true;
749 //lets try this out with creating a notecard
750 AssetBase asset = new AssetBase();
751 asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name);
752 asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
753 asset.InvType = packet.InventoryBlock.InvType;
754 asset.Type = packet.InventoryBlock.Type;
755 asset.FullID = LLUUID.Random();
756 asset.Data = new byte[0];
757 Console.WriteLine("created new notecard with asset : " + asset.FullID.ToStringHyphenated());
758
759 m_assetCache.AddAsset(asset);
760 m_inventoryCache.AddNewInventoryItem(this, packet.InventoryBlock.FolderID, asset);
761 }
762 }
738 } 763 }
739} 764}