internal Coroutine JoinMatch(JoinMatchRequest req, NetworkMatch.DataResponseDelegate <MatchInfo> callback)
        {
            Coroutine result;

            if (callback == null)
            {
                UnityEngine.Debug.Log("callback supplied is null, aborting JoinMatch Request.");
                result = null;
            }
            else
            {
                Uri uri = new Uri(this.baseUri, "/json/reply/JoinMatchRequest");
                UnityEngine.Debug.Log("MatchMakingClient Join :" + uri);
                WWWForm wWWForm = new WWWForm();
                wWWForm.AddField("version", Request.currentVersion);
                wWWForm.AddField("projectId", Application.cloudProjectId);
                wWWForm.AddField("sourceId", Utility.GetSourceID().ToString());
                wWWForm.AddField("accessTokenString", 0);
                wWWForm.AddField("domain", req.domain);
                wWWForm.AddField("networkId", req.networkId.ToString());
                wWWForm.AddField("password", req.password);
                wWWForm.AddField("publicAddress", req.publicAddress);
                wWWForm.AddField("privateAddress", req.privateAddress);
                wWWForm.AddField("eloScore", req.eloScore.ToString());
                wWWForm.headers["Accept"] = "application/json";
                WWW client = new WWW(uri.ToString(), wWWForm);
                result = base.StartCoroutine(this.ProcessMatchResponse <JoinMatchResponse, NetworkMatch.DataResponseDelegate <MatchInfo> >(client, new NetworkMatch.InternalResponseDelegate <JoinMatchResponse, NetworkMatch.DataResponseDelegate <MatchInfo> >(this.OnMatchJoined), callback));
            }
            return(result);
        }
Example #2
0
        // Begin joining a match
        internal Coroutine JoinMatch(JoinMatchRequest req, DataResponseDelegate <MatchInfo> callback)
        {
            if (callback == null)
            {
                Debug.Log("callback supplied is null, aborting JoinMatch Request.");
                return(null);
            }

            Uri uri = new Uri(baseUri, "/json/reply/JoinMatchRequest");

            Debug.Log("MatchMakingClient Join :" + uri);

            var data = new WWWForm();

            data.AddField("version", UnityEngine.Networking.Match.Request.currentVersion);
            data.AddField("projectId", Application.cloudProjectId);
            data.AddField("sourceId", Utility.GetSourceID().ToString());
            data.AddField("accessTokenString", 0);
            data.AddField("domain", req.domain);

            data.AddField("networkId", req.networkId.ToString());
            data.AddField("password", req.password);
            data.AddField("publicAddress", req.publicAddress);
            data.AddField("privateAddress", req.privateAddress);
            data.AddField("eloScore", req.eloScore.ToString());

            data.headers["Accept"] = "application/json";

            var client = UnityWebRequest.Post(uri.ToString(), data);

            return(StartCoroutine(ProcessMatchResponse <JoinMatchResponse, DataResponseDelegate <MatchInfo> >(client, OnMatchJoined, callback)));
        }
Example #3
0
        public Coroutine JoinMatch(NetworkID netId, string matchPassword, ResponseDelegate <JoinMatchResponse> callback)
        {
            JoinMatchRequest req = new JoinMatchRequest {
                networkId = netId,
                password  = matchPassword
            };

            return(this.JoinMatch(req, callback));
        }
Example #4
0
    public void JoinMatch(NetworkID netId)
    {
        print ("joining match: " + netId);
        var request = new JoinMatchRequest () {
            networkId = netId,
            password = ""

        };
        networkMatch.JoinMatch (request, base.OnMatchJoined);
    }
Example #5
0
    public void JoinMatch(MatchDesc match)
    {
        JoinMatchRequest request = new JoinMatchRequest();
        request.appId = EloConfig.PROGRAM_APP_ID;
        request.projectId = EloConfig.CLOUD_PROJECT_ID;
        request.networkId = match.networkId;
        request.domain = 0;
        request.password = "";

        NetworkManager.singleton.matchMaker.JoinMatch(request, OnMatchJoined);
    }
Example #6
0
        public Coroutine JoinMatch(NetworkID netId, string matchPassword, string publicClientAddress, string privateClientAddress, int eloScoreForClient, int requestDomain, DataResponseDelegate <MatchInfo> callback)
        {
            JoinMatchRequest req = new JoinMatchRequest {
                networkId      = netId,
                password       = matchPassword,
                publicAddress  = publicClientAddress,
                privateAddress = privateClientAddress,
                eloScore       = eloScoreForClient,
                domain         = requestDomain
            };

            return(this.JoinMatch(req, callback));
        }
Example #7
0
        public Coroutine JoinMatch(JoinMatchRequest req, NetworkMatch.ResponseDelegate <JoinMatchResponse> callback)
        {
            Uri uri = new Uri(this.baseUri, "/json/reply/JoinMatchRequest");

            UnityEngine.Debug.Log((object)("MatchMakingClient Join :" + (object)uri));
            WWWForm form = new WWWForm();

            form.AddField("projectId", Application.cloudProjectId);
            form.AddField("sourceId", Utility.GetSourceID().ToString());
            form.AddField("appId", Utility.GetAppID().ToString());
            form.AddField("accessTokenString", 0);
            form.AddField("domain", 0);
            form.AddField("networkId", req.networkId.ToString());
            form.AddField("password", req.password);
            form.headers["Accept"] = "application/json";
            return(this.StartCoroutine(this.ProcessMatchResponse <JoinMatchResponse>(new WWW(uri.ToString(), form), callback)));
        }
Example #8
0
        public Coroutine JoinMatch(JoinMatchRequest req, ResponseDelegate <JoinMatchResponse> callback)
        {
            Uri uri = new Uri(baseUri, "/json/reply/JoinMatchRequest");

            Debug.Log("MatchMakingClient Join :" + uri);
            WWWForm wWWForm = new WWWForm();

            wWWForm.AddField("projectId", Application.cloudProjectId);
            wWWForm.AddField("sourceId", Utility.GetSourceID().ToString());
            wWWForm.AddField("appId", Utility.GetAppID().ToString());
            wWWForm.AddField("accessTokenString", 0);
            wWWForm.AddField("domain", 0);
            wWWForm.AddField("networkId", req.networkId.ToString());
            wWWForm.AddField("password", req.password);
            wWWForm.headers["Accept"] = "application/json";
            WWW client = new WWW(uri.ToString(), wWWForm);

            return(StartCoroutine(ProcessMatchResponse(client, callback)));
        }
Example #9
0
	public void OnClickJoinGame() {
		Debug.Log ("OnClickJoinGame()");
		var req = new JoinMatchRequest();
		req.networkId = selectedMatchDesc.networkId;
		req.password = onlineFindPasswordInput.text;
		match.JoinMatch(req, this.OnMatchJoined);
		isMatchCreator = false;
		switchState (State.LOBBY);
	}