diff --git a/RH-Engine/Program.cs b/RH-Engine/Program.cs
index 3b7aab5..b2d4cbf 100644
--- a/RH-Engine/Program.cs
+++ b/RH-Engine/Program.cs
@@ -45,6 +45,10 @@ namespace RH_Engine
CreateConnection(client.GetStream());
}
+ ///
+ /// initializes and starts the reading of the responses from the vr server
+ ///
+ /// the networkstream
private static void initReader(NetworkStream stream)
{
serverResponseReader = new ServerResponseReader(stream);
@@ -52,13 +56,16 @@ namespace RH_Engine
serverResponseReader.StartRead();
}
+ ///
+ /// callback method that handles responses from the server
+ ///
+ /// the response message from the server
public static void HandleResponse(string message)
{
string id = JSONParser.GetID(message);
- // because the first messages doesn't have a serial, we need to check on the id
-
+ // because the first messages don't have a serial, we need to check on the id
if (id == "session/list")
{
sessionId = JSONParser.GetSessionID(message,PCs);
@@ -80,10 +87,15 @@ namespace RH_Engine
if (serialResponses.ContainsKey(serial)) serialResponses[serial].Invoke(message);
}
-
-
}
+ ///
+ /// method that sends the speciefied message with the specified serial, and executes the given action upon receivind a reply from the server with this serial.
+ ///
+ /// the networkstream to use
+ /// the message to send
+ /// the serial to check for
+ /// the code to be executed upon reveiving a reply from the server with the specified serial
public static void SendMessageAndOnResponse(NetworkStream stream, string message, string serial, HandleSerial action)
{
serialResponses.Add(serial,action);
@@ -145,24 +157,16 @@ namespace RH_Engine
WriteTextMessage(stream, mainCommand.ResetScene());
SendMessageAndOnResponse(stream, mainCommand.RouteCommand("routeID"), "routeID", (message) => routeId = JSONParser.GetResponseUuid(message));
+
//WriteTextMessage(stream, mainCommand.TerrainCommand(new int[] { 256, 256 }, null));
//string command;
- //WriteTextMessage(stream, mainCommand.AddBikeModel());
-
SendMessageAndOnResponse(stream, mainCommand.addPanel("panelID"), "panelID", (message) => panelId = JSONParser.GetResponseUuid(message));
- //Console.WriteLine(ReadPrefMessage(stream));
-
//command = mainCommand.AddModel("car", "data\\customModels\\TeslaRoadster.fbx");
-
//WriteTextMessage(stream, command);
- //Console.WriteLine(ReadPrefMessage(stream));
-
-
-
//command = mainCommand.addPanel();
// WriteTextMessage(stream, command);
// string response = ReadPrefMessage(stream);
diff --git a/RH-Engine/ServerResponseReader.cs b/RH-Engine/ServerResponseReader.cs
index 04d3312..13192a1 100644
--- a/RH-Engine/ServerResponseReader.cs
+++ b/RH-Engine/ServerResponseReader.cs
@@ -53,7 +53,7 @@ namespace RH_Engine
byte[] lengthBytes = new byte[4];
int streamread = stream.Read(lengthBytes, 0, 4);
- Console.WriteLine("read message.. " + streamread);
+ //Console.WriteLine("read message.. " + streamread);
int length = BitConverter.ToInt32(lengthBytes);