コード例 #1
0
    public void SecureCall(string token, string securePayload, Action <string> callback)
    {
        List <WebModels.ItemsInfo> listOfItems = new List <WebModels.ItemsInfo>();

        WebModels.ItemsInfo item = new WebModels.ItemsInfo();
        item.amount   = 1;
        item.ItemID   = 106465;
        item.location = 0;
        listOfItems.Add(item);

        GiveOwnerItemWebserviceRequest request = new GiveOwnerItemWebserviceRequest();

        request.listOfItems = listOfItems;
        request.ownerID     = "ef595214-369f-4313-9ac7-b0036e5ac25c";
        request.appID       = GameAuthentication.GetAppID();
        request.OwnerType   = WebModels.OwnerTypes.User;

        string newStringRequest = JsonConvert.SerializeObject(request);

        SecurePayload payload = new SecurePayload();

        payload.token = token;
        payload.data  = newStringRequest;

        string securePayloadString = JsonConvert.SerializeObject(payload);

        Debug.Log(securePayloadString);

        string url = cloudGoodsURL + "SecureAction?appID=" + GameAuthentication.GetAppID() + "&payload=" + WWW.EscapeURL(EncryptStringUnity(securePayloadString));

        WWW www = new WWW(url);

        StartCoroutine(ServiceGetString(www, callback));
    }
コード例 #2
0
	// Use this for initialization
	void Start () {
        List<ItemsInfo> items = new List<ItemsInfo>();

        for(int i = 0; i < 3; i++)
        {
            ItemsInfo item = new ItemsInfo();
            item.ItemID = 100;
            item.location = 0;
            item.amount = 1;

            items.Add(item);
        }

        seriliazer.SercurePayloadSerializer(items);
	}
コード例 #3
0
    public void GiveUserItem()
    {
        WebModels.ItemsInfo itemsInfo = new WebModels.ItemsInfo();
        itemsInfo.amount   = Amount;
        itemsInfo.ItemID   = ItemID;
        itemsInfo.location = Location;

        List <WebModels.ItemsInfo> items = new List <WebModels.ItemsInfo>();

        items.Add(itemsInfo);

        Debug.Log(CloudGoods.user.userGuid);

        CloudGoods.GiveOwnerItems(CloudGoods.user.userGuid, WebModels.OwnerTypes.User, items, OnReceivedUserItems);
    }
コード例 #4
0
    public void SecureCall(string token, string securePayload, Action<string> callback)
    {
        List<WebModels.ItemsInfo> listOfItems = new List<WebModels.ItemsInfo>();

        WebModels.ItemsInfo item = new WebModels.ItemsInfo();
        item.amount = 1;
        item.ItemID = 106465;
        item.location = 0;
        listOfItems.Add(item);

        GiveOwnerItemWebserviceRequest request = new GiveOwnerItemWebserviceRequest();
        request.listOfItems = listOfItems;
        request.ownerID = "ef595214-369f-4313-9ac7-b0036e5ac25c";
        request.appID = GameAuthentication.GetAppID();
        request.OwnerType = WebModels.OwnerTypes.User;

        string newStringRequest = JsonConvert.SerializeObject(request);

        SecurePayload payload = new SecurePayload();
        payload.token = token;
        payload.data = newStringRequest;

        string securePayloadString = JsonConvert.SerializeObject(payload);

        Debug.Log(securePayloadString);

        string url = cloudGoodsURL + "SecureAction?appID=" + GameAuthentication.GetAppID() + "&payload=" + WWW.EscapeURL(EncryptStringUnity(securePayloadString));

        WWW www = new WWW(url);

        StartCoroutine(ServiceGetString(www, callback));
    }