aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs76
1 files changed, 38 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs b/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
index 2f9ec55..19b2e7b 100644
--- a/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
+++ b/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
@@ -1,38 +1,38 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4 4
5namespace OpenSim.Region.Environment.Modules.VoiceChat 5namespace OpenSim.Region.Environment.Modules.VoiceChat
6{ 6{
7 public class VoicePacketHeader 7 public class VoicePacketHeader
8 { 8 {
9 public byte type; 9 public byte type;
10 public int length; 10 public int length;
11 11
12 public void Parse(byte[] data) 12 public void Parse(byte[] data)
13 { 13 {
14 int offset = 0; 14 int offset = 0;
15 type = data[offset++]; 15 type = data[offset++];
16 16
17 length = data[offset++]; 17 length = data[offset++];
18 length |= data[offset++] << 8; 18 length |= data[offset++] << 8;
19 length |= data[offset++] << 16; 19 length |= data[offset++] << 16;
20 length |= data[offset++] << 24; 20 length |= data[offset++] << 24;
21 } 21 }
22 22
23 public void CopyTo(byte[] data, int offset) 23 public void CopyTo(byte[] data, int offset)
24 { 24 {
25 data[offset + 0] = type; 25 data[offset + 0] = type;
26 26
27 data[offset + 1] = (byte)(length & 0x000000FF); 27 data[offset + 1] = (byte)(length & 0x000000FF);
28 data[offset + 2] = (byte)((length & 0x0000FF00) >> 8); 28 data[offset + 2] = (byte)((length & 0x0000FF00) >> 8);
29 data[offset + 3] = (byte)((length & 0x00FF0000) >> 16); 29 data[offset + 3] = (byte)((length & 0x00FF0000) >> 16);
30 data[offset + 4] = (byte)((length & 0xFF000000) >> 24); 30 data[offset + 4] = (byte)((length & 0xFF000000) >> 24);
31 } 31 }
32 32
33 public int GetLength() 33 public int GetLength()
34 { 34 {
35 return 5; 35 return 5;
36 } 36 }
37 } 37 }
38} 38}