aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-03-31 09:14:07 +0000
committerMW2007-03-31 09:14:07 +0000
commit8c5b51b7c0999de87641163b107071e3b1a410fb (patch)
tree4760dc5aff1d2ae0e963977d9d5a76ea8e2a4fc8
parent* cleared some unused code away (diff)
downloadopensim-SC_OLD-8c5b51b7c0999de87641163b107071e3b1a410fb.zip
opensim-SC_OLD-8c5b51b7c0999de87641163b107071e3b1a410fb.tar.gz
opensim-SC_OLD-8c5b51b7c0999de87641163b107071e3b1a410fb.tar.bz2
opensim-SC_OLD-8c5b51b7c0999de87641163b107071e3b1a410fb.tar.xz
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/AgentAssetUpload.cs79
-rw-r--r--OpenSim.RegionServer/SimClient.cs28
2 files changed, 57 insertions, 50 deletions
diff --git a/OpenSim.RegionServer/AgentAssetUpload.cs b/OpenSim.RegionServer/AgentAssetUpload.cs
index 722da53..491d50b 100644
--- a/OpenSim.RegionServer/AgentAssetUpload.cs
+++ b/OpenSim.RegionServer/AgentAssetUpload.cs
@@ -74,29 +74,29 @@ namespace OpenSim
74 AssetBase asset = null; 74 AssetBase asset = null;
75 if (pack.AssetBlock.Type == 0) 75 if (pack.AssetBlock.Type == 0)
76 { 76 {
77 77
78 //first packet for transaction 78 //first packet for transaction
79 asset = new AssetBase(); 79 asset = new AssetBase();
80 asset.FullID = assetID; 80 asset.FullID = assetID;
81 asset.Type = pack.AssetBlock.Type; 81 asset.Type = pack.AssetBlock.Type;
82 asset.InvType = asset.Type; 82 asset.InvType = asset.Type;
83 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); 83 asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000");
84 asset.Data = pack.AssetBlock.AssetData; 84 asset.Data = pack.AssetBlock.AssetData;
85 85
86 86
87 } 87 }
88 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7) 88 else if (pack.AssetBlock.Type == 13 | pack.AssetBlock.Type == 5 | pack.AssetBlock.Type == 7)
89 { 89 {
90 90
91 asset = new AssetBase(); 91 asset = new AssetBase();
92 asset.FullID = assetID; 92 asset.FullID = assetID;
93 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated()); 93 // Console.WriteLine("skin asset id is " + assetID.ToStringHyphenated());
94 asset.Type = pack.AssetBlock.Type; 94 asset.Type = pack.AssetBlock.Type;
95 asset.InvType = asset.Type ; 95 asset.InvType = asset.Type;
96 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000"); 96 asset.Name = "NewClothing" + Util.RandomClass.Next(1, 1000).ToString("000");
97 asset.Data = pack.AssetBlock.AssetData; 97 asset.Data = pack.AssetBlock.AssetData;
98 98
99 99
100 } 100 }
101 101
102 if (asset != null) 102 if (asset != null)
@@ -105,7 +105,7 @@ namespace OpenSim
105 } 105 }
106 else 106 else
107 { 107 {
108 108
109 //currently we don't support this asset type 109 //currently we don't support this asset type
110 //so lets just tell the client that the upload is complete 110 //so lets just tell the client that the upload is complete
111 AssetUploadCompletePacket response = new AssetUploadCompletePacket(); 111 AssetUploadCompletePacket response = new AssetUploadCompletePacket();
@@ -136,8 +136,8 @@ namespace OpenSim
136 } 136 }
137 else 137 else
138 { 138 {
139 byte[] newArray = new byte[xferPacket.DataPacket.Data.Length-4]; 139 byte[] newArray = new byte[xferPacket.DataPacket.Data.Length - 4];
140 Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length-4); 140 Array.Copy(xferPacket.DataPacket.Data, 4, newArray, 0, xferPacket.DataPacket.Data.Length - 4);
141 trans.Asset.Data = newArray; 141 trans.Asset.Data = newArray;
142 } 142 }
143 143
@@ -155,11 +155,11 @@ namespace OpenSim
155 //check if we should add it to inventory 155 //check if we should add it to inventory
156 if (trans.AddToInventory) 156 if (trans.AddToInventory)
157 { 157 {
158 // m_assetCache.AddAsset(trans.Asset); 158 // m_assetCache.AddAsset(trans.Asset);
159 m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset); 159 m_inventoryCache.AddNewInventoryItem(this.ourClient, trans.InventFolder, trans.Asset);
160 } 160 }
161 161
162 162
163 } 163 }
164 break; 164 break;
165 } 165 }
@@ -178,7 +178,7 @@ namespace OpenSim
178 public AssetBase AddUploadToAssetCache(LLUUID transactionID) 178 public AssetBase AddUploadToAssetCache(LLUUID transactionID)
179 { 179 {
180 AssetBase asset = null; 180 AssetBase asset = null;
181 if(this.transactions.ContainsKey(transactionID)) 181 if (this.transactions.ContainsKey(transactionID))
182 { 182 {
183 AssetTransaction trans = this.transactions[transactionID]; 183 AssetTransaction trans = this.transactions[transactionID];
184 if (trans.UploadComplete) 184 if (trans.UploadComplete)
@@ -193,7 +193,7 @@ namespace OpenSim
193 193
194 public void CreateInventoryItem(CreateInventoryItemPacket packet) 194 public void CreateInventoryItem(CreateInventoryItemPacket packet)
195 { 195 {
196 if(this.transactions.ContainsKey(packet.InventoryBlock.TransactionID)) 196 if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
197 { 197 {
198 AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID]; 198 AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
199 trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description); 199 trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
@@ -204,7 +204,7 @@ namespace OpenSim
204 { 204 {
205 //already complete so we can add it to the inventory 205 //already complete so we can add it to the inventory
206 //m_assetCache.AddAsset(trans.Asset); 206 //m_assetCache.AddAsset(trans.Asset);
207 Console.WriteLine( "Item created is " +m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated()); 207 Console.WriteLine("Item created is " + m_inventoryCache.AddNewInventoryItem(this.ourClient, packet.InventoryBlock.FolderID, trans.Asset).ToStringHyphenated());
208 } 208 }
209 else 209 else
210 { 210 {
@@ -214,20 +214,19 @@ namespace OpenSim
214 } 214 }
215 } 215 }
216 216
217 } 217 private class AssetTransaction
218
219 public class AssetTransaction
220 {
221 public uint XferID;
222 public AssetBase Asset;
223 public bool AddToInventory;
224 public LLUUID InventFolder = LLUUID.Zero;
225 public bool UploadComplete = false;
226 public LLUUID TransactionID = LLUUID.Zero;
227
228 public AssetTransaction()
229 { 218 {
219 public uint XferID;
220 public AssetBase Asset;
221 public bool AddToInventory;
222 public LLUUID InventFolder = LLUUID.Zero;
223 public bool UploadComplete = false;
224 public LLUUID TransactionID = LLUUID.Zero;
225
226 public AssetTransaction()
227 {
230 228
229 }
231 } 230 }
232 } 231 }
233} 232}
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index 9649e14..f8affb9 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -426,6 +426,8 @@ namespace OpenSim
426 break; 426 break;
427 case PacketType.ModifyLand: 427 case PacketType.ModifyLand:
428 ModifyLandPacket modify = (ModifyLandPacket)Pack; 428 ModifyLandPacket modify = (ModifyLandPacket)Pack;
429 //Console.WriteLine("terraform: number of parcel data blocks" + modify.ParcelData.Length);
430
429 switch (modify.ModifyBlock.Action) 431 switch (modify.ModifyBlock.Action)
430 { 432 {
431 case 1: 433 case 1:
@@ -433,11 +435,14 @@ namespace OpenSim
433 { 435 {
434 int mody = (int) modify.ParcelData[0].North; 436 int mody = (int) modify.ParcelData[0].North;
435 int modx = (int) modify.ParcelData[0].West; 437 int modx = (int) modify.ParcelData[0].West;
436 this.m_world.LandMap[(mody * 256) + modx -1 ] += 0.1f; 438 // Console.WriteLine("height in packet is " + modify.ModifyBlock.Height.ToString());
437 this.m_world.LandMap[(mody * 256) + modx] += 0.2f; 439 // Console.WriteLine("current height at that point is " + this.m_world.LandMap[(mody * 256) + modx].ToString());
438 this.m_world.LandMap[(mody * 256) + modx + 1] += 0.1f; 440
439 this.m_world.LandMap[((mody+1) * 256) + modx] += 0.1f; 441 this.m_world.LandMap[(mody * 256) + modx -1 ] += 0.05f;
440 this.m_world.LandMap[((mody -1) * 256) + modx] += 0.1f; 442 this.m_world.LandMap[(mody * 256) + modx] += 0.1f;
443 this.m_world.LandMap[(mody * 256) + modx + 1] += 0.05f;
444 this.m_world.LandMap[((mody+1) * 256) + modx] += 0.05f;
445 this.m_world.LandMap[((mody -1) * 256) + modx] += 0.05f;
441 m_world.RegenerateTerrain(true, modx, mody); 446 m_world.RegenerateTerrain(true, modx, mody);
442 } 447 }
443 break; 448 break;
@@ -446,11 +451,14 @@ namespace OpenSim
446 { 451 {
447 int mody = (int)modify.ParcelData[0].North; 452 int mody = (int)modify.ParcelData[0].North;
448 int modx = (int)modify.ParcelData[0].West; 453 int modx = (int)modify.ParcelData[0].West;
449 this.m_world.LandMap[(mody * 256) + modx - 1] -= 0.1f; 454 // Console.WriteLine("height in packet is " + modify.ModifyBlock.Height.ToString());
450 this.m_world.LandMap[(mody * 256) + modx] -= 0.2f; 455 // Console.WriteLine("current height at that point is " + this.m_world.LandMap[(mody * 256) + modx].ToString());
451 this.m_world.LandMap[(mody * 256) + modx + 1] -= 0.1f; 456
452 this.m_world.LandMap[((mody + 1) * 256) + modx] -= 0.1f; 457 this.m_world.LandMap[(mody * 256) + modx - 1] -= 0.05f;
453 this.m_world.LandMap[((mody - 1) * 256) + modx] -= 0.1f; 458 this.m_world.LandMap[(mody * 256) + modx] -= 0.1f;
459 this.m_world.LandMap[(mody * 256) + modx + 1] -= 0.05f;
460 this.m_world.LandMap[((mody + 1) * 256) + modx] -= 0.05f;
461 this.m_world.LandMap[((mody - 1) * 256) + modx] -= 0.05f;
454 m_world.RegenerateTerrain(true, modx, mody); 462 m_world.RegenerateTerrain(true, modx, mody);
455 } 463 }
456 break; 464 break;