diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs (renamed from OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs) | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs b/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs index 066b19d..69b0c5f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/OutgoingPacket.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -26,31 +26,31 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using OpenSim.Framework; |
30 | using System.Net; | ||
31 | using OpenMetaverse; | 30 | using OpenMetaverse; |
32 | 31 | ||
33 | using ReaderWriterLockImpl = OpenMetaverse.ReaderWriterLockSlim; | ||
34 | |||
35 | namespace OpenSim.Region.ClientStack.LindenUDP | 32 | namespace OpenSim.Region.ClientStack.LindenUDP |
36 | { | 33 | { |
37 | public class LLUtil | 34 | public sealed class OutgoingPacket |
38 | { | 35 | { |
39 | /// <summary> | 36 | /// <summary>Client this packet is destined for</summary> |
40 | /// Convert a string to bytes suitable for use in an LL UDP packet. | 37 | public LLUDPClient Client; |
41 | /// </summary> | 38 | /// <summary>Packet data to send</summary> |
42 | /// <param name="s">Truncated to 254 characters if necessary</param> | 39 | public UDPPacketBuffer Buffer; |
43 | /// <returns></returns> | 40 | /// <summary>Sequence number of the wrapped packet</summary> |
44 | public static byte[] StringToPacketBytes(string s) | 41 | public uint SequenceNumber; |
42 | /// <summary>Number of times this packet has been resent</summary> | ||
43 | public int ResendCount; | ||
44 | /// <summary>Environment.TickCount when this packet was last sent over the wire</summary> | ||
45 | public int TickCount; | ||
46 | /// <summary>Category this packet belongs to</summary> | ||
47 | public ThrottleOutPacketType Category; | ||
48 | |||
49 | public OutgoingPacket(LLUDPClient client, UDPPacketBuffer buffer, ThrottleOutPacketType category) | ||
45 | { | 50 | { |
46 | // Anything more than 254 will cause libsecondlife to barf | 51 | Client = client; |
47 | // (libsl 1550) adds an \0 on the Utils.StringToBytes conversion if it isn't present | 52 | Buffer = buffer; |
48 | if (s.Length > 254) | 53 | Category = category; |
49 | { | ||
50 | s = s.Remove(254); | ||
51 | } | ||
52 | |||
53 | return Utils.StringToBytes(s); | ||
54 | } | 54 | } |
55 | } | 55 | } |
56 | } | 56 | } |