aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/SimClient.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.cs61
1 files changed, 48 insertions, 13 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index d271ea9..9ae1baf 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -68,6 +68,7 @@ namespace OpenSim
68 private const int MAX_APPENDED_ACKS = 10; 68 private const int MAX_APPENDED_ACKS = 10;
69 private const int RESEND_TIMEOUT = 4000; 69 private const int RESEND_TIMEOUT = 4000;
70 private const int MAX_SEQUENCE = 0xFFFFFF; 70 private const int MAX_SEQUENCE = 0xFFFFFF;
71 private AgentAssetUpload UploadAssets;
71 private LLUUID newAssetFolder = LLUUID.Zero; 72 private LLUUID newAssetFolder = LLUUID.Zero;
72 private bool debug = false; 73 private bool debug = false;
73 74
@@ -278,28 +279,37 @@ namespace OpenSim
278 279
279 break; 280 break;
280 case PacketType.AssetUploadRequest: 281 case PacketType.AssetUploadRequest:
282 //this.debug = true;
281 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; 283 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
282 AssetBase newAsset = OpenSimRoot.Instance.AssetCache.UploadPacket(request, LLUUID.Random()); 284 Console.WriteLine(Pack.ToString());
283 if ((newAsset != null) && (this.newAssetFolder != LLUUID.Zero)) 285 if (request.AssetBlock.Type == 0)
284 { 286 {
285 OpenSimRoot.Instance.InventoryCache.AddNewInventoryItem(this, this.newAssetFolder, newAsset); 287 this.UploadAssets.HandleUploadPacket(request, LLUUID.Random());
288 }
289 else
290 {
291 this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
286 } 292 }
287 293 break;
288 AssetUploadCompletePacket response = new AssetUploadCompletePacket(); 294 case PacketType.SendXferPacket:
289 response.AssetBlock.Type =request.AssetBlock.Type; 295 Console.WriteLine(Pack.ToString());
290 response.AssetBlock.Success = true; 296 this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack);
291 response.AssetBlock.UUID = request.AssetBlock.TransactionID.Combine(this.SecureSessionID);
292
293 this.OutPacket(response);
294 break; 297 break;
295 case PacketType.CreateInventoryFolder: 298 case PacketType.CreateInventoryFolder:
296 //Console.WriteLine(Pack.ToString()); 299 CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
300 OpenSimRoot.Instance.InventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type);
301 Console.WriteLine(Pack.ToString());
297 break; 302 break;
298 case PacketType.CreateInventoryItem: 303 case PacketType.CreateInventoryItem:
299 //Console.WriteLine(Pack.ToString()); 304 Console.WriteLine(Pack.ToString());
305 CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
306 if (createItem.InventoryBlock.TransactionID != LLUUID.Zero)
307 {
308 this.UploadAssets.CreateInventoryItem(createItem);
309 }
300 break; 310 break;
301 case PacketType.FetchInventory: 311 case PacketType.FetchInventory:
302 Console.WriteLine("fetch item packet"); 312 //Console.WriteLine("fetch item packet");
303 FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; 313 FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack;
304 OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory); 314 OpenSimRoot.Instance.InventoryCache.FetchInventory(this, FetchInventory);
305 break; 315 break;
@@ -307,6 +317,29 @@ namespace OpenSim
307 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; 317 FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack;
308 OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch); 318 OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch);
309 break; 319 break;
320 case PacketType.UpdateInventoryItem:
321 /* UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack;
322 for (int i = 0; i < update.InventoryData.Length; i++)
323 {
324 if (update.InventoryData[i].TransactionID != LLUUID.Zero)
325 {
326 AssetBase asset = OpenSimRoot.Instance.AssetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
327 OpenSimRoot.Instance.InventoryCache.UpdateInventoryItem(this, update.InventoryData[i].ItemID, asset);
328 }
329 }*/
330 break;
331 case PacketType.ViewerEffect:
332 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
333 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
334 {
335 if (client.AgentID != this.AgentID)
336 {
337 viewer.AgentData.AgentID = client.AgentID;
338 viewer.AgentData.SessionID = client.SessionID;
339 client.OutPacket(viewer);
340 }
341 }
342 break;
310 case PacketType.DeRezObject: 343 case PacketType.DeRezObject:
311 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet"); 344 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Received DeRezObject packet");
312 OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this); 345 OpenSimRoot.Instance.LocalWorld.DeRezObject((DeRezObjectPacket)Pack, this);
@@ -522,6 +555,8 @@ namespace OpenSim
522 cirpack = initialcirpack; 555 cirpack = initialcirpack;
523 userEP = remoteEP; 556 userEP = remoteEP;
524 PacketQueue = new BlockingQueue<QueItem>(); 557 PacketQueue = new BlockingQueue<QueItem>();
558
559 this.UploadAssets = new AgentAssetUpload(this);
525 AckTimer = new System.Timers.Timer(500); 560 AckTimer = new System.Timers.Timer(500);
526 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); 561 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
527 AckTimer.Start(); 562 AckTimer.Start();