From 8a931a4e914a00cbf0e853b83e74e56ace08419e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 27 Dec 2009 16:07:05 +1100 Subject: * Implements some basic Sirikata protocol work (initial handshakes). --- .../Sirikata/ClientStack/SirikataClientView.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim/Client/Sirikata/ClientStack') 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 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Sockets; using System.Text; using OpenMetaverse; using OpenMetaverse.Packets; @@ -11,6 +12,26 @@ namespace OpenSim.Client.Sirikata.ClientStack { class SirikataClientView : IClientAPI, IClientCore { + private readonly NetworkStream stream; + + public SirikataClientView(TcpClient client) + { + stream = client.GetStream(); + + sessionId = UUID.Random(); + + + // Handshake with client + string con = "SSTTCP01" + sessionId; + byte[] handshake = Util.UTF8.GetBytes(con); + + byte[] clientHandshake = new byte[2+6+36]; + + stream.Read(clientHandshake, 0, handshake.Length); + stream.Write(handshake, 0, handshake.Length - 1); // Remove null terminator (hence the -1) + } + + #region Implementation of IClientAPI private Vector3 startPos; -- cgit v1.1