diff options
Diffstat (limited to '')
13 files changed, 173 insertions, 80 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index f38552f..c6de226 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -58,7 +58,9 @@ namespace OpenSim.Framework.Communications.Caches | |||
58 | public Dictionary<LLUUID, TextureSender> SendingTextures = new Dictionary<LLUUID, TextureSender>(); | 58 | public Dictionary<LLUUID, TextureSender> SendingTextures = new Dictionary<LLUUID, TextureSender>(); |
59 | private BlockingQueue<TextureSender> QueueTextures = new BlockingQueue<TextureSender>(); | 59 | private BlockingQueue<TextureSender> QueueTextures = new BlockingQueue<TextureSender>(); |
60 | 60 | ||
61 | private Dictionary<LLUUID, List<LLUUID>> AvatarRecievedTextures = new Dictionary<LLUUID,List<LLUUID>>(); | 61 | private Dictionary<LLUUID, List<LLUUID>> AvatarRecievedTextures = new Dictionary<LLUUID, List<LLUUID>>(); |
62 | |||
63 | private Dictionary<LLUUID, Dictionary<LLUUID, int>> TimesTextureSent = new Dictionary<LLUUID, Dictionary<LLUUID, int>>(); | ||
62 | 64 | ||
63 | private IAssetServer _assetServer; | 65 | private IAssetServer _assetServer; |
64 | private Thread _assetCacheThread; | 66 | private Thread _assetCacheThread; |
@@ -139,12 +141,12 @@ namespace OpenSim.Framework.Communications.Caches | |||
139 | 141 | ||
140 | public AssetBase GetAsset(LLUUID assetID, bool isTexture) | 142 | public AssetBase GetAsset(LLUUID assetID, bool isTexture) |
141 | { | 143 | { |
142 | AssetBase asset = GetAsset(assetID); | 144 | AssetBase asset = GetAsset(assetID); |
143 | if (asset == null) | 145 | if (asset == null) |
144 | { | 146 | { |
145 | this._assetServer.RequestAsset(assetID, isTexture); | 147 | this._assetServer.RequestAsset(assetID, isTexture); |
146 | } | 148 | } |
147 | return asset; | 149 | return asset; |
148 | } | 150 | } |
149 | 151 | ||
150 | public void AddAsset(AssetBase asset) | 152 | public void AddAsset(AssetBase asset) |
@@ -190,7 +192,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
190 | req = (AssetRequest)this.TextureRequests[i]; | 192 | req = (AssetRequest)this.TextureRequests[i]; |
191 | if (!this.SendingTextures.ContainsKey(req.ImageInfo.FullID)) | 193 | if (!this.SendingTextures.ContainsKey(req.ImageInfo.FullID)) |
192 | { | 194 | { |
193 | //Console.WriteLine("new texture to send"); | 195 | //Console.WriteLine("new texture to send"); |
194 | TextureSender sender = new TextureSender(req); | 196 | TextureSender sender = new TextureSender(req); |
195 | //sender.OnComplete += this.TextureSent; | 197 | //sender.OnComplete += this.TextureSent; |
196 | lock (this.SendingTextures) | 198 | lock (this.SendingTextures) |
@@ -210,15 +212,40 @@ namespace OpenSim.Framework.Communications.Caches | |||
210 | while (true) | 212 | while (true) |
211 | { | 213 | { |
212 | TextureSender sender = this.QueueTextures.Dequeue(); | 214 | TextureSender sender = this.QueueTextures.Dequeue(); |
213 | bool finished = sender.SendTexture(); | 215 | if (TimesTextureSent.ContainsKey(sender.request.RequestUser.AgentId)) |
214 | if (finished) | ||
215 | { | 216 | { |
216 | this.TextureSent(sender); | 217 | if (TimesTextureSent[sender.request.RequestUser.AgentId].ContainsKey(sender.request.ImageInfo.FullID)) |
218 | { | ||
219 | TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID]++; | ||
220 | } | ||
221 | else | ||
222 | { | ||
223 | TimesTextureSent[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID, 1); | ||
224 | } | ||
217 | } | 225 | } |
218 | else | 226 | else |
219 | { | 227 | { |
220 | // Console.WriteLine("readding texture"); | 228 | Dictionary<LLUUID, int> UsersSent = new Dictionary<LLUUID,int>(); |
221 | this.QueueTextures.Enqueue(sender); | 229 | TimesTextureSent.Add(sender.request.RequestUser.AgentId, UsersSent ); |
230 | UsersSent.Add(sender.request.ImageInfo.FullID, 1); | ||
231 | |||
232 | } | ||
233 | if (TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID] < 600) | ||
234 | { | ||
235 | bool finished = sender.SendTexture(); | ||
236 | if (finished) | ||
237 | { | ||
238 | this.TextureSent(sender); | ||
239 | } | ||
240 | else | ||
241 | { | ||
242 | // Console.WriteLine("readding texture"); | ||
243 | this.QueueTextures.Enqueue(sender); | ||
244 | } | ||
245 | } | ||
246 | else | ||
247 | { | ||
248 | this.TextureSent(sender); | ||
222 | } | 249 | } |
223 | } | 250 | } |
224 | } | 251 | } |
@@ -234,7 +261,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
234 | lock (this.SendingTextures) | 261 | lock (this.SendingTextures) |
235 | { | 262 | { |
236 | this.SendingTextures.Remove(sender.request.ImageInfo.FullID); | 263 | this.SendingTextures.Remove(sender.request.ImageInfo.FullID); |
237 | // this.AvatarRecievedTextures[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID); | 264 | // this.AvatarRecievedTextures[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID); |
238 | } | 265 | } |
239 | } | 266 | } |
240 | } | 267 | } |
@@ -247,11 +274,11 @@ namespace OpenSim.Framework.Communications.Caches | |||
247 | //then add to the correct cache list | 274 | //then add to the correct cache list |
248 | //then check for waiting requests for this asset/texture (in the Requested lists) | 275 | //then check for waiting requests for this asset/texture (in the Requested lists) |
249 | //and move those requests into the Requests list. | 276 | //and move those requests into the Requests list. |
250 | 277 | ||
251 | if (IsTexture) | 278 | if (IsTexture) |
252 | { | 279 | { |
253 | // Console.WriteLine("asset recieved from asset server"); | 280 | //Console.WriteLine("asset recieved from asset server"); |
254 | 281 | ||
255 | TextureImage image = new TextureImage(asset); | 282 | TextureImage image = new TextureImage(asset); |
256 | if (!this.Textures.ContainsKey(image.FullID)) | 283 | if (!this.Textures.ContainsKey(image.FullID)) |
257 | { | 284 | { |
@@ -301,10 +328,17 @@ namespace OpenSim.Framework.Communications.Caches | |||
301 | } | 328 | } |
302 | } | 329 | } |
303 | 330 | ||
304 | public void AssetNotFound(AssetBase asset) | 331 | public void AssetNotFound(LLUUID assetID) |
305 | { | 332 | { |
306 | //the asset server had no knowledge of requested asset | 333 | if (this.RequestedTextures.ContainsKey(assetID)) |
334 | { | ||
335 | AssetRequest req = this.RequestedTextures[assetID]; | ||
336 | ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); | ||
337 | notFound.ImageID.ID = assetID; | ||
338 | req.RequestUser.OutPacket(notFound); | ||
307 | 339 | ||
340 | this.RequestedTextures.Remove(assetID); | ||
341 | } | ||
308 | } | 342 | } |
309 | 343 | ||
310 | #region Assets | 344 | #region Assets |
@@ -499,17 +533,17 @@ namespace OpenSim.Framework.Communications.Caches | |||
499 | /// <param name="imageID"></param> | 533 | /// <param name="imageID"></param> |
500 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber) | 534 | public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber) |
501 | { | 535 | { |
502 | // Console.WriteLine("texture request for " + imageID.ToStringHyphenated()); | 536 | //Console.WriteLine("texture request for " + imageID.ToStringHyphenated()); |
503 | //check to see if texture is in local cache, if not request from asset server | 537 | //check to see if texture is in local cache, if not request from asset server |
504 | if(!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId)) | 538 | if (!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId)) |
505 | { | 539 | { |
506 | this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>()); | 540 | this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>()); |
507 | } | 541 | } |
508 | /* if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID)) | 542 | /* if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID)) |
509 | { | 543 | { |
510 | //Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them"); | 544 | //Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them"); |
511 | return; | 545 | return; |
512 | }*/ | 546 | }*/ |
513 | if (!this.Textures.ContainsKey(imageID)) | 547 | if (!this.Textures.ContainsKey(imageID)) |
514 | { | 548 | { |
515 | if (!this.RequestedTextures.ContainsKey(imageID)) | 549 | if (!this.RequestedTextures.ContainsKey(imageID)) |
@@ -536,7 +570,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
536 | if (imag.Data.LongLength > 600) | 570 | if (imag.Data.LongLength > 600) |
537 | { | 571 | { |
538 | //over 600 bytes so split up file | 572 | //over 600 bytes so split up file |
539 | req.NumPackets = 1 + (int)(imag.Data.Length - 600 ) / 1000; | 573 | req.NumPackets = 1 + (int)(imag.Data.Length - 600) / 1000; |
540 | //Console.WriteLine("texture is " + imag.Data.Length + " which we will send in " +req.NumPackets +" packets"); | 574 | //Console.WriteLine("texture is " + imag.Data.Length + " which we will send in " +req.NumPackets +" packets"); |
541 | } | 575 | } |
542 | else | 576 | else |
@@ -656,15 +690,15 @@ namespace OpenSim.Framework.Communications.Caches | |||
656 | public TextureSender(AssetRequest req) | 690 | public TextureSender(AssetRequest req) |
657 | { | 691 | { |
658 | request = req; | 692 | request = req; |
659 | 693 | ||
660 | } | 694 | } |
661 | 695 | ||
662 | public bool SendTexture() | 696 | public bool SendTexture() |
663 | { | 697 | { |
664 | SendPacket(); | 698 | SendPacket(); |
665 | counter++; | 699 | counter++; |
666 | 700 | ||
667 | if ((request.PacketCounter > request.NumPackets) | (counter > 50) |(request.NumPackets ==1)) | 701 | if ((request.PacketCounter > request.NumPackets) | (counter > 90) | (request.NumPackets == 1)) |
668 | { | 702 | { |
669 | return true; | 703 | return true; |
670 | } | 704 | } |
@@ -682,6 +716,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
682 | { | 716 | { |
683 | //only one packet so send whole file | 717 | //only one packet so send whole file |
684 | ImageDataPacket im = new ImageDataPacket(); | 718 | ImageDataPacket im = new ImageDataPacket(); |
719 | im.Header.Reliable = false; | ||
685 | im.ImageID.Packets = 1; | 720 | im.ImageID.Packets = 1; |
686 | im.ImageID.ID = req.ImageInfo.FullID; | 721 | im.ImageID.ID = req.ImageInfo.FullID; |
687 | im.ImageID.Size = (uint)req.ImageInfo.Data.Length; | 722 | im.ImageID.Size = (uint)req.ImageInfo.Data.Length; |
@@ -697,6 +732,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
697 | { | 732 | { |
698 | //more than one packet so split file up | 733 | //more than one packet so split file up |
699 | ImageDataPacket im = new ImageDataPacket(); | 734 | ImageDataPacket im = new ImageDataPacket(); |
735 | im.Header.Reliable = false; | ||
700 | im.ImageID.Packets = (ushort)(req.NumPackets); | 736 | im.ImageID.Packets = (ushort)(req.NumPackets); |
701 | im.ImageID.ID = req.ImageInfo.FullID; | 737 | im.ImageID.ID = req.ImageInfo.FullID; |
702 | im.ImageID.Size = (uint)req.ImageInfo.Data.Length; | 738 | im.ImageID.Size = (uint)req.ImageInfo.Data.Length; |
@@ -704,7 +740,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
704 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); | 740 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); |
705 | im.ImageID.Codec = 2; | 741 | im.ImageID.Codec = 2; |
706 | req.RequestUser.OutPacket(im); | 742 | req.RequestUser.OutPacket(im); |
707 | 743 | ||
708 | req.PacketCounter++; | 744 | req.PacketCounter++; |
709 | //req.ImageInfo.last_used = time; | 745 | //req.ImageInfo.last_used = time; |
710 | //System.Console.WriteLine("sent first packet of texture: | 746 | //System.Console.WriteLine("sent first packet of texture: |
@@ -713,10 +749,11 @@ namespace OpenSim.Framework.Communications.Caches | |||
713 | } | 749 | } |
714 | else | 750 | else |
715 | { | 751 | { |
716 | //Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated()); | 752 | //Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated()); |
717 | //send imagepacket | 753 | //send imagepacket |
718 | //more than one packet so split file up | 754 | //more than one packet so split file up |
719 | ImagePacketPacket im = new ImagePacketPacket(); | 755 | ImagePacketPacket im = new ImagePacketPacket(); |
756 | im.Header.Reliable = false; | ||
720 | im.ImageID.Packet = (ushort)(req.PacketCounter); | 757 | im.ImageID.Packet = (ushort)(req.PacketCounter); |
721 | im.ImageID.ID = req.ImageInfo.FullID; | 758 | im.ImageID.ID = req.ImageInfo.FullID; |
722 | int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter - 1)); | 759 | int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter - 1)); |
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs index 1f5f99d..2e72a3e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs | |||
@@ -80,15 +80,16 @@ namespace OpenSim.Framework.Communications.Caches | |||
80 | 80 | ||
81 | } | 81 | } |
82 | 82 | ||
83 | public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data) | 83 | public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal) |
84 | { | 84 | { |
85 | // Console.WriteLine("asset upload of " + assetID); | ||
85 | AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); | 86 | AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); |
86 | if (transactions != null) | 87 | if (transactions != null) |
87 | { | 88 | { |
88 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); | 89 | AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction); |
89 | if (uploader != null) | 90 | if (uploader != null) |
90 | { | 91 | { |
91 | uploader.Initialise(remoteClient, assetID, transaction, type, data); | 92 | uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal); |
92 | } | 93 | } |
93 | } | 94 | } |
94 | } | 95 | } |
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 4cde5f6..63623a4 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -189,6 +189,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
189 | private bool m_finished = false; | 189 | private bool m_finished = false; |
190 | private bool m_createItem = false; | 190 | private bool m_createItem = false; |
191 | private AgentAssetTransactions m_userTransactions; | 191 | private AgentAssetTransactions m_userTransactions; |
192 | private bool m_storeLocal; | ||
192 | 193 | ||
193 | public AssetXferUploader(AgentAssetTransactions transactions) | 194 | public AssetXferUploader(AgentAssetTransactions transactions) |
194 | { | 195 | { |
@@ -224,7 +225,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
224 | } | 225 | } |
225 | } | 226 | } |
226 | 227 | ||
227 | public void Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data) | 228 | public void Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal) |
228 | { | 229 | { |
229 | this.ourClient = remoteClient; | 230 | this.ourClient = remoteClient; |
230 | this.Asset = new AssetBase(); | 231 | this.Asset = new AssetBase(); |
@@ -235,6 +236,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
235 | this.Asset.Name = "blank"; | 236 | this.Asset.Name = "blank"; |
236 | this.Asset.Description = "empty"; | 237 | this.Asset.Description = "empty"; |
237 | this.TransactionID = transaction; | 238 | this.TransactionID = transaction; |
239 | this.m_storeLocal = storeLocal; | ||
238 | if (this.Asset.Data.Length > 2) | 240 | if (this.Asset.Data.Length > 2) |
239 | { | 241 | { |
240 | this.SendCompleteMessage(); | 242 | this.SendCompleteMessage(); |
@@ -271,6 +273,11 @@ namespace OpenSim.Framework.Communications.Caches | |||
271 | { | 273 | { |
272 | DoCreateItem(); | 274 | DoCreateItem(); |
273 | } | 275 | } |
276 | else if (m_storeLocal) | ||
277 | { | ||
278 | this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); | ||
279 | } | ||
280 | |||
274 | // Console.WriteLine("upload complete "+ this.TransactionID); | 281 | // Console.WriteLine("upload complete "+ this.TransactionID); |
275 | //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); | 282 | //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); |
276 | } | 283 | } |
diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs index cbb5c36..cdce979 100644 --- a/OpenSim/Framework/General/Interfaces/IAssetServer.cs +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Interfaces | |||
48 | public interface IAssetReceiver | 48 | public interface IAssetReceiver |
49 | { | 49 | { |
50 | void AssetReceived(AssetBase asset, bool IsTexture); | 50 | void AssetReceived(AssetBase asset, bool IsTexture); |
51 | void AssetNotFound(AssetBase asset); | 51 | void AssetNotFound(LLUUID assetID); |
52 | } | 52 | } |
53 | 53 | ||
54 | public interface IAssetPlugin | 54 | public interface IAssetPlugin |
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 4dbe4e7..54136ac 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Interfaces | |||
92 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); | 92 | public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); |
93 | public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID); | 93 | public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID); |
94 | 94 | ||
95 | public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data); | 95 | public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal); |
96 | public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); | 96 | public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data); |
97 | public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName); | 97 | public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName); |
98 | public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID); | 98 | public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID); |
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 728767f..9a8adba 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | |||
@@ -1,3 +1,4 @@ | |||
1 | using System.Xml.Serialization; | ||
1 | using libsecondlife; | 2 | using libsecondlife; |
2 | using libsecondlife.Packets; | 3 | using libsecondlife.Packets; |
3 | 4 | ||
@@ -75,6 +76,7 @@ namespace OpenSim.Framework.Types | |||
75 | } | 76 | } |
76 | } | 77 | } |
77 | 78 | ||
79 | [XmlIgnore] | ||
78 | public HollowShape HollowShape | 80 | public HollowShape HollowShape |
79 | { | 81 | { |
80 | get | 82 | get |
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 | ||