コード例 #1
0
 //ClaimPromoCode
 public int ClaimPromoCode(string promoCode, int playerId = 0, string token = "")
 {
     if (ParseToken(playerId, token))
     {
         ClaimReferalCodeParam param = new ClaimReferalCodeParam();
         param.player_id  = apiPlayerId;
         param.token      = apiToken;
         param.promo_code = promoCode;
         string paramJson = JsonUtility.ToJson(param);
         API    api       = new API("claimpromocode.php", "RClaimPromoCode", paramJson, 1);
         param = null; paramJson = "";
         StartCoroutine(Congest.SendPOST(this, api));
         return(api.seed);
     }
     return(0);
 }
コード例 #2
0
 public int ClaimReferalCode(string referalCode, int playerId = 0, string token = "")
 {
     if (ParseToken(playerId, token))
     {
         ClaimReferalCodeParam param = new ClaimReferalCodeParam();
         param.player_id    = apiPlayerId;
         param.token        = apiToken;
         param.referal_code = referalCode;
         param.device_id    = SystemInfo.deviceUniqueIdentifier;
         param.device_type  = (int)Application.platform;
         string paramJson = JsonUtility.ToJson(param);
         API    api       = new API("claimreferalcode.php", "RClaimReferalCode", paramJson, 1);
         param = null; paramJson = "";
         StartCoroutine(Congest.SendPOST(this, api));
         return(api.seed);
     }
     return(0);
 }