Inheritance: PlayFabRequestCommon
	public void CheckIn()
	{
		Debug.Log("Checking-in with Server...");
		ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest() { 
			FunctionName = "CheckIn", 
		};
		
		PlayFabClientAPI.ExecuteCloudScript(request, OnCheckInCallback, OnApiCallError);
	}
Exemple #2
0
 public void CloudScript(UUnitTestContext testContext)
 {
     var request = new ExecuteCloudScriptRequest
     {
         FunctionName = "helloWorld"
     };
     PlayFabClientAPI.ExecuteCloudScript(request, PlayFabUUnitUtils.ApiCallbackWrapper<ExecuteCloudScriptResult>(testContext, CloudScriptHwCallback), SharedErrorCallback, testContext);
 }
	void RedeemReferralCode()
	{	
		Debug.Log("REDEEMING...");
		ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest() { 
			FunctionName = "RedeemReferral", 
			FunctionParameter = new { 
				referralCode = this.inputReferralCode.text 
			}
		};
		PlayFabClientAPI.ExecuteCloudScript(request, OnRedeemReferralCodeCallback, OnApiCallError);
	}
        /// <summary>
        /// Executes a CloudScript function, with the 'currentPlayerId' set to the PlayFab ID of the authenticated player.
        /// </summary>
        public static void ExecuteCloudScript(ExecuteCloudScriptRequest request, ProcessApiCallback<ExecuteCloudScriptResult> resultCallback, ErrorCallback errorCallback, object customData = null)
        {
            if (_authKey == null) throw new Exception("Must be logged in to call this method");

            string serializedJson = SimpleJson.SerializeObject(request, Util.ApiSerializerStrategy);
            Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer)
            {
                ResultContainer<ExecuteCloudScriptResult>.HandleResults(requestContainer, resultCallback, errorCallback, null);
            };
            PlayFabHTTP.Post("/Client/ExecuteCloudScript", serializedJson, "X-Authorization", _authKey, callback, request, customData);
        }
	public void ToBattle()
	{		
		Debug.Log("BATTLING...");
		ExecuteCloudScriptRequest request = new ExecuteCloudScriptRequest() { 
			FunctionName = "Battle", 
		};
		
		PlayFabClientAPI.ExecuteCloudScript(request, ToBattleCallback, OnApiCallError);
	}