Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to get host scene name by NetworkDiscovery?

Discussion in 'Multiplayer' started by yjcnbnbnb200, Dec 26, 2017.

  1. yjcnbnbnb200

    yjcnbnbnb200

    Joined:
    Nov 1, 2017
    Posts:
    25
    Hello everyone, I am working on a LAN game, before I enter a game in LAN as client, by using NetworkDiscovery I can watch the Broadcast from Server, but the data I get from broadcast are only IP address and port, I want to get the scene which is currently handling by one host in my LAN network, the only tool I can use is OnReceivedBroadcast method in NetworkDiscovery, but its data can't fullfill my requirement, so any other API can provide me the host scene name through network broadcasting?
     
  2. yjcnbnbnb200

    yjcnbnbnb200

    Joined:
    Nov 1, 2017
    Posts:
    25
    I figure one way is store host scene name in broadcastdata before calling NetworkDiscovery.StartServer()
     
    d1favero likes this.