aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-02-26 10:46:59 +0000
committerAdam Frisby2008-02-26 10:46:59 +0000
commit16d63d9fb8783e8352bb29cda272f4f224c67863 (patch)
tree3257bdd47f7bd5ac43f9d645c1feb9c9ae1241af /OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
parent* Added base thread pool based presence informing to the message server. (diff)
downloadopensim-SC-16d63d9fb8783e8352bb29cda272f4f224c67863.zip
opensim-SC-16d63d9fb8783e8352bb29cda272f4f224c67863.tar.gz
opensim-SC-16d63d9fb8783e8352bb29cda272f4f224c67863.tar.bz2
opensim-SC-16d63d9fb8783e8352bb29cda272f4f224c67863.tar.xz
* Added support for RealXtend Voice Chat as a Region Module to OpenSim Trunk. Enabled via [VoiceChat] enabled=true in OpenSim.ini
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs b/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
new file mode 100644
index 0000000..2f9ec55
--- /dev/null
+++ b/OpenSim/Region/Environment/Modules/VoiceChat/VoicePacketHeader.cs
@@ -0,0 +1,38 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Region.Environment.Modules.VoiceChat
6{
7 public class VoicePacketHeader
8 {
9 public byte type;
10 public int length;
11
12 public void Parse(byte[] data)
13 {
14 int offset = 0;
15 type = data[offset++];
16
17 length = data[offset++];
18 length |= data[offset++] << 8;
19 length |= data[offset++] << 16;
20 length |= data[offset++] << 24;
21 }
22
23 public void CopyTo(byte[] data, int offset)
24 {
25 data[offset + 0] = type;
26
27 data[offset + 1] = (byte)(length & 0x000000FF);
28 data[offset + 2] = (byte)((length & 0x0000FF00) >> 8);
29 data[offset + 3] = (byte)((length & 0x00FF0000) >> 16);
30 data[offset + 4] = (byte)((length & 0xFF000000) >> 24);
31 }
32
33 public int GetLength()
34 {
35 return 5;
36 }
37 }
38}