Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

How to handle host migration for UNET MatchMaker in the lobby?

Discussion in 'UNet' started by MrLucid72, Dec 9, 2016.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    1,005
    I thought this would automatically be handled by the NetworkLobbyManager (after all, it's MatchMaker, not a normal hosted game), but it does not ;)

    How do I handle host migration for UNET MatchMaker in the lobby? If someone is in the queue, queues up 14 people, and just before the 15th comes up the host leaves and crashes everyone. This is what I want to avoid ! Thank you~ For some reason, there's no mention of this for lobby events where it's equally important.

    I tried making a myHostMigration.cs but NONE of the overrides worked like the docs suggest:

     
    Last edited: Dec 9, 2016
  2. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    1,005
    bump -- a QA just told me that this works for direct connections only, but this was advertised all over to work on UNET. The above pic is even on UNET docs O__o this can't be right is it? Perhaps I'm in denial after reporting host migration broken as early as June: It's as if it was planned for UNET, then no one can get it working so suddenly it's local only?
     
  3. AndyJenkins30

    AndyJenkins30

    Unity Technologies

    Joined:
    Oct 31, 2016
    Posts:
    190
    Hi Dylan,

    Host migration should work when using UNET. If you are using a Unity version >= 5.5 it can be enabled by adding a 'Network Migration Manager' script to your scene and enabling 'Host Migration'.

    Have you tried doing the above?

    I've attached a screenshot showing an example of the networking scripts you can add to test the 'host migration' functionality. Screen Shot 2016-12-30 at 09.28.47.png
     
  4. SweatyChair

    SweatyChair

    Joined:
    Feb 15, 2016
    Posts:
    140
    It does work in LAN games without any problem in 5.4, but not in relay server match games....

    In document it says "Additional work is required for this to function with the matchmaker and relay server."
    No further instruction and tutorial can be found so far... Hopefully someone will fill it up soon...
     
    thegreatzebadiah likes this.
  5. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    I have dug into this a little bit and it seemed to me to come down to a problem with the relay servers themselves. It seems like calling NetworkTransport.ConnectAsNetworkHost() should allow a client to take over as host of the match but it just doesn't work. The client seems to think everything is fine and they are hosting, but when another client tries to connect to the match it fails. Once the match is started it does not seem to be possible to change the host.
     
    SweatyChair likes this.
  6. CStampGames

    CStampGames

    Joined:
    May 16, 2017
    Posts:
    4
    Bump
     
    d1favero likes this.