Skip to content

Commit

Permalink
fix(mqtt): always process locally generated messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Mar 2, 2023
1 parent 917d597 commit 9266cf7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Runtime/ArenaClientScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ private void PublishSceneMessage(string topic, string msg, bool hasPermissions)
byte[] payload = System.Text.Encoding.UTF8.GetBytes(msg);
Publish(topic, payload); // remote
LogMessage("Sending", JsonConvert.DeserializeObject(msg), hasPermissions);
ProcessMessage(payload); // local
}

private static string GetTimestamp()
Expand All @@ -949,12 +948,7 @@ protected override void DecodeMessage(string topic, byte[] message)
{
// Call the delegate if a user has defined it
if (OnMessageCallback != null) OnMessageCallback(topic, message);

// ignore this client's messages
if (!topic.Contains(client.ClientId))
{
ProcessMessage(message);
}
ProcessMessage(message);
}

internal void ProcessMessage(string message, object menuCommand = null)
Expand Down

0 comments on commit 9266cf7

Please sign in to comment.