Skip to content

Commit

Permalink
fix(network): fix empty data with deucalion
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyupe committed May 10, 2023
1 parent 7bc4ca1 commit c80f3ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cafe.Matcha/Constant/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum LogType
Telemetry,
ActorControlSelf,
InvalidPacket,

Debug1,
#endif
}
}
4 changes: 3 additions & 1 deletion Cafe.Matcha/Network/NetworkMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public void HandleMessageReceived(string connection, long epoch, byte[] message)

private void HandleMessage(byte[] message)
{
if (message.Length < 32 || message[12] != 3)
var segmentType = message[12];
// Deucalion gives wrong type (0)
if (message.Length < 32 || (segmentType != 0 && segmentType != 3))
{
return;
}
Expand Down

0 comments on commit c80f3ce

Please sign in to comment.