Search Unity

Networking Are there any network examples for 5.4...

Discussion in '5.4 Beta' started by Arowx, Mar 19, 2016.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,209
    Just trying the Tanks networking example but hitting lots of bugs in 5.4 it looks like the API changes stop it from working, so any examples that work with 5.4?

    Errors I'm seeing:

     
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,209
    Managed to get it to work, but it's a bit of a hack.
     
  3. stellarvr

    stellarvr

    Joined:
    Mar 21, 2016
    Posts:
    1
    Can I ask... What was your hack? Id rather not have to rip and replace all my lobby scripts :/
     
  4. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
  5. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,209
    rikey likes this.
  6. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    83
    Read 5.4b documentation for fix it.
    Lobby Manager:
    public override void OnMatchCreate(bool success, string extendedInfo, MatchInfo matchInfo)
    {
    _currentMatchID = (ulong)matchInfo.networkId;

    base.OnMatchCreate(success, extendedInfo, matchInfo);
    }

    public override void OnDestroyMatch(bool success, string extendedInfo)
    {
    if (_disconnectServer)
    {
    StopMatchMaker();
    StopHost();
    }
    base.OnDestroyMatch(success, extendedInfo);
    }


    MatchDesc:
    public void Populate(MatchInfoSnapshot match, LobbyManager lobbyManager, Color c)
    { ...

    I disabled OnGUIMatchList function.I dont need it.

    Join Match:
    matchMaker.JoinMatch(networkID, "","","",0,0, lobbyManager.OnMatchJoined);

    Regards
     
    rikey likes this.
unityunity