diff --git a/PolyChat/Controller.cs b/PolyChat/Controller.cs index 24687ae..1f202e3 100644 --- a/PolyChat/Controller.cs +++ b/PolyChat/Controller.cs @@ -42,7 +42,7 @@ namespace PolyChat private void Serve() { - Debug.WriteLine("! SERVER STARTING !"); + Debug.WriteLine("--- Controller.Serve ---"); SocketIOServer server = new SocketIOServer(new SocketIOServerOption( PORT )); @@ -69,9 +69,12 @@ namespace PolyChat { Debug.WriteLine("--- Controller.SendMessage ---"); Debug.WriteLine($"{type} -> {ip} content: {content}"); - string json = $"{{ type: {type}, content: {content} }}"; - Debug.WriteLine($"json: {json}"); - Connections[ip].SendMessage(json); + JObject json = new JObject( + new JProperty("type", type), + new JProperty("content", content) + ); + Debug.WriteLine($"json: {json.ToString()}"); + Connections[ip].SendMessage(json.ToString()); } private void OnMessage(string ip, JToken[] data)