internal Coroutine SetMatchAttributes(SetMatchAttributesRequest req, NetworkMatch.BasicResponseDelegate callback)
        {
            Coroutine result;

            if (callback == null)
            {
                UnityEngine.Debug.Log("callback supplied is null, aborting SetMatchAttributes Request.");
                result = null;
            }
            else
            {
                Uri uri = new Uri(this.baseUri, "/json/reply/SetMatchAttributesRequest");
                UnityEngine.Debug.Log("MatchMakingClient SetMatchAttributes :" + uri);
                WWWForm wWWForm = new WWWForm();
                wWWForm.AddField("version", Request.currentVersion);
                wWWForm.AddField("projectId", Application.cloudProjectId);
                wWWForm.AddField("sourceId", Utility.GetSourceID().ToString());
                wWWForm.AddField("accessTokenString", Utility.GetAccessTokenForNetwork(req.networkId).GetByteString());
                wWWForm.AddField("domain", req.domain);
                wWWForm.AddField("networkId", req.networkId.ToString());
                wWWForm.AddField("isListed", req.isListed.ToString());
                wWWForm.headers["Accept"] = "application/json";
                WWW client = new WWW(uri.ToString(), wWWForm);
                result = base.StartCoroutine(this.ProcessMatchResponse <BasicResponse, NetworkMatch.BasicResponseDelegate>(client, new NetworkMatch.InternalResponseDelegate <BasicResponse, NetworkMatch.BasicResponseDelegate>(this.OnSetMatchAttributes), callback));
            }
            return(result);
        }
Exemple #2
0
        // Set attributes for matches in progress
        internal Coroutine SetMatchAttributes(SetMatchAttributesRequest req, BasicResponseDelegate callback)
        {
            if (callback == null)
            {
                Debug.Log("callback supplied is null, aborting SetMatchAttributes Request.");
                return(null);
            }

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

            Debug.Log("MatchMakingClient SetMatchAttributes :" + 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", Utility.GetAccessTokenForNetwork(req.networkId).GetByteString());
            data.AddField("domain", req.domain);

            data.AddField("networkId", req.networkId.ToString());
            data.AddField("isListed", req.isListed.ToString());

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

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

            return(StartCoroutine(ProcessMatchResponse <BasicResponse, BasicResponseDelegate>(client, OnSetMatchAttributes, callback)));
        }
Exemple #3
0
        public Coroutine SetMatchAttributes(NetworkID networkId, bool isListed, int requestDomain, BasicResponseDelegate callback)
        {
            SetMatchAttributesRequest req = new SetMatchAttributesRequest {
                networkId = networkId,
                isListed  = isListed,
                domain    = requestDomain
            };

            return(this.SetMatchAttributes(req, callback));
        }