0.1-prestable
MW 2007-03-31 09:14:07 +00:00
parent 020fe9a214
commit 8c5b51b7c0
2 changed files with 55 additions and 48 deletions

View File

@ -75,26 +75,26 @@ namespace OpenSim
if (pack.AssetBlock.Type == 0) if (pack.AssetBlock.Type == 0)
{ {
//first packet for transaction //first packet for transaction
asset = new AssetBase(); asset = new AssetBase();
asset.FullID = assetID; asset.FullID = assetID;
asset.Type = pack.AssetBlock.Type; asset.Type = pack.AssetBlock.Type;
asset.InvType = asset.Type; asset.InvType = asset.Type;
asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
asset.Data = pack.AssetBlock.AssetData; asset.Data = pack.AssetBlock.AssetData;
} }
else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7) else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7)
{ {
asset = new AssetBase(); asset = new AssetBase();
asset.FullID = assetID; asset.FullID = assetID;
// Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated()); // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
asset.Type = pack.AssetBlock.Type; asset.Type = pack.AssetBlock.Type;
asset.InvType = asset.Type ; asset.InvType = asset.Type;
asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000"); asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
asset.Data = pack.AssetBlock.AssetData; asset.Data = pack.AssetBlock.AssetData;
} }
@ -136,8 +136,8 @@ namespace OpenSim
} }
else else
{ {
byte[] newArray = new byte[xferPacket.DataPacket.Data.Length-4]; byte[] newArray = new byte[xferPacket.DataPacket.Data.Length - 4];
Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length-4); Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length - 4);
trans.Asset.Data = newArray; trans.Asset.Data = newArray;
} }
@ -155,7 +155,7 @@ namespace OpenSim
//check if we should add it to inventory //check if we should add it to inventory
if (trans.AddToInventory) if (trans.AddToInventory)
{ {
// m_assetCache.AddAsset(trans.Asset); // m_assetCache.AddAsset(trans.Asset);
m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
} }
@ -178,7 +178,7 @@ namespace OpenSim
public AssetBase AddUploadToAssetCache(LLUUID transactionID) public AssetBase AddUploadToAssetCache(LLUUID transactionID)
{ {
AssetBase asset = null; AssetBase asset = null;
if(this.transactions.ContainsKey(transactionID)) if (this.transactions.ContainsKey(transactionID))
{ {
AssetTransaction trans = this.transactions[transactionID]; AssetTransaction trans = this.transactions[transactionID];
if (trans.UploadComplete) if (trans.UploadComplete)
@ -193,7 +193,7 @@ namespace OpenSim
public void CreateInventoryItem(CreateInventoryItemPacket packet) public void CreateInventoryItem(CreateInventoryItemPacket packet)
{ {
if(this.transactions.ContainsKey(packet.InventoryBlock.TransactionID)) if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
{ {
AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID]; AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description); trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
@ -204,7 +204,7 @@ namespace OpenSim
{ {
//already complete so we can add it to the inventory //already complete so we can add it to the inventory
//m_assetCache.AddAsset(trans.Asset); //m_assetCache.AddAsset(trans.Asset);
Console.WriteLine( "Item created is " +m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated()); Console.WriteLine("Item created is " + m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated());
} }
else else
{ {
@ -214,20 +214,19 @@ namespace OpenSim
} }
} }
} private class AssetTransaction
public class AssetTransaction
{
public uint XferID;
public AssetBase Asset;
public bool AddToInventory;
public LLUUID InventFolder = LLUUID.Zero;
public bool UploadComplete = false;
public LLUUID TransactionID = LLUUID.Zero;
public AssetTransaction()
{ {
public uint XferID;
public AssetBase Asset;
public bool AddToInventory;
public LLUUID InventFolder = LLUUID.Zero;
public bool UploadComplete = false;
public LLUUID TransactionID = LLUUID.Zero;
public AssetTransaction()
{
}
} }
} }
} }

View File

@ -426,6 +426,8 @@ namespace OpenSim
break; break;
case PacketType.ModifyLand: case PacketType.ModifyLand:
ModifyLandPacket modify = (ModifyLandPacket)Pack; ModifyLandPacket modify = (ModifyLandPacket)Pack;
//Console.WriteLine("terraform: number of parcel data blocks" + modify.ParcelData.Length);
switch (modify.ModifyBlock.Action) switch (modify.ModifyBlock.Action)
{ {
case 1: case 1:
@ -433,11 +435,14 @@ namespace OpenSim
{ {
int mody = (int) modify.ParcelData[0].North; int mody = (int) modify.ParcelData[0].North;
int modx = (int) modify.ParcelData[0].West; int modx = (int) modify.ParcelData[0].West;
this.m_world.LandMap[(mody * 256) + modx -1 ] += 0.1f; // Console.WriteLine("height in packet is " + modify.ModifyBlock.Height.ToString());
this.m_world.LandMap[(mody * 256) + modx] += 0.2f; // Console.WriteLine("current height at that point is " + this.m_world.LandMap[(mody * 256) + modx].ToString());
this.m_world.LandMap[(mody * 256) + modx + 1] += 0.1f;
this.m_world.LandMap[((mody+1) * 256) + modx] += 0.1f; this.m_world.LandMap[(mody * 256) + modx -1 ] += 0.05f;
this.m_world.LandMap[((mody -1) * 256) + modx] += 0.1f; this.m_world.LandMap[(mody * 256) + modx] += 0.1f;
this.m_world.LandMap[(mody * 256) + modx + 1] += 0.05f;
this.m_world.LandMap[((mody+1) * 256) + modx] += 0.05f;
this.m_world.LandMap[((mody -1) * 256) + modx] += 0.05f;
m_world.RegenerateTerrain(true, modx, mody); m_world.RegenerateTerrain(true, modx, mody);
} }
break; break;
@ -446,11 +451,14 @@ namespace OpenSim
{ {
int mody = (int)modify.ParcelData[0].North; int mody = (int)modify.ParcelData[0].North;
int modx = (int)modify.ParcelData[0].West; int modx = (int)modify.ParcelData[0].West;
this.m_world.LandMap[(mody * 256) + modx - 1] -= 0.1f; // Console.WriteLine("height in packet is " + modify.ModifyBlock.Height.ToString());
this.m_world.LandMap[(mody * 256) + modx] -= 0.2f; // Console.WriteLine("current height at that point is " + this.m_world.LandMap[(mody * 256) + modx].ToString());
this.m_world.LandMap[(mody * 256) + modx + 1] -= 0.1f;
this.m_world.LandMap[((mody + 1) * 256) + modx] -= 0.1f; this.m_world.LandMap[(mody * 256) + modx - 1] -= 0.05f;
this.m_world.LandMap[((mody - 1) * 256) + modx] -= 0.1f; this.m_world.LandMap[(mody * 256) + modx] -= 0.1f;
this.m_world.LandMap[(mody * 256) + modx + 1] -= 0.05f;
this.m_world.LandMap[((mody + 1) * 256) + modx] -= 0.05f;
this.m_world.LandMap[((mody - 1) * 256) + modx] -= 0.05f;
m_world.RegenerateTerrain(true, modx, mody); m_world.RegenerateTerrain(true, modx, mody);
} }
break; break;