Hopefully fixed the texture uploading and the crashing when a prim with a uploaded texture on it is moved.
parent
fb9562e419
commit
84c2a72140
|
@ -20,7 +20,6 @@ namespace OpenSim
|
||||||
|
|
||||||
public void AddUpload(LLUUID transactionID, AssetBase asset)
|
public void AddUpload(LLUUID transactionID, AssetBase asset)
|
||||||
{
|
{
|
||||||
Console.WriteLine("adding upload asset");
|
|
||||||
AssetTransaction upload = new AssetTransaction();
|
AssetTransaction upload = new AssetTransaction();
|
||||||
lock (this.transactions)
|
lock (this.transactions)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +39,6 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine(" no data in upload request so use xfer system");
|
|
||||||
upload.UploadComplete = false;
|
upload.UploadComplete = false;
|
||||||
upload.XferID = Util.GetNextXferID();
|
upload.XferID = Util.GetNextXferID();
|
||||||
RequestXferPacket xfer = new RequestXferPacket();
|
RequestXferPacket xfer = new RequestXferPacket();
|
||||||
|
@ -155,7 +153,7 @@ namespace OpenSim
|
||||||
OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
|
OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine(Helpers.FieldToString(trans.Asset.Data));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +181,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
//already complete so we can add it to the inventory
|
//already complete so we can add it to the inventory
|
||||||
OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset);
|
OpenSimRoot.Instance.AssetCache.AddAsset(trans.Asset);
|
||||||
OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset);
|
Console.WriteLine( "ITem created is " +OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,17 +139,23 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
public void AddAsset(AssetBase asset)
|
public void AddAsset(AssetBase asset)
|
||||||
{
|
{
|
||||||
this._assetServer.UploadNewAsset(asset);
|
|
||||||
if (asset.Type == 0)
|
if (asset.Type == 0)
|
||||||
{
|
{
|
||||||
//texture
|
if (!this.Textures.ContainsKey(asset.FullID))
|
||||||
TextureImage textur = new TextureImage(asset);
|
{ //texture
|
||||||
this.Textures.Add(textur.FullID, textur);
|
TextureImage textur = new TextureImage(asset);
|
||||||
|
this.Textures.Add(textur.FullID, textur);
|
||||||
|
this._assetServer.UploadNewAsset(asset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AssetInfo assetInf = new AssetInfo(asset);
|
if (!this.Assets.ContainsKey(asset.FullID))
|
||||||
this.Assets.Add(assetInf.FullID, assetInf);
|
{
|
||||||
|
AssetInfo assetInf = new AssetInfo(asset);
|
||||||
|
this.Assets.Add(assetInf.FullID, assetInf);
|
||||||
|
this._assetServer.UploadNewAsset(asset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,10 +191,10 @@ namespace OpenSim.Assets
|
||||||
InventoryReply.InventoryData[0].AssetID = Item.AssetID;
|
InventoryReply.InventoryData[0].AssetID = Item.AssetID;
|
||||||
InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
|
InventoryReply.InventoryData[0].CreatorID = Item.CreatorID;
|
||||||
InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].CreationDate = 1000;
|
InventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
|
InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
|
||||||
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].Flags = 1;
|
InventoryReply.InventoryData[0].Flags = 0;
|
||||||
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
||||||
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||||
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
||||||
|
@ -228,7 +228,7 @@ namespace OpenSim.Assets
|
||||||
InventoryReply.InventoryData[0].CreationDate = 1000;
|
InventoryReply.InventoryData[0].CreationDate = 1000;
|
||||||
InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
|
InventoryReply.InventoryData[0].Description = _enc.GetBytes(Item.Description + "\0");
|
||||||
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS;
|
||||||
InventoryReply.InventoryData[0].Flags = 1;
|
InventoryReply.InventoryData[0].Flags = 0;
|
||||||
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
InventoryReply.InventoryData[0].FolderID = Item.FolderID;
|
||||||
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||||
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
InventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS;
|
||||||
|
|
|
@ -281,15 +281,15 @@ namespace OpenSim
|
||||||
case PacketType.AssetUploadRequest:
|
case PacketType.AssetUploadRequest:
|
||||||
//this.debug = true;
|
//this.debug = true;
|
||||||
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
||||||
Console.WriteLine(Pack.ToString());
|
// Console.WriteLine(Pack.ToString());
|
||||||
if (request.AssetBlock.Type == 0)
|
// if (request.AssetBlock.Type == 0)
|
||||||
{
|
// {
|
||||||
this.UploadAssets.HandleUploadPacket(request, LLUUID.Random());
|
//this.UploadAssets.HandleUploadPacket(request, LLUUID.Random());
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{*/
|
||||||
this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
|
this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
|
||||||
}
|
//}
|
||||||
break;
|
break;
|
||||||
case PacketType.SendXferPacket:
|
case PacketType.SendXferPacket:
|
||||||
Console.WriteLine(Pack.ToString());
|
Console.WriteLine(Pack.ToString());
|
||||||
|
|
|
@ -220,7 +220,8 @@ namespace OpenSim.world
|
||||||
|
|
||||||
public void UpdateTexture(byte[] tex)
|
public void UpdateTexture(byte[] tex)
|
||||||
{
|
{
|
||||||
this.primData.Texture = this.OurPacket.ObjectData[0].TextureEntry = tex;
|
this.OurPacket.ObjectData[0].TextureEntry = tex;
|
||||||
|
this.primData.Texture = tex;
|
||||||
this.dirtyFlag = true;
|
this.dirtyFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,8 +402,9 @@ namespace OpenSim.world
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
|
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
|
||||||
dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry;
|
//dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry;
|
||||||
|
dat.TextureEntry = new byte[0];
|
||||||
|
//Console.WriteLine("texture-entry length in improvedterse block is " + this.OurPacket.ObjectData[0].TextureEntry.Length);
|
||||||
bytes[i++] = (byte)(ID % 256);
|
bytes[i++] = (byte)(ID % 256);
|
||||||
bytes[i++] = (byte)((ID >> 8) % 256);
|
bytes[i++] = (byte)((ID >> 8) % 256);
|
||||||
bytes[i++] = (byte)((ID >> 16) % 256);
|
bytes[i++] = (byte)((ID >> 16) % 256);
|
||||||
|
|
Loading…
Reference in New Issue