From 1d2da54a173ec8d09802739784ec05f0fb7f8247 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Wed, 11 Dec 2024 14:53:18 +0100 Subject: [PATCH] ControlCore improvements --- Client.cs | 4 ++-- Messages.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Client.cs b/Client.cs index e54583e..27b474d 100644 --- a/Client.cs +++ b/Client.cs @@ -47,13 +47,13 @@ namespace Passer.Control { ProcessNetworkId(networkId); break; case InvestigateMsg investigate: - UnityEngine.Debug.Log($"investigate [{investigate.networkId}/{investigate.thingId}]"); ProcessInvestigate(investigate); break; case ThingMsg thing: ProcessThing(thing); break; case NameMsg name: + UnityEngine.Debug.Log($"Name [{name.networkId}/{name.thingId}] {name.name}"); ProcessName(name); break; case ModelUrlMsg modelUrl: @@ -101,7 +101,7 @@ namespace Passer.Control { foreach (Client client in Client.clients) { if (client == this) continue; - UnityEngine.Debug.Log($"---> {client.ipAddress}"); + //UnityEngine.Debug.Log($"---> {client.ipAddress}"); IMessage.SendMsg(client, msg); } } diff --git a/Messages.cs b/Messages.cs index c0e852b..59439b0 100644 --- a/Messages.cs +++ b/Messages.cs @@ -234,8 +234,8 @@ namespace Passer.Control { ThingMsg msg = new(buffer); // Do no process poses with nwid == 0 (== local) - if (msg.networkId == 0) - return true; + //if (msg.networkId == 0) + // return true; client.messageQueue.Enqueue(msg); return true; @@ -280,8 +280,8 @@ namespace Passer.Control { this.name = System.Text.Encoding.UTF8.GetString(buffer, (int)ix, strlen); } - public static bool Send(Client client, byte thingId, string name) { - NameMsg msg = new(client.networkId, thingId, name); + public static bool Send(Client client, byte networkId, byte thingId, string name) { + NameMsg msg = new(networkId, thingId, name); return SendMsg(client, msg); } public static async Task Receive(Stream dataStream, Client client, byte packetSize) { @@ -336,8 +336,8 @@ namespace Passer.Control { url = System.Text.Encoding.UTF8.GetString(buffer, (int)ix, strlen); } - public static bool Send(Client client, byte thingId, string modelUrl) { - ModelUrlMsg msg = new(client.networkId, thingId, modelUrl); + public static bool Send(Client client, byte networkId, byte thingId, string modelUrl) { + ModelUrlMsg msg = new(networkId, thingId, modelUrl); return SendMsg(client, msg); } public static async Task Receive(Stream dataStream, Client client, byte packetSize) {