Skip to content

Commit 0969871

Browse files
committed
change target IP
1 parent 9973370 commit 0969871

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • Packages/net.naoyakohda.artnet-unity@12078a5f801e/Runtime/Scripts

Packages/net.naoyakohda.artnet-unity@12078a5f801e/Runtime/Scripts/DmxManager.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,17 @@ public void ReceivedPollPacket(ReceivedData<PollPacket> receivedData)
8383

8484
byte status = 0b11110000;
8585

86+
//resolve the IP. if its 0.0.0.0, then just use localhost
87+
byte[] ipBytes = ArtNetReceiver.Address.GetAddressBytes();
88+
if (ArtNetReceiver.Address.Equals(IPAddress.Any))
89+
{
90+
ipBytes = IPAddress.Loopback.GetAddressBytes();
91+
}
92+
8693
//construct a response packet
8794
var responsePacket = new PollReplyPacket
8895
{
89-
IpAddress = ArtNetReceiver.Address.GetAddressBytes(),
96+
IpAddress = ipBytes,
9097
Port = ArtNetReceiver.Port,
9198
//OUR version number. Just report 69 because its funny
9299
VersionInfo = 42069,

0 commit comments

Comments
 (0)