aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/Assets
diff options
context:
space:
mode:
authorMW2007-03-23 16:05:32 +0000
committerMW2007-03-23 16:05:32 +0000
commit085c184c5c58e22aaa3f276f980b3c81e92c9cb5 (patch)
tree7a3f9611422b7ea34715c265cc27d844f8bfdca1 /OpenSim.RegionServer/Assets
parent* whoops - missing project... (diff)
downloadopensim-SC_OLD-085c184c5c58e22aaa3f276f980b3c81e92c9cb5.zip
opensim-SC_OLD-085c184c5c58e22aaa3f276f980b3c81e92c9cb5.tar.gz
opensim-SC_OLD-085c184c5c58e22aaa3f276f980b3c81e92c9cb5.tar.bz2
opensim-SC_OLD-085c184c5c58e22aaa3f276f980b3c81e92c9cb5.tar.xz
Fixed it so that a Avatar update shouldn't be sent every frame and none should be sent when not moving.
Fixed the problem with sometimes Avatar Animations being updated every frame. New Asset uploads should now appear in the inventory all the time. Moved Animation names/ LLUUIDs to their own class (AvatarAnimations)
Diffstat (limited to 'OpenSim.RegionServer/Assets')
-rw-r--r--OpenSim.RegionServer/Assets/AssetCache.cs9
-rw-r--r--OpenSim.RegionServer/Assets/InventoryCache.cs36
2 files changed, 37 insertions, 8 deletions
diff --git a/OpenSim.RegionServer/Assets/AssetCache.cs b/OpenSim.RegionServer/Assets/AssetCache.cs
index f7f2e10..4149cb2 100644
--- a/OpenSim.RegionServer/Assets/AssetCache.cs
+++ b/OpenSim.RegionServer/Assets/AssetCache.cs
@@ -145,15 +145,12 @@ namespace OpenSim.Assets
145 num = 5; 145 num = 5;
146 } 146 }
147 AssetRequest req; 147 AssetRequest req;
148 Console.WriteLine("processing texture requests ( " + num + " )");
149 for (int i = 0; i < num; i++) 148 for (int i = 0; i < num; i++)
150 { 149 {
151 req = (AssetRequest)this.TextureRequests[i]; 150 req = (AssetRequest)this.TextureRequests[i];
152 if (req.PacketCounter != req.NumPackets) 151 if (req.PacketCounter != req.NumPackets)
153 { 152 {
154 // if (req.ImageInfo.FullID == new LLUUID("00000000-0000-0000-5005-000000000005")) 153
155 Console.WriteLine("sending base texture ( " + req.ImageInfo.FullID + " ) in " + req.NumPackets + "number of packets");
156
157 if (req.PacketCounter == 0) 154 if (req.PacketCounter == 0)
158 { 155 {
159 //first time for this request so send imagedata packet 156 //first time for this request so send imagedata packet
@@ -227,7 +224,6 @@ namespace OpenSim.Assets
227 } 224 }
228 public void AssetReceived(AssetBase asset, bool IsTexture) 225 public void AssetReceived(AssetBase asset, bool IsTexture)
229 { 226 {
230 Console.WriteLine("received asset from asset server ( " + asset.FullID + " )");
231 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server 227 if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
232 { 228 {
233 //check if it is a texture or not 229 //check if it is a texture or not
@@ -433,9 +429,6 @@ namespace OpenSim.Assets
433 /// <param name="imageID"></param> 429 /// <param name="imageID"></param>
434 public void AddTextureRequest(SimClient userInfo, LLUUID imageID) 430 public void AddTextureRequest(SimClient userInfo, LLUUID imageID)
435 { 431 {
436 if (imageID == new LLUUID("00000000-0000-0000-5005-000000000005"))
437 Console.WriteLine("request base prim texture ");
438
439 //check to see if texture is in local cache, if not request from asset server 432 //check to see if texture is in local cache, if not request from asset server
440 if (!this.Textures.ContainsKey(imageID)) 433 if (!this.Textures.ContainsKey(imageID))
441 { 434 {
diff --git a/OpenSim.RegionServer/Assets/InventoryCache.cs b/OpenSim.RegionServer/Assets/InventoryCache.cs
index 0788db2..e4d0a90 100644
--- a/OpenSim.RegionServer/Assets/InventoryCache.cs
+++ b/OpenSim.RegionServer/Assets/InventoryCache.cs
@@ -84,6 +84,11 @@ namespace OpenSim.Assets
84 if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) 84 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
85 { 85 {
86 newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset); 86 newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
87 if (newItem != null)
88 {
89 InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[newItem];
90 this.SendItemUpdateCreate(remoteClient, Item);
91 }
87 } 92 }
88 93
89 return newItem; 94 return newItem;
@@ -185,6 +190,37 @@ namespace OpenSim.Assets
185 } 190 }
186 } 191 }
187 } 192 }
193 private void SendItemUpdateCreate(SimClient remoteClient, InventoryItem Item)
194 {
195
196 UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
197 InventoryReply.AgentData.AgentID = remoteClient.AgentID;
198 InventoryReply.AgentData.SimApproved = true;
199 InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
200 InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
201 InventoryReply.InventoryData[0].ItemID = Item.ItemID;
202 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
203 InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
204 InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
205 InventoryReply.InventoryData[0].CreationDate = 1000;
206 InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
207 InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
208 InventoryReply.InventoryData[0].Flags = 1;
209 InventoryReply.InventoryData[0].FolderID = Item.FolderID;
210 InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
211 InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
212 InventoryReply.InventoryData[0].InvType = Item.InvType;
213 InventoryReply.InventoryData[0].Name = _enc.GetBytes(Item.Name + "\0");
214 InventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS;
215 InventoryReply.InventoryData[0].OwnerID = Item.OwnerID;
216 InventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS;
217 InventoryReply.InventoryData[0].SalePrice = 100;
218 InventoryReply.InventoryData[0].SaleType = 0;
219 InventoryReply.InventoryData[0].Type = Item.Type;
220 InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
221
222 remoteClient.OutPacket(InventoryReply);
223 }
188 } 224 }
189 225
190 226