aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
diff options
context:
space:
mode:
authorAdam Frisby2009-12-27 16:07:05 +1100
committerAdam Frisby2009-12-27 16:07:05 +1100
commit8a931a4e914a00cbf0e853b83e74e56ace08419e (patch)
treecae24ef94682d8ba05ea4dfe44b88b2e228b45e0 /OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
parent* Added prebuild for previous commit. (diff)
downloadopensim-SC-8a931a4e914a00cbf0e853b83e74e56ace08419e.zip
opensim-SC-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.gz
opensim-SC-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.bz2
opensim-SC-8a931a4e914a00cbf0e853b83e74e56ace08419e.tar.xz
* Implements some basic Sirikata protocol work (initial handshakes).
Diffstat (limited to 'OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs')
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs21
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 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Net; 3using System.Net;
4using System.Net.Sockets;
4using System.Text; 5using System.Text;
5using OpenMetaverse; 6using OpenMetaverse;
6using OpenMetaverse.Packets; 7using 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;