Search Unity

UNET - Loads the scene twice after connection timeout. Need to clean up?

Discussion in 'UNet' started by LootlabGames, Jun 28, 2018.

  1. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    Version 2018.1.2f1

    If try to join a game using StartClient() and it timeouts for some reason(In this case it is me trying to join a game that doesn't exist for testing).
    Then I try to host a game using StartHost() it loads the scene twice(I can see it in the Hierarchy) and then throws the "ClientScene::AddPlayer: playerControllerId of 0 already in use." error.

    Is there some type of "Clean Up" I need to do after the timeout happens to avoid this?
     
  2. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    263
    Yes, cleaning up is what finally lead me to throw in the towel on HLAPI. I tried every way I could think of to get things back to the starting point and I couldn't do it. The documentation has nothing in this regard, and there's a lot of source code to pour through. You're dealing with several undocumented levels, all of which have their quirks, and leave you guessing as to what exactly is expected of you. If you are just starting out, I would go straight to LLAPI if your needs are simple, or Photon if you want object syncing etc.
     
  3. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    Thanks for the reply.

    Does anyone have any insight as to what the clean would be?
     
  4. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    No one out there has ever had this problem and figured out the required cleanup?
    Unity?
    Anyone?
     
  5. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    263
    Lot's of people have the problem, but nobody is available to help. Time to move on to a non-HLAPI solution.