Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unet, Connection/Disconnection problem

Discussion in 'UNet' started by panicq, Jul 7, 2015.

  1. panicq

    panicq

    Joined:
    Sep 29, 2012
    Posts:
    37
    HI,

    I've a little problem with the new uNet system. I'm using a custom UI in order to create a host and disonnect from a server. I'm using the StartHost() method of the NetworkBehaviour class. Creation of the host and connection to it works fine for the first time, but as soon as a the host or the client stops, I cannot restart a new host or even reconnect to a host, without re-launching the game :(

    Do you know why ?

    Thank you in advance.
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    It is a bug and it has been fixed in 5.1.1 Patch 2
     
  3. panicq

    panicq

    Joined:
    Sep 29, 2012
    Posts:
    37
    Ha okay thank you, is the patch available ?
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    As far as I know it should
     
  5. panicq

    panicq

    Joined:
    Sep 29, 2012
    Posts:
    37
    I've installed the latest patch, but I still can't re-connect or re-host after Stopping the game. Maybe it comes from my code:

    Herre is my listener (Start method)

    Code (CSharp):
    1. stopButton.onClick.AddListener (() => { StopGame();});
    Here is my StopGame method:

    Code (CSharp):
    1.     private void StopGame()
    2.     {
    3.  
    4.             if(isServer)
    5.             {
    6.                 (NetworkManager.singleton as NetworkGameManager).StopHost();
    7.             }else{
    8.                 (NetworkManager.singleton as NetworkGameManager).StopClient();
    9.             }
    10.  
    11.     }
    Do you see something work with it ?

    Thank you in advance :)
     
  6. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    No it is not enough for me to understand what's going on...:) can you attach you project and add reproducing steps? Or just generate bug about this?
     
  7. pablo_romero12

    pablo_romero12

    Joined:
    May 13, 2013
    Posts:
    2
    I have the exact same problem, and still cannot find a solution, did you find any way to make it work, I'm working with the Google Glasses, and there is no way to close and relaunch the application, so this bug is really annoying