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)afrisby
parent
87711c5869
commit
291eb48fb0
|
@ -58,7 +58,9 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
public Dictionary<LLUUID, TextureSender> SendingTextures = new Dictionary<LLUUID, TextureSender>();
|
public Dictionary<LLUUID, TextureSender> SendingTextures = new Dictionary<LLUUID, TextureSender>();
|
||||||
private BlockingQueue<TextureSender> QueueTextures = new BlockingQueue<TextureSender>();
|
private BlockingQueue<TextureSender> QueueTextures = new BlockingQueue<TextureSender>();
|
||||||
|
|
||||||
private Dictionary<LLUUID, List<LLUUID>> AvatarRecievedTextures = new Dictionary<LLUUID,List<LLUUID>>();
|
private Dictionary<LLUUID, List<LLUUID>> AvatarRecievedTextures = new Dictionary<LLUUID, List<LLUUID>>();
|
||||||
|
|
||||||
|
private Dictionary<LLUUID, Dictionary<LLUUID, int>> TimesTextureSent = new Dictionary<LLUUID, Dictionary<LLUUID, int>>();
|
||||||
|
|
||||||
private IAssetServer _assetServer;
|
private IAssetServer _assetServer;
|
||||||
private Thread _assetCacheThread;
|
private Thread _assetCacheThread;
|
||||||
|
@ -139,12 +141,12 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
|
|
||||||
public AssetBase GetAsset(LLUUID assetID, bool isTexture)
|
public AssetBase GetAsset(LLUUID assetID, bool isTexture)
|
||||||
{
|
{
|
||||||
AssetBase asset = GetAsset(assetID);
|
AssetBase asset = GetAsset(assetID);
|
||||||
if (asset == null)
|
if (asset == null)
|
||||||
{
|
{
|
||||||
this._assetServer.RequestAsset(assetID, isTexture);
|
this._assetServer.RequestAsset(assetID, isTexture);
|
||||||
}
|
}
|
||||||
return asset;
|
return asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAsset(AssetBase asset)
|
public void AddAsset(AssetBase asset)
|
||||||
|
@ -190,7 +192,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
req = (AssetRequest)this.TextureRequests[i];
|
req = (AssetRequest)this.TextureRequests[i];
|
||||||
if (!this.SendingTextures.ContainsKey(req.ImageInfo.FullID))
|
if (!this.SendingTextures.ContainsKey(req.ImageInfo.FullID))
|
||||||
{
|
{
|
||||||
//Console.WriteLine("new texture to send");
|
//Console.WriteLine("new texture to send");
|
||||||
TextureSender sender = new TextureSender(req);
|
TextureSender sender = new TextureSender(req);
|
||||||
//sender.OnComplete += this.TextureSent;
|
//sender.OnComplete += this.TextureSent;
|
||||||
lock (this.SendingTextures)
|
lock (this.SendingTextures)
|
||||||
|
@ -210,15 +212,40 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
TextureSender sender = this.QueueTextures.Dequeue();
|
TextureSender sender = this.QueueTextures.Dequeue();
|
||||||
bool finished = sender.SendTexture();
|
if (TimesTextureSent.ContainsKey(sender.request.RequestUser.AgentId))
|
||||||
if (finished)
|
|
||||||
{
|
{
|
||||||
this.TextureSent(sender);
|
if (TimesTextureSent[sender.request.RequestUser.AgentId].ContainsKey(sender.request.ImageInfo.FullID))
|
||||||
|
{
|
||||||
|
TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID]++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TimesTextureSent[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Console.WriteLine("readding texture");
|
Dictionary<LLUUID, int> UsersSent = new Dictionary<LLUUID,int>();
|
||||||
this.QueueTextures.Enqueue(sender);
|
TimesTextureSent.Add(sender.request.RequestUser.AgentId, UsersSent );
|
||||||
|
UsersSent.Add(sender.request.ImageInfo.FullID, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (TimesTextureSent[sender.request.RequestUser.AgentId][sender.request.ImageInfo.FullID] < 600)
|
||||||
|
{
|
||||||
|
bool finished = sender.SendTexture();
|
||||||
|
if (finished)
|
||||||
|
{
|
||||||
|
this.TextureSent(sender);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Console.WriteLine("readding texture");
|
||||||
|
this.QueueTextures.Enqueue(sender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.TextureSent(sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +261,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
lock (this.SendingTextures)
|
lock (this.SendingTextures)
|
||||||
{
|
{
|
||||||
this.SendingTextures.Remove(sender.request.ImageInfo.FullID);
|
this.SendingTextures.Remove(sender.request.ImageInfo.FullID);
|
||||||
// this.AvatarRecievedTextures[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID);
|
// this.AvatarRecievedTextures[sender.request.RequestUser.AgentId].Add(sender.request.ImageInfo.FullID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,11 +274,11 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
//then add to the correct cache list
|
//then add to the correct cache list
|
||||||
//then check for waiting requests for this asset/texture (in the Requested lists)
|
//then check for waiting requests for this asset/texture (in the Requested lists)
|
||||||
//and move those requests into the Requests list.
|
//and move those requests into the Requests list.
|
||||||
|
|
||||||
if (IsTexture)
|
if (IsTexture)
|
||||||
{
|
{
|
||||||
// Console.WriteLine("asset recieved from asset server");
|
//Console.WriteLine("asset recieved from asset server");
|
||||||
|
|
||||||
TextureImage image = new TextureImage(asset);
|
TextureImage image = new TextureImage(asset);
|
||||||
if (!this.Textures.ContainsKey(image.FullID))
|
if (!this.Textures.ContainsKey(image.FullID))
|
||||||
{
|
{
|
||||||
|
@ -301,10 +328,17 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AssetNotFound(AssetBase asset)
|
public void AssetNotFound(LLUUID assetID)
|
||||||
{
|
{
|
||||||
//the asset server had no knowledge of requested asset
|
if (this.RequestedTextures.ContainsKey(assetID))
|
||||||
|
{
|
||||||
|
AssetRequest req = this.RequestedTextures[assetID];
|
||||||
|
ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
|
||||||
|
notFound.ImageID.ID = assetID;
|
||||||
|
req.RequestUser.OutPacket(notFound);
|
||||||
|
|
||||||
|
this.RequestedTextures.Remove(assetID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Assets
|
#region Assets
|
||||||
|
@ -499,17 +533,17 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
/// <param name="imageID"></param>
|
/// <param name="imageID"></param>
|
||||||
public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber)
|
public void AddTextureRequest(IClientAPI userInfo, LLUUID imageID, uint packetNumber)
|
||||||
{
|
{
|
||||||
// Console.WriteLine("texture request for " + imageID.ToStringHyphenated());
|
//Console.WriteLine("texture request for " + imageID.ToStringHyphenated());
|
||||||
//check to see if texture is in local cache, if not request from asset server
|
//check to see if texture is in local cache, if not request from asset server
|
||||||
if(!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId))
|
if (!this.AvatarRecievedTextures.ContainsKey(userInfo.AgentId))
|
||||||
{
|
{
|
||||||
this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>());
|
this.AvatarRecievedTextures.Add(userInfo.AgentId, new List<LLUUID>());
|
||||||
}
|
}
|
||||||
/* if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID))
|
/* if(this.AvatarRecievedTextures[userInfo.AgentId].Contains(imageID))
|
||||||
{
|
{
|
||||||
//Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them");
|
//Console.WriteLine(userInfo.AgentId +" is requesting a image( "+ imageID+" that has already been sent to them");
|
||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
if (!this.Textures.ContainsKey(imageID))
|
if (!this.Textures.ContainsKey(imageID))
|
||||||
{
|
{
|
||||||
if (!this.RequestedTextures.ContainsKey(imageID))
|
if (!this.RequestedTextures.ContainsKey(imageID))
|
||||||
|
@ -536,7 +570,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
if (imag.Data.LongLength > 600)
|
if (imag.Data.LongLength > 600)
|
||||||
{
|
{
|
||||||
//over 600 bytes so split up file
|
//over 600 bytes so split up file
|
||||||
req.NumPackets = 1 + (int)(imag.Data.Length - 600 ) / 1000;
|
req.NumPackets = 1 + (int)(imag.Data.Length - 600) / 1000;
|
||||||
//Console.WriteLine("texture is " + imag.Data.Length + " which we will send in " +req.NumPackets +" packets");
|
//Console.WriteLine("texture is " + imag.Data.Length + " which we will send in " +req.NumPackets +" packets");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -656,15 +690,15 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
public TextureSender(AssetRequest req)
|
public TextureSender(AssetRequest req)
|
||||||
{
|
{
|
||||||
request = req;
|
request = req;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SendTexture()
|
public bool SendTexture()
|
||||||
{
|
{
|
||||||
SendPacket();
|
SendPacket();
|
||||||
counter++;
|
counter++;
|
||||||
|
|
||||||
if ((request.PacketCounter > request.NumPackets) | (counter > 50) |(request.NumPackets ==1))
|
if ((request.PacketCounter > request.NumPackets) | (counter > 90) | (request.NumPackets == 1))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -682,6 +716,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
{
|
{
|
||||||
//only one packet so send whole file
|
//only one packet so send whole file
|
||||||
ImageDataPacket im = new ImageDataPacket();
|
ImageDataPacket im = new ImageDataPacket();
|
||||||
|
im.Header.Reliable = false;
|
||||||
im.ImageID.Packets = 1;
|
im.ImageID.Packets = 1;
|
||||||
im.ImageID.ID = req.ImageInfo.FullID;
|
im.ImageID.ID = req.ImageInfo.FullID;
|
||||||
im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
|
im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
|
||||||
|
@ -697,6 +732,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
{
|
{
|
||||||
//more than one packet so split file up
|
//more than one packet so split file up
|
||||||
ImageDataPacket im = new ImageDataPacket();
|
ImageDataPacket im = new ImageDataPacket();
|
||||||
|
im.Header.Reliable = false;
|
||||||
im.ImageID.Packets = (ushort)(req.NumPackets);
|
im.ImageID.Packets = (ushort)(req.NumPackets);
|
||||||
im.ImageID.ID = req.ImageInfo.FullID;
|
im.ImageID.ID = req.ImageInfo.FullID;
|
||||||
im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
|
im.ImageID.Size = (uint)req.ImageInfo.Data.Length;
|
||||||
|
@ -704,7 +740,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
|
Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600);
|
||||||
im.ImageID.Codec = 2;
|
im.ImageID.Codec = 2;
|
||||||
req.RequestUser.OutPacket(im);
|
req.RequestUser.OutPacket(im);
|
||||||
|
|
||||||
req.PacketCounter++;
|
req.PacketCounter++;
|
||||||
//req.ImageInfo.last_used = time;
|
//req.ImageInfo.last_used = time;
|
||||||
//System.Console.WriteLine("sent first packet of texture:
|
//System.Console.WriteLine("sent first packet of texture:
|
||||||
|
@ -713,10 +749,11 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated());
|
//Console.WriteLine("sending packet" + req.PacketCounter + "for " + req.ImageInfo.FullID.ToStringHyphenated());
|
||||||
//send imagepacket
|
//send imagepacket
|
||||||
//more than one packet so split file up
|
//more than one packet so split file up
|
||||||
ImagePacketPacket im = new ImagePacketPacket();
|
ImagePacketPacket im = new ImagePacketPacket();
|
||||||
|
im.Header.Reliable = false;
|
||||||
im.ImageID.Packet = (ushort)(req.PacketCounter);
|
im.ImageID.Packet = (ushort)(req.PacketCounter);
|
||||||
im.ImageID.ID = req.ImageInfo.FullID;
|
im.ImageID.ID = req.ImageInfo.FullID;
|
||||||
int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter - 1));
|
int size = req.ImageInfo.Data.Length - 600 - (1000 * (req.PacketCounter - 1));
|
||||||
|
|
|
@ -80,15 +80,16 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data)
|
public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal)
|
||||||
{
|
{
|
||||||
|
// Console.WriteLine("asset upload of " + assetID);
|
||||||
AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId);
|
AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId);
|
||||||
if (transactions != null)
|
if (transactions != null)
|
||||||
{
|
{
|
||||||
AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction);
|
AgentAssetTransactions.AssetXferUploader uploader = transactions.RequestXferUploader(transaction);
|
||||||
if (uploader != null)
|
if (uploader != null)
|
||||||
{
|
{
|
||||||
uploader.Initialise(remoteClient, assetID, transaction, type, data);
|
uploader.Initialise(remoteClient, assetID, transaction, type, data, storeLocal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,6 +189,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
private bool m_finished = false;
|
private bool m_finished = false;
|
||||||
private bool m_createItem = false;
|
private bool m_createItem = false;
|
||||||
private AgentAssetTransactions m_userTransactions;
|
private AgentAssetTransactions m_userTransactions;
|
||||||
|
private bool m_storeLocal;
|
||||||
|
|
||||||
public AssetXferUploader(AgentAssetTransactions transactions)
|
public AssetXferUploader(AgentAssetTransactions transactions)
|
||||||
{
|
{
|
||||||
|
@ -224,7 +225,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data)
|
public void Initialise(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal)
|
||||||
{
|
{
|
||||||
this.ourClient = remoteClient;
|
this.ourClient = remoteClient;
|
||||||
this.Asset = new AssetBase();
|
this.Asset = new AssetBase();
|
||||||
|
@ -235,6 +236,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
this.Asset.Name = "blank";
|
this.Asset.Name = "blank";
|
||||||
this.Asset.Description = "empty";
|
this.Asset.Description = "empty";
|
||||||
this.TransactionID = transaction;
|
this.TransactionID = transaction;
|
||||||
|
this.m_storeLocal = storeLocal;
|
||||||
if (this.Asset.Data.Length > 2)
|
if (this.Asset.Data.Length > 2)
|
||||||
{
|
{
|
||||||
this.SendCompleteMessage();
|
this.SendCompleteMessage();
|
||||||
|
@ -271,6 +273,11 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
{
|
{
|
||||||
DoCreateItem();
|
DoCreateItem();
|
||||||
}
|
}
|
||||||
|
else if (m_storeLocal)
|
||||||
|
{
|
||||||
|
this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset);
|
||||||
|
}
|
||||||
|
|
||||||
// Console.WriteLine("upload complete "+ this.TransactionID);
|
// Console.WriteLine("upload complete "+ this.TransactionID);
|
||||||
//SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
|
//SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Interfaces
|
||||||
public interface IAssetReceiver
|
public interface IAssetReceiver
|
||||||
{
|
{
|
||||||
void AssetReceived(AssetBase asset, bool IsTexture);
|
void AssetReceived(AssetBase asset, bool IsTexture);
|
||||||
void AssetNotFound(AssetBase asset);
|
void AssetNotFound(LLUUID assetID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IAssetPlugin
|
public interface IAssetPlugin
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace OpenSim.Framework.Interfaces
|
||||||
public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
|
public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
|
||||||
public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID);
|
public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID);
|
||||||
|
|
||||||
public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data);
|
public delegate void UDPAssetUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal);
|
||||||
public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data);
|
public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data);
|
||||||
public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName);
|
public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName);
|
||||||
public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
|
public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Xml.Serialization;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
|
|
||||||
|
@ -75,6 +76,7 @@ namespace OpenSim.Framework.Types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[XmlIgnore]
|
||||||
public HollowShape HollowShape
|
public HollowShape HollowShape
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -531,13 +531,19 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
Encoding enc = Encoding.ASCII;
|
Encoding enc = Encoding.ASCII;
|
||||||
uint FULL_MASK_PERMISSIONS = 2147483647;
|
uint FULL_MASK_PERMISSIONS = 2147483647;
|
||||||
InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
|
InventoryDescendentsPacket descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||||
descend.AgentData.AgentID = this.AgentId;
|
|
||||||
descend.AgentData.OwnerID = ownerID;
|
int count = 0;
|
||||||
descend.AgentData.FolderID = folderID;
|
if (items.Count < 40)
|
||||||
descend.AgentData.Descendents = items.Count;
|
{
|
||||||
descend.AgentData.Version = 0;
|
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
|
||||||
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
|
descend.AgentData.Descendents = items.Count;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
|
||||||
|
descend.AgentData.Descendents = 40;
|
||||||
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (InventoryItemBase item in items)
|
foreach (InventoryItemBase item in items)
|
||||||
{
|
{
|
||||||
|
@ -564,12 +570,47 @@ namespace OpenSim.Region.ClientStack
|
||||||
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);
|
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);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
count++;
|
||||||
|
if (i == 40)
|
||||||
|
{
|
||||||
|
this.OutPacket(descend);
|
||||||
|
|
||||||
|
if ((items.Count - count) > 0)
|
||||||
|
{
|
||||||
|
descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||||
|
if ((items.Count - count) < 40)
|
||||||
|
{
|
||||||
|
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count];
|
||||||
|
descend.AgentData.Descendents = items.Count - count;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
|
||||||
|
descend.AgentData.Descendents = 40;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.OutPacket(descend);
|
if (i < 40)
|
||||||
|
{
|
||||||
|
this.OutPacket(descend);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)
|
||||||
|
{
|
||||||
|
InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
|
||||||
|
descend.AgentData.AgentID = this.AgentId;
|
||||||
|
descend.AgentData.OwnerID = ownerID;
|
||||||
|
descend.AgentData.FolderID = folderID;
|
||||||
|
descend.AgentData.Version = 0;
|
||||||
|
|
||||||
|
return descend;
|
||||||
|
}
|
||||||
|
|
||||||
public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
|
public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
|
||||||
{
|
{
|
||||||
Encoding enc = Encoding.ASCII;
|
Encoding enc = Encoding.ASCII;
|
||||||
|
|
|
@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
#region Inventory/Asset/Other related packets
|
#region Inventory/Asset/Other related packets
|
||||||
case PacketType.RequestImage:
|
case PacketType.RequestImage:
|
||||||
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
|
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
|
||||||
|
//Console.WriteLine("image request: " + Pack.ToString());
|
||||||
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
|
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
|
||||||
{
|
{
|
||||||
m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet);
|
m_assetCache.AddTextureRequest(this, imageRequest.RequestImage[i].Image, imageRequest.RequestImage[i].Packet);
|
||||||
|
@ -363,10 +363,11 @@ namespace OpenSim.Region.ClientStack
|
||||||
m_assetCache.AddAssetRequest(this, transfer);
|
m_assetCache.AddAssetRequest(this, transfer);
|
||||||
break;
|
break;
|
||||||
case PacketType.AssetUploadRequest:
|
case PacketType.AssetUploadRequest:
|
||||||
|
//Console.WriteLine("upload request " + Pack.ToString());
|
||||||
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
||||||
if (OnAssetUploadRequest != null)
|
if (OnAssetUploadRequest != null)
|
||||||
{
|
{
|
||||||
OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData);
|
OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.RequestXfer:
|
case PacketType.RequestXfer:
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment
|
||||||
if (!permission)
|
if (!permission)
|
||||||
SendPermissionError(user, reason);
|
SendPermissionError(user, reason);
|
||||||
|
|
||||||
return true;
|
return permission;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Object Permissions
|
#region Object Permissions
|
||||||
|
|
|
@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (rezAsset != null)
|
if (rezAsset != null)
|
||||||
{
|
{
|
||||||
string script = Util.FieldToString(rezAsset.Data);
|
string script = Util.FieldToString(rezAsset.Data);
|
||||||
// Console.WriteLine("rez script " + script);
|
// Console.WriteLine("rez script " + script);
|
||||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
this.EventManager.TriggerRezScript(localID, copyID, script);
|
||||||
rezzed = true;
|
rezzed = true;
|
||||||
}
|
}
|
||||||
|
@ -270,22 +270,22 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (rezzed)
|
if (rezzed)
|
||||||
{
|
{
|
||||||
bool hasPrim = false;
|
bool hasPrim = false;
|
||||||
foreach (EntityBase ent in Entities.Values)
|
foreach (EntityBase ent in Entities.Values)
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||||
if (hasPrim != false)
|
if (hasPrim != false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
|
||||||
|
((SceneObjectGroup)ent).GetProperites(remoteClient);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
|
|
||||||
((SceneObjectGroup)ent).GetProperites(remoteClient);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
this.phyScene.RemovePrim(rootPart.PhysActor);
|
this.phyScene.RemovePrim(rootPart.PhysActor);
|
||||||
rootPart.PhysActor = null;
|
rootPart.PhysActor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
|
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
|
||||||
((SceneObjectGroup)selectedEnt).DeleteGroup();
|
((SceneObjectGroup)selectedEnt).DeleteGroup();
|
||||||
|
|
||||||
|
@ -415,11 +415,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
this.AddEntity(group);
|
this.AddEntity(group);
|
||||||
group.AbsolutePosition = pos;
|
group.AbsolutePosition = pos;
|
||||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||||
rootPart.PhysActor = phyScene.AddPrim(
|
rootPart.PhysActor = phyScene.AddPrim(
|
||||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
||||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -544,11 +544,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="ownerID"></param>
|
/// <param name="ownerID"></param>
|
||||||
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
|
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||||
{
|
{
|
||||||
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
if (this.PermissionsMngr.CanRezObject(ownerID, pos))
|
||||||
AddEntity(sceneOb);
|
{
|
||||||
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
||||||
rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
AddEntity(sceneOb);
|
||||||
new Axiom.Math.Quaternion());
|
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
||||||
|
rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
||||||
|
new Axiom.Math.Quaternion());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemovePrim(uint localID, LLUUID avatar_deleter)
|
public void RemovePrim(uint localID, LLUUID avatar_deleter)
|
||||||
|
|
|
@ -144,13 +144,15 @@ namespace OpenSim.Region.GridInterfaces.Local
|
||||||
asset.InvType = foundAsset.Type;
|
asset.InvType = foundAsset.Type;
|
||||||
asset.Name = foundAsset.Name;
|
asset.Name = foundAsset.Name;
|
||||||
idata = foundAsset.Data;
|
idata = foundAsset.Data;
|
||||||
|
asset.Data = idata;
|
||||||
|
_receiver.AssetReceived(asset, req.IsTexture);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
asset.FullID = LLUUID.Zero;
|
//asset.FullID = ;
|
||||||
|
_receiver.AssetNotFound(req.AssetID);
|
||||||
}
|
}
|
||||||
asset.Data = idata;
|
|
||||||
_receiver.AssetReceived(asset, req.IsTexture);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
Return += Script;
|
Return += Script;
|
||||||
Return += "} }\r\n";
|
Return += "} }\r\n";
|
||||||
|
|
||||||
|
|
||||||
return Return;
|
return Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue