finished reconnecting on sim not started and then sending the commands

This commit is contained in:
Sem van der Hoeven
2020-10-07 15:08:45 +02:00
parent bff4718d3f
commit 57aa9b6deb
3 changed files with 62 additions and 11 deletions

View File

@@ -56,8 +56,9 @@ namespace Client
private void engineConnected()
{
Console.WriteLine("successfully connected to VR engine");
engineConnection.initScene();
if (this.sessionRunning) engineConnection.StartRouteFollow();
if (engineConnection.Connected && sessionRunning && !engineConnection.FollowingRoute) engineConnection.StartRouteFollow();
}
/// <summary>
@@ -127,6 +128,7 @@ namespace Client
case DataParser.START_SESSION:
Console.WriteLine("Session started!");
this.sessionRunning = true;
if (engineConnection.Connected && !engineConnection.FollowingRoute) engineConnection.StartRouteFollow();
sendMessage(DataParser.getStartSessionJson());
break;
case DataParser.STOP_SESSION: