Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Halichoerus · Oct 14, 2015 at 05:50 PM · networkinghosting

UNet - When the host is ended all clients are kicked to lobby scene, how do I stop this?

I'm using the NetworkLobbyManager to implement my multilayer, and its caused me constant trouble due to the myriad of automatic things it does and doesn't tell you about anywhere in the docs. For the most part I've figured it out in the end, but I'm at a loss this time. When the host of a game disconnects I want the host to migrate to one of the clients; I've synced all relevant data (address, position, health etc) to the clients, paused the game make the clients wait a bit then connect to the new address etc, but none of that matters because the moment the clients get disconnected they are booted to the lobby scene.

I have tried overriding all overidable methods in my lobby manager (OnLobbyServerDisconnect, OnStopHost, OnServerDisconnect, etc) but no use. I've messed with all available settings, looked at dozens of forum posts and browsed the little documentation that there is for hours all to no avail. The closest I've got is that maybe ServerReturnToLobby() is called, but by what I have no idea and still probably not since the client is kicked to the lobby even when the host is uncleanly ended (internet dropping, alt+f4 etc.)

TL;DR: With a NetworkLobbyManager implemented, when the host of a multilayer game disconnects all clients are kicked to the lobby scene, how do I make it NOT do this?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by gregorypierce · Oct 15, 2015 at 09:44 AM

Wait for unity 5.3 when host migration shows up. There isn't really a way to do it otherwise with uNet in its current iteration.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Halichoerus · Oct 15, 2015 at 03:05 PM 0
Share

Cheers for the heads up, saves me banging my head against UNet for another 10 hours!

avatar image meat5000 ♦ · Oct 15, 2015 at 03:20 PM 0
Share

There are ways to do it but its very intensive and advanced. You basically reinitialise everything on a new server, provided all clients have access to some list to know which server they should be moving to.

Of course this is an ideal but you must consider that it is still the current host that must initiate the migration, so if for example you are running on Android, where apps are killed at a moments notice, there is most definitely not enough time for the disconnecting host to migrate the Server. To hold the app open for longer would probably be against Android's best practise and rules.

avatar image SweatyChair · Nov 15, 2016 at 10:42 AM 1
Share

1 yr passed and in Unity 5.4 now, but the host migration seems only work for LAN but not match relay server....

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

are client hosted servers limited by my 20 person ccu? 0 Answers

MessagingSystem.ProcessIncomingMessageQueue();, NullReferenceException: Object reference not set to an instance of an object 1 Answer

NAT Traversal - Open.NAT 2 Answers

Custom server config for simple networking. 0 Answers

More than one connection in the same time using uNet and UnityEngine.Transport ? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges