Search Unity

(C#) How do I detect when passwords do not match?

Discussion in 'Multiplayer' started by Gunging, May 15, 2017.

  1. Gunging

    Gunging

    Joined:
    Sep 6, 2016
    Posts:
    139
    Im using the Asset Store Free Untiy Multiplayer Lobby. The problem is: In CreateMatch() you send a password for the match, and the client can only connect if it sends the corresponding password in JoinMatch(), I´ve used this to do a "version check" so you can only join games that share the version you are using (I dont want outdated guys mixing up with those with newest update), this works, if you have a different version it doesnt let you in, however, it keeps the message "Connecting..." forever, and well, I wanted to know how to detect when the passwords not match so I can change the "Connecting..." to "Incorrect Version" or something.

    Coroutine UnityEngine.Networking.Match.NetworkMatch.CreateMatch(string matchName, uint matchSize, bool matchAdvertise, string matchPassword, string publicClientAdress, string privateClientAdress, int eloScoreForMatch, int requestDomain, UnityEngine.Networking.Match.NetworkMatch.DataResponseDelegate<UnityEngine.Networking.Match.MatchInfo> callback)
    Coroutine NetworkMatch.JoinMatch(NetworkID netId, string matchPassword, string publicClientAdress, string privateClientAdress, int eloScoreForMatch, int requestDomain, NetworkMatch.DataResponseDelegate<MatchInfo> callback)

    Id love to provide a "not working code".... but Im clueless and I couldnt really find anything close to this.

    Thanks in advance.