Fattie
Fattie

Reputation: 12582

Unity NetworkDiscovery, use "use NetworkManager"?

I have two PCs on my desktop with a dead-simple NetworkDiscovery on a game object.

enter image description here

Note, I am simply using the standard basic NetworkDiscovery, so, it brings up the handy GUI ..

enter image description here

I "Initialize" and then on one machine use the "Broadcast" button and on the other the "Listen" button.

Really should you use the "Use NetworkManager" toggle, which seems to be totally undocumented?

If you turn it on ..

Notice the message that appears in the NetworkDiscovery panel (and on console).

enter image description here

Note that if you turn it off, no such appears there - ?

Upvotes: 1

Views: 593

Answers (1)

Fattie
Fattie

Reputation: 12582

Ah, I think I can answer my own question here:

the mystery "use NetworkManager" button

enter image description here

simply sets

the data

of the broadcast for discovery.

So, instead of the default "HELLO", it just sets it to, simply, a string describing the network manager.

(On first glance, I incorrectly thought it was actually using for broadcast the IP that happens to be in that string. But it's just "a string".)

So that's the answer to that question per se.

(This feature would appear to be completely useless. The client gets the IP instantly in OnReceivedBroadcast.)

(Indeed, in UDP discovery the "data" field is pretty much never used anyway.)

Upvotes: 2

Related Questions