mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
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)
This commit is contained in:
@@ -531,13 +531,19 @@ namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
Encoding enc = Encoding.ASCII;
|
||||
uint FULL_MASK_PERMISSIONS = 2147483647;
|
||||
InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
|
||||
descend.AgentData.AgentID = this.AgentId;
|
||||
descend.AgentData.OwnerID = ownerID;
|
||||
descend.AgentData.FolderID = folderID;
|
||||
descend.AgentData.Descendents = items.Count;
|
||||
descend.AgentData.Version = 0;
|
||||
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
|
||||
InventoryDescendentsPacket descend = this.CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||
|
||||
int count = 0;
|
||||
if (items.Count < 40)
|
||||
{
|
||||
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;
|
||||
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);
|
||||
|
||||
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)
|
||||
{
|
||||
Encoding enc = Encoding.ASCII;
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack
|
||||
#region Inventory/Asset/Other related packets
|
||||
case PacketType.RequestImage:
|
||||
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
|
||||
|
||||
//Console.WriteLine("image request: " + Pack.ToString());
|
||||
for (int i = 0; i < imageRequest.RequestImage.Length; i++)
|
||||
{
|
||||
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);
|
||||
break;
|
||||
case PacketType.AssetUploadRequest:
|
||||
//Console.WriteLine("upload request " + Pack.ToString());
|
||||
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
||||
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;
|
||||
case PacketType.RequestXfer:
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment
|
||||
if (!permission)
|
||||
SendPermissionError(user, reason);
|
||||
|
||||
return true;
|
||||
return permission;
|
||||
}
|
||||
|
||||
#region Object Permissions
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (rezAsset != null)
|
||||
{
|
||||
string script = Util.FieldToString(rezAsset.Data);
|
||||
// Console.WriteLine("rez script " + script);
|
||||
// Console.WriteLine("rez script " + script);
|
||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
||||
rezzed = true;
|
||||
}
|
||||
@@ -270,22 +270,22 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (rezzed)
|
||||
{
|
||||
bool hasPrim = false;
|
||||
foreach (EntityBase ent in Entities.Values)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||
if (hasPrim != false)
|
||||
{
|
||||
bool hasPrim = false;
|
||||
foreach (EntityBase ent in Entities.Values)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||
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);
|
||||
rootPart.PhysActor = null;
|
||||
}
|
||||
|
||||
|
||||
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
|
||||
((SceneObjectGroup)selectedEnt).DeleteGroup();
|
||||
|
||||
@@ -415,11 +415,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
this.AddEntity(group);
|
||||
group.AbsolutePosition = pos;
|
||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.PhysActor = phyScene.AddPrim(
|
||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||
rootPart.PhysActor = phyScene.AddPrim(
|
||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -544,11 +544,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
/// <param name="ownerID"></param>
|
||||
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||
{
|
||||
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
||||
AddEntity(sceneOb);
|
||||
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());
|
||||
if (this.PermissionsMngr.CanRezObject(ownerID, pos))
|
||||
{
|
||||
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
||||
AddEntity(sceneOb);
|
||||
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)
|
||||
|
||||
@@ -144,13 +144,15 @@ namespace OpenSim.Region.GridInterfaces.Local
|
||||
asset.InvType = foundAsset.Type;
|
||||
asset.Name = foundAsset.Name;
|
||||
idata = foundAsset.Data;
|
||||
asset.Data = idata;
|
||||
_receiver.AssetReceived(asset, req.IsTexture);
|
||||
}
|
||||
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 += "} }\r\n";
|
||||
|
||||
|
||||
return Return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user