Skip to content

Commit

Permalink
add server publish to private user
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Oct 9, 2024
1 parent cd246ae commit a87f66d
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Runtime/Scripts/Signaling/ARENAMQTTSignaling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,9 @@ private void Publish(string toUid, string msg)
idtag: "-",
touid: toUid
);
if (toUid == null)
{
scene.Publish(pubRenderServerTopic.PUB_SCENE_RENDER, payload);
}
else
{
scene.Publish(pubRenderServerTopic.PUB_SCENE_RENDER_PRIVATE, payload);
}
var topic = (toUid == null) ? pubRenderServerTopic.PUB_SCENE_RENDER : pubRenderServerTopic.PUB_SCENE_RENDER_PRI_SERV;
scene.Publish(topic, payload);
Debug.Log($"MQTT Sent: {topic} {msg}");
}

public void SendConnect()
Expand All @@ -110,7 +105,7 @@ public void SendOffer(string id, RTCSessionDescription offer)
}
};

Publish(id, JsonUtility.ToJson(routedMessage));
Publish(null, JsonUtility.ToJson(routedMessage));
}

public void SendAnswer(string id, RTCSessionDescription answer)
Expand All @@ -126,7 +121,7 @@ public void SendAnswer(string id, RTCSessionDescription answer)
}
};

Publish(id, JsonUtility.ToJson(routedMessage));
Publish(null, JsonUtility.ToJson(routedMessage));
}

public void SendHealthCheck(string id){
Expand All @@ -139,7 +134,7 @@ public void SendHealthCheck(string id){
id = id,
data = $"{scene.namespaceName}/{scene.sceneName}"
};
Publish(id, JsonUtility.ToJson(healthCheck));
Publish(null, JsonUtility.ToJson(healthCheck));
}

public void UpdateHALInfo(string id, bool halStatus)
Expand All @@ -162,7 +157,7 @@ public void SendCandidate(string id, RTCIceCandidate candidate)
}
};

Publish(id, JsonUtility.ToJson(routedMessage));
Publish(null, JsonUtility.ToJson(routedMessage));
}

public void SendStats(string stats)
Expand All @@ -174,7 +169,7 @@ protected void ProcessMessage(string topic, string content)
{
if ( !m_subbedTopics.Any(s => topic.Contains( s.Substring(0,s.Length-5) )) ) return;

Debug.Log($"MQTT Recieved: {topic} {content}");
Debug.Log($"MQTT Received: {topic} {content}");

try
{
Expand Down

0 comments on commit a87f66d

Please sign in to comment.