From 0dc4bb6fade21f28c777b194f9d6e5bbdcffacd9 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Wed, 30 Sep 2020 12:23:53 +0200 Subject: [PATCH] connected engine to client --- Client/Client.cs | 6 ++++++ Client/EngineConnection.cs | 2 +- RH-Engine/JSONParser.cs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Client/Client.cs b/Client/Client.cs index 3701599..3dc361e 100644 --- a/Client/Client.cs +++ b/Client/Client.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Net.Sockets; using System.Text; +using System.Threading; using ProftaakRH; namespace Client @@ -27,7 +28,12 @@ namespace Client this.client = new TcpClient(); this.connected = false; client.BeginConnect(adress, port, new AsyncCallback(OnConnect), null); + initEngine(); + } + + private void initEngine() + { engineConnection = EngineConnection.INSTANCE; engineConnection.Connect(); diff --git a/Client/EngineConnection.cs b/Client/EngineConnection.cs index 463dabc..ff9b5e2 100644 --- a/Client/EngineConnection.cs +++ b/Client/EngineConnection.cs @@ -83,7 +83,7 @@ namespace Client // wait until we have a tunnel id while (tunnelId == string.Empty) { } - Write("got tunnel id! sending commands..."); + Write("got tunnel id! " + tunnelId); } /// diff --git a/RH-Engine/JSONParser.cs b/RH-Engine/JSONParser.cs index 292c524..c8e0c9b 100644 --- a/RH-Engine/JSONParser.cs +++ b/RH-Engine/JSONParser.cs @@ -36,7 +36,7 @@ namespace RH_Engine { if (d.clientinfo.host == pc.host && d.clientinfo.user == pc.user) { - Console.WriteLine("connecting to {0}, on {1} with id {2}", pc.user, pc.host, d.id); + Console.WriteLine("[JSONPARSER] connecting to {0}, on {1} with id {2}", pc.user, pc.host, d.id); return d.id; } }