Fixed json formatting in SendMessage
This commit is contained in:
committed by
Felix Hartmann (PEA3-Fe-FI)
parent
05e3e9e0c4
commit
b42a2f9728
@@ -42,7 +42,7 @@ namespace PolyChat
|
|||||||
|
|
||||||
private void Serve()
|
private void Serve()
|
||||||
{
|
{
|
||||||
Debug.WriteLine("! SERVER STARTING !");
|
Debug.WriteLine("--- Controller.Serve ---");
|
||||||
SocketIOServer server = new SocketIOServer(new SocketIOServerOption(
|
SocketIOServer server = new SocketIOServer(new SocketIOServerOption(
|
||||||
PORT
|
PORT
|
||||||
));
|
));
|
||||||
@@ -69,9 +69,12 @@ namespace PolyChat
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("--- Controller.SendMessage ---");
|
Debug.WriteLine("--- Controller.SendMessage ---");
|
||||||
Debug.WriteLine($"{type} -> {ip} content: {content}");
|
Debug.WriteLine($"{type} -> {ip} content: {content}");
|
||||||
string json = $"{{ type: {type}, content: {content} }}";
|
JObject json = new JObject(
|
||||||
Debug.WriteLine($"json: {json}");
|
new JProperty("type", type),
|
||||||
Connections[ip].SendMessage(json);
|
new JProperty("content", content)
|
||||||
|
);
|
||||||
|
Debug.WriteLine($"json: {json.ToString()}");
|
||||||
|
Connections[ip].SendMessage(json.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMessage(string ip, JToken[] data)
|
private void OnMessage(string ip, JToken[] data)
|
||||||
|
|||||||
Reference in New Issue
Block a user