ControlCore improvements

This commit is contained in:
Pascal Serrarens 2024-12-11 14:53:18 +01:00
parent 0f0fcfdfbf
commit 1d2da54a17
2 changed files with 8 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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<bool> 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<bool> Receive(Stream dataStream, Client client, byte packetSize) {