Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Network Match - Destroy/Disconnect

Discussion in 'Multiplayer' started by HankTurbo, Jun 30, 2015.

  1. HankTurbo

    HankTurbo

    Joined:
    Jan 13, 2015
    Posts:
    2
    I'm having issues with shutting down a network match.

    I use:
    Code (CSharp):
    1. NetworkMatch.CreateMatch
    to create the match, and that works a treat.

    And I've tried
    Code (CSharp):
    1. NetworkMatch.DropConnection
    2. NetworkMatch.DestroyMatch
    To try and shut down the match.

    I get the error:
    I'm using the latest Unity Patch 5.1.1p2.
    Cloud configuration was last changed: 2015-06-29T11:16:51.000Z

    What is the "proper" way to destroy a match, and/or how can I get around this issue?
     
  2. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    159
    The way i did it :

    Code (CSharp):
    1. public void Cancel1V1AsHost ()
    2.     {
    3.         DestroyMatchRequest cancel = new DestroyMatchRequest() ;
    4.         cancel.networkId = matchInfo.networkId ;
    5.         networkMatch.DestroyMatch(cancel,CancelMatch) ;
    6.         //StopHost() ;
    7.     }
    8.  
    9.  
    10.     public void CancelMatch (BasicResponse cancel)
    11.     {
    12.         if (cancel.success)
    13.         {
    14.             print ("match cancelled") ;
    15.         }
    16.     }
    PS : I just figured out that doesn t work... it s missing an id somewhere... i ll search for it.
     
  3. HankTurbo

    HankTurbo

    Joined:
    Jan 13, 2015
    Posts:
    2
    Thanks for the reply!

    Unfortunately if I use "DestroyMatch", I get the above-mentioned error. So I have already tried that approach.
     
  4. Necromantic

    Necromantic

    Joined:
    Feb 11, 2013
    Posts:
    116
unityunity