diff options
Diffstat (limited to 'OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs')
-rw-r--r-- | OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 78f231a..e8d1889 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -1,6 +1,7 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Net; | 3 | using System.Net; |
4 | using System.Net.Sockets; | ||
4 | using System.Text; | 5 | using System.Text; |
5 | using OpenMetaverse; | 6 | using OpenMetaverse; |
6 | using OpenMetaverse.Packets; | 7 | using OpenMetaverse.Packets; |
@@ -11,6 +12,26 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
11 | { | 12 | { |
12 | class SirikataClientView : IClientAPI, IClientCore | 13 | class SirikataClientView : IClientAPI, IClientCore |
13 | { | 14 | { |
15 | private readonly NetworkStream stream; | ||
16 | |||
17 | public SirikataClientView(TcpClient client) | ||
18 | { | ||
19 | stream = client.GetStream(); | ||
20 | |||
21 | sessionId = UUID.Random(); | ||
22 | |||
23 | |||
24 | // Handshake with client | ||
25 | string con = "SSTTCP01" + sessionId; | ||
26 | byte[] handshake = Util.UTF8.GetBytes(con); | ||
27 | |||
28 | byte[] clientHandshake = new byte[2+6+36]; | ||
29 | |||
30 | stream.Read(clientHandshake, 0, handshake.Length); | ||
31 | stream.Write(handshake, 0, handshake.Length - 1); // Remove null terminator (hence the -1) | ||
32 | } | ||
33 | |||
34 | |||
14 | #region Implementation of IClientAPI | 35 | #region Implementation of IClientAPI |
15 | 36 | ||
16 | private Vector3 startPos; | 37 | private Vector3 startPos; |