diff options
author | Teravus Ovares | 2007-11-18 15:54:05 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-18 15:54:05 +0000 |
commit | 615b40b68b2311433b855f8c1e961a8b71eb9b65 (patch) | |
tree | ce9620d6f9e59e5e841f9746d738f6a71063eae4 /OpenSim/Framework | |
parent | cleaned up some mono compiler warnings (diff) | |
download | opensim-SC-615b40b68b2311433b855f8c1e961a8b71eb9b65.zip opensim-SC-615b40b68b2311433b855f8c1e961a8b71eb9b65.tar.gz opensim-SC-615b40b68b2311433b855f8c1e961a8b71eb9b65.tar.bz2 opensim-SC-615b40b68b2311433b855f8c1e961a8b71eb9b65.tar.xz |
* Refactored IClientAPI.OutPacket to require a second mandatory parameter. This parameter has an enum:int ThrottleOutPacketType and contains types; Resend, Land, Wind, Cloud, Task, Texture, and Asset.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/ClientManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 16 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetTransactions.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 12 |
4 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index e34c051..629aab5 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs | |||
@@ -122,7 +122,7 @@ namespace OpenSim.Framework | |||
122 | { | 122 | { |
123 | packet.AgentData.AgentID = client.AgentId; | 123 | packet.AgentData.AgentID = client.AgentId; |
124 | packet.AgentData.SessionID = client.SessionId; | 124 | packet.AgentData.SessionID = client.SessionId; |
125 | client.OutPacket(packet); | 125 | client.OutPacket(packet,ThrottleOutPacketType.Task); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | } | 128 | } |
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 99041c1..edca142 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -520,7 +520,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
520 | } | 520 | } |
521 | Transfer.TransferInfo.Size = (int) req.AssetInf.Data.Length; | 521 | Transfer.TransferInfo.Size = (int) req.AssetInf.Data.Length; |
522 | Transfer.TransferInfo.TransferID = req.TransferRequestID; | 522 | Transfer.TransferInfo.TransferID = req.TransferRequestID; |
523 | req.RequestUser.OutPacket(Transfer); | 523 | req.RequestUser.OutPacket(Transfer,ThrottleOutPacketType.Asset); |
524 | 524 | ||
525 | if (req.NumPackets == 1) | 525 | if (req.NumPackets == 1) |
526 | { | 526 | { |
@@ -530,7 +530,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
530 | TransferPacket.TransferData.TransferID = req.TransferRequestID; | 530 | TransferPacket.TransferData.TransferID = req.TransferRequestID; |
531 | TransferPacket.TransferData.Data = req.AssetInf.Data; | 531 | TransferPacket.TransferData.Data = req.AssetInf.Data; |
532 | TransferPacket.TransferData.Status = 1; | 532 | TransferPacket.TransferData.Status = 1; |
533 | req.RequestUser.OutPacket(TransferPacket); | 533 | req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); |
534 | } | 534 | } |
535 | else | 535 | else |
536 | { | 536 | { |
@@ -546,7 +546,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
546 | Array.Copy(req.AssetInf.Data, chunk, req.AssetInf.Data.Length); | 546 | Array.Copy(req.AssetInf.Data, chunk, req.AssetInf.Data.Length); |
547 | TransferPacket.TransferData.Data = chunk; | 547 | TransferPacket.TransferData.Data = chunk; |
548 | TransferPacket.TransferData.Status = 1; | 548 | TransferPacket.TransferData.Status = 1; |
549 | req.RequestUser.OutPacket(TransferPacket); | 549 | req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); |
550 | } | 550 | } |
551 | else | 551 | else |
552 | { | 552 | { |
@@ -555,7 +555,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
555 | 555 | ||
556 | TransferPacket.TransferData.Data = chunk; | 556 | TransferPacket.TransferData.Data = chunk; |
557 | TransferPacket.TransferData.Status = 0; | 557 | TransferPacket.TransferData.Status = 0; |
558 | req.RequestUser.OutPacket(TransferPacket); | 558 | req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); |
559 | 559 | ||
560 | TransferPacket = new TransferPacketPacket(); | 560 | TransferPacket = new TransferPacketPacket(); |
561 | TransferPacket.TransferData.Packet = 1; | 561 | TransferPacket.TransferData.Packet = 1; |
@@ -565,7 +565,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
565 | Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length); | 565 | Array.Copy(req.AssetInf.Data, 1000, chunk1, 0, chunk1.Length); |
566 | TransferPacket.TransferData.Data = chunk1; | 566 | TransferPacket.TransferData.Data = chunk1; |
567 | TransferPacket.TransferData.Status = 1; | 567 | TransferPacket.TransferData.Status = 1; |
568 | req.RequestUser.OutPacket(TransferPacket); | 568 | req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); |
569 | } | 569 | } |
570 | } | 570 | } |
571 | } | 571 | } |
@@ -741,7 +741,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
741 | im.ImageID.Size = (uint) req.ImageInfo.Data.Length; | 741 | im.ImageID.Size = (uint) req.ImageInfo.Data.Length; |
742 | im.ImageData.Data = req.ImageInfo.Data; | 742 | im.ImageData.Data = req.ImageInfo.Data; |
743 | im.ImageID.Codec = 2; | 743 | im.ImageID.Codec = 2; |
744 | req.RequestUser.OutPacket(im); | 744 | req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); |
745 | req.PacketCounter++; | 745 | req.PacketCounter++; |
746 | //req.ImageInfo.l= time; | 746 | //req.ImageInfo.l= time; |
747 | //System.Console.WriteLine("sent texture: " + req.ImageInfo.FullID); | 747 | //System.Console.WriteLine("sent texture: " + req.ImageInfo.FullID); |
@@ -758,7 +758,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
758 | im.ImageData.Data = new byte[600]; | 758 | im.ImageData.Data = new byte[600]; |
759 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); | 759 | Array.Copy(req.ImageInfo.Data, 0, im.ImageData.Data, 0, 600); |
760 | im.ImageID.Codec = 2; | 760 | im.ImageID.Codec = 2; |
761 | req.RequestUser.OutPacket(im); | 761 | req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); |
762 | 762 | ||
763 | req.PacketCounter++; | 763 | req.PacketCounter++; |
764 | //req.ImageInfo.last_used = time; | 764 | //req.ImageInfo.last_used = time; |
@@ -780,7 +780,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
780 | //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size); | 780 | //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size); |
781 | im.ImageData.Data = new byte[size]; | 781 | im.ImageData.Data = new byte[size]; |
782 | Array.Copy(req.ImageInfo.Data, 600 + (1000*(req.PacketCounter - 1)), im.ImageData.Data, 0, size); | 782 | Array.Copy(req.ImageInfo.Data, 600 + (1000*(req.PacketCounter - 1)), im.ImageData.Data, 0, size); |
783 | req.RequestUser.OutPacket(im); | 783 | req.RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); |
784 | req.PacketCounter++; | 784 | req.PacketCounter++; |
785 | //req.ImageInfo.last_used = time; | 785 | //req.ImageInfo.last_used = time; |
786 | //System.Console.WriteLine("sent a packet of texture: "+req.ImageInfo.FullID); | 786 | //System.Console.WriteLine("sent a packet of texture: "+req.ImageInfo.FullID); |
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 9e9ec05..acd57b6 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
221 | ConfirmXferPacketPacket newPack = new ConfirmXferPacketPacket(); | 221 | ConfirmXferPacketPacket newPack = new ConfirmXferPacketPacket(); |
222 | newPack.XferID.ID = xferID; | 222 | newPack.XferID.ID = xferID; |
223 | newPack.XferID.Packet = packetID; | 223 | newPack.XferID.Packet = packetID; |
224 | ourClient.OutPacket(newPack); | 224 | ourClient.OutPacket(newPack, ThrottleOutPacketType.Asset); |
225 | if ((packetID & 0x80000000) != 0) | 225 | if ((packetID & 0x80000000) != 0) |
226 | { | 226 | { |
227 | SendCompleteMessage(); | 227 | SendCompleteMessage(); |
@@ -262,7 +262,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
262 | newPack.XferID.VFileID = Asset.FullID; | 262 | newPack.XferID.VFileID = Asset.FullID; |
263 | newPack.XferID.FilePath = 0; | 263 | newPack.XferID.FilePath = 0; |
264 | newPack.XferID.Filename = new byte[0]; | 264 | newPack.XferID.Filename = new byte[0]; |
265 | ourClient.OutPacket(newPack); | 265 | ourClient.OutPacket(newPack, ThrottleOutPacketType.Asset); |
266 | } | 266 | } |
267 | 267 | ||
268 | protected void SendCompleteMessage() | 268 | protected void SendCompleteMessage() |
@@ -272,7 +272,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
272 | newPack.AssetBlock.Type = Asset.Type; | 272 | newPack.AssetBlock.Type = Asset.Type; |
273 | newPack.AssetBlock.Success = true; | 273 | newPack.AssetBlock.Success = true; |
274 | newPack.AssetBlock.UUID = Asset.FullID; | 274 | newPack.AssetBlock.UUID = Asset.FullID; |
275 | ourClient.OutPacket(newPack); | 275 | ourClient.OutPacket(newPack, ThrottleOutPacketType.Asset); |
276 | m_finished = true; | 276 | m_finished = true; |
277 | if (m_createItem) | 277 | if (m_createItem) |
278 | { | 278 | { |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 23181bf..0e8b82d 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -54,6 +54,16 @@ namespace OpenSim.Framework | |||
54 | StopTyping = 5, | 54 | StopTyping = 5, |
55 | Broadcast = 0xFF | 55 | Broadcast = 0xFF |
56 | } ; | 56 | } ; |
57 | public enum ThrottleOutPacketType : int | ||
58 | { | ||
59 | Resend = 0, | ||
60 | Land = 1, | ||
61 | Wind = 2, | ||
62 | Cloud = 3, | ||
63 | Task = 4, | ||
64 | Texture = 5, | ||
65 | Asset = 6 | ||
66 | } | ||
57 | 67 | ||
58 | /// <summary> | 68 | /// <summary> |
59 | /// ChatFromViewer Arguments | 69 | /// ChatFromViewer Arguments |
@@ -378,7 +388,7 @@ namespace OpenSim.Framework | |||
378 | 388 | ||
379 | uint CircuitCode { get; set; } | 389 | uint CircuitCode { get; set; } |
380 | 390 | ||
381 | void OutPacket(Packet newPack); | 391 | void OutPacket(Packet newPack, ThrottleOutPacketType packType); |
382 | void SendWearables(AvatarWearable[] wearables, int serial); | 392 | void SendWearables(AvatarWearable[] wearables, int serial); |
383 | void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); | 393 | void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); |
384 | void SendStartPingCheck(byte seq); | 394 | void SendStartPingCheck(byte seq); |