Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    160
    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