Search Issue Tracker

Fixed in 5.4.0

Votes

11

Found in

5.1.1p1

Issue ID

708502

Regression

No

[MatchMaker] Can't re-join a match after leaving

Networking

-

How to reproduce:

1. Open attached project
2. Open scene Scenes/Main.unity
3. Play the scene
4. Enable Match Maker
5. Create Internet Match
6. Stop match
7. Enable Match Maker again
8. Join the same lobby that was created in step 5
- Note the error: ArgumentException: An element with the same key already exists in the dictionary.

Comments (12)

  1. 09f7461da66b544cc634fd2d247e1115?d=mm

    Somaweb

    Jun 14, 2016 07:33

    why is this marked as fixed?

  2. 20af11c25b0af66125917508649cf782?d=mm

    jinnindo

    Mar 18, 2016 20:32

    Still a serious problem in 5.3.3f1

    Is that right; this won't be fixed till 5.4?

  3. 61977cae7756ab478f6fbac236c33f38?d=mm

    Chris_Entropy

    Oct 29, 2015 17:47

    Ok, it did NOT fix the problem for me. If I join a lobby of a NetworkLobbyManager, then disconnect from the lobby and try to reconnect to the lobby, the same error occurs again.

  4. 8d7f244afdd8b5341c5fb1c0bda2f2cf?d=mm

    FractalButterfly

    Oct 29, 2015 17:35

    Unity 5.2.2f1 fixed the problem for me.

  5. 66c187b78c04162ffc3e079e7bfd4631?d=mm

    setapp

    Oct 27, 2015 13:05

    5.2.2p1 still nothing. When will it be fixed?

  6. 6e46dc25714bb4cee28dbbadf7c5455d?d=mm

    nomenonX

    Oct 22, 2015 11:43

    5.2.2! Future release is 5.3 or what?

    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Networking.Types.NetworkID,UnityEngine.Networking.Types.NetworkAccessToken].Add (NetworkID key, UnityEngine.Networking.Types.NetworkAccessToken value)

  7. 5d02241b19fbba02a231e11a0aaec5fb?d=mm

    sixolar

    Oct 22, 2015 00:28

    Still having this issue on 5.2.1 !

  8. 6e46dc25714bb4cee28dbbadf7c5455d?d=mm

    nomenonX

    Oct 01, 2015 12:02

    In Unity 5.2.1

    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Networking.Types.NetworkID,UnityEngine.Networking.Types.NetworkAccessToken].Add (NetworkID key, UnityEngine.Networking.Types.NetworkAccessToken value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:101)
    UnityEngine.Networking.Utility.SetAccessTokenForNetwork (NetworkID netId, UnityEngine.Networking.Types.NetworkAccessToken accessToken) (at C:/buildslave/unity/build/Runtime/Networking/Managed/UNETTypes.cs:119)
    UnityEngine.Networking.NetworkManager.OnMatchJoined (UnityEngine.Networking.Match.JoinMatchResponse matchInfo) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkManager.cs:1022)
    UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0`1[UnityEngine.Networking.Match.JoinMatchResponse].MoveNext () (at C:/buildslave/unity/build/Runtime/Networking/Managed/MatchMakingClient.cs:302)

  9. D1d03a1bd07295cadf3e77c1d2b5b3d0?d=mm

    Sycoforge

    Sep 18, 2015 09:56

    Until this bughas been officially resolved. Hook your own callback to the JoinMatch method.

    this.manager.matchMaker.JoinMatch(networkID, string.Empty, new NetworkMatch.ResponseDelegate<JoinMatchResponse>(OnMatchJoined));

    public virtual void MatchJoined(JoinMatchResponse matchInfo)
    {
    if (LogFilter.logDebug)
    {
    Debug.Log("NetworkManager OnMatchJoined ");
    }
    if (matchInfo.success)
    {
    try
    {
    Utility.SetAccessTokenForNetwork(matchInfo.networkId, new NetworkAccessToken(matchInfo.accessTokenString));
    }
    catch(Exception ex)
    {
    if (LogFilter.logError)
    {
    Debug.LogError(ex);
    }
    }
    this.StartClient(new MatchInfo(matchInfo));
    }
    else if (LogFilter.logError)
    {
    Debug.LogError(string.Concat("Join Failed:", matchInfo));
    }
    }

    This solved the problem for us.

  10. 6463efa0a6d0938ad8bcab4305a502c5?d=mm

    Magnet_man16

    Sep 12, 2015 13:06

    I have the same Issue. Unity this is a must fix issue. I cant develop my game any further without it fixed.

    To recreate download and run the NetworkStarter demo from below:
    http://forum.unity3d.com/threads/unet-sample-projects.331978/

    "ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Networking.Types.NetworkID,UnityEngine.Networking.Types.NetworkAccessToken].Add (NetworkID key, UnityEngine.Networking.Types.NetworkAccessToken value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    UnityEngine.Networking.Utility.SetAccessTokenForNetwork (NetworkID netId, UnityEngine.Networking.Types.NetworkAccessToken accessToken) (at C:/buildslave/unity/build/Runtime/Networking/Managed/UNETTypes.cs:119)
    UnityEngine.Networking.NetworkManager.OnMatchJoined (UnityEngine.Networking.Match.JoinMatchResponse matchInfo) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkManager.cs:1010)
    UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0`1[UnityEngine.Networking.Match.JoinMatchResponse].MoveNext () (at C:/buildslave/unity/build/Runtime/Networking/Managed/MatchMakingClient.cs:302)"

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.