diff options
author | Adam Frisby | 2009-12-27 16:07:05 +1100 |
---|---|---|
committer | Adam Frisby | 2009-12-27 16:07:05 +1100 |
commit | 8a931a4e914a00cbf0e853b83e74e56ace08419e (patch) | |
tree | cae24ef94682d8ba05ea4dfe44b88b2e228b45e0 /OpenSim/Client/Sirikata/ClientStack | |
parent | * Added prebuild for previous commit. (diff) | |
download | opensim-SC_OLD-8a931a4e914a00cbf0e853b83e74e56ace08419e.zip opensim-SC_OLD-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.gz opensim-SC_OLD-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.bz2 opensim-SC_OLD-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.xz |
* Implements some basic Sirikata protocol work (initial handshakes).
Diffstat (limited to 'OpenSim/Client/Sirikata/ClientStack')
-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; |