Esempio n. 1
0
 public static void Authorize(string appKey, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.APP_KEY, appKey);
     rp.callback = handle;
     apiCaller.Authorize(rp);
 }
Esempio n. 2
0
 public static void GetRecommends(string token, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.TOKEN, token);
     rp.callback = handle;
     apiCaller.GetRecommends(rp);
 }
Esempio n. 3
0
 public static void GetCategory(string token, int cid, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.CID, "" + cid);
     rp.data.Add(Param.TOKEN, token);
     rp.callback = handle;
     apiCaller.GetCategory(rp);
 }
Esempio n. 4
0
 public static void GetProducer(string token, int producerId, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.PRODUCER_ID, "" + producerId);
     rp.data.Add(Param.TOKEN, token);
     rp.callback = handle;
     apiCaller.GetProducer(rp);
 }
Esempio n. 5
0
 public static void GetProductInScene(string token, int sceneId, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.SCENE_ID, "" + sceneId);
     rp.data.Add(Param.TOKEN, token);
     rp.callback = handle;
     apiCaller.GetProductInScene(rp);
 }
Esempio n. 6
0
    public void GetAllSceneTypeTest()
    {
        GameObject obj = GameObject.Find("InitObj");

        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.TOKEN, AppSetting.getInstance().token);
        rp.callback = GetAllSceneTypeCallback;
        obj.SendMessage("GetAllSceneType", rp, SendMessageOptions.RequireReceiver);
    }
Esempio n. 7
0
 public static void CheckUpdate(string appName, string appVersion,
                                ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.APP_NAME, appName);
     rp.data.Add(Param.APP_VERSION, appVersion);
     rp.callback = handle;
     apiCaller.CheckUpdate(rp);
 }
Esempio n. 8
0
    public void AuthorizeTest()
    {
        GameObject obj = GameObject.Find("InitObj");

        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.APP_KEY, Config.APP_KEY);
        rp.callback = AuthorizeCallback;
        obj.SendMessage("Authorize", rp, SendMessageOptions.RequireReceiver);
    }
Esempio n. 9
0
    public void GetProductsWithProducerIdTest()
    {
        GameObject obj = GameObject.Find("InitObj");

        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.PRODUCER_ID, "100001");
        rp.data.Add(Param.TOKEN, AppSetting.getInstance().token);
        rp.callback = GetProductsWithProducerIdCallback;
        obj.SendMessage("GetProductsWithProducerId", rp, SendMessageOptions.RequireReceiver);
    }
Esempio n. 10
0
 public static void GetCategorys(string token, int?parentCid, ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.TOKEN, token);
     if (parentCid != null)
     {
         rp.data.Add(Param.PARENT_CID, "" + (int)parentCid);
     }
     rp.callback = handle;
     apiCaller.GetCategorys(rp);
 }
Esempio n. 11
0
 public static void GetAllScenes(string token, DateTime?modified,
                                 ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.TOKEN, token);
     if (modified != null)
     {
         rp.data.Add(Param.LATEST_MODIFIED, StringUtil.DateTimeToString((DateTime)modified));
     }
     rp.callback = handle;
     apiCaller.GetScenes(rp);
 }
Esempio n. 12
0
 public static void GetScenes(string token, int?sceneTypeId,
                              ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.TOKEN, token);
     if (sceneTypeId != null)
     {
         rp.data.Add(Param.SCENE_TYPE_ID, "" + sceneTypeId);
     }
     rp.callback = handle;
     apiCaller.GetScenes(rp);
 }
Esempio n. 13
0
 public static void GetSceneType(string token, int sceneTypeId, DateTime?modified,
                                 ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.SCENE_TYPE_ID, "" + sceneTypeId);
     rp.data.Add(Param.TOKEN, token);
     if (modified != null)
     {
         rp.data.Add(Param.MODIFIED, StringUtil.DateTimeToString((DateTime)modified));
     }
     rp.callback = handle;
     apiCaller.GetSceneType(rp);
 }
Esempio n. 14
0
 public static void GetItem(string token, int numIid, DateTime?modified,
                            ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.PRODUCT_ID, "" + numIid);
     rp.data.Add(Param.TOKEN, token);
     if (modified != null)
     {
         rp.data.Add(Param.MODIFIED, StringUtil.DateTimeToString((DateTime)modified));
     }
     rp.callback = handle;
     apiCaller.GetItem(rp);
 }
Esempio n. 15
0
    public static void GetSceneSnapshot(string token, List <int> sceneIds,
                                        ResponseHandle handle)
    {
        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.TOKEN, token);
        StringBuilder sb = new StringBuilder();

        foreach (int sceneId in sceneIds)
        {
            sb.Append(sceneId + ",");
        }
        rp.data.Add(Param.SCENE_IDS, sb.ToString());
        rp.callback = handle;
        apiCaller.GetSceneSnapshot(rp);
    }
Esempio n. 16
0
    public static void GetAssets(string token, List <int> assetIds, ResponseHandle handle)
    {
        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.TOKEN, token);
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < assetIds.Count; ++i)
        {
            sb.Append(assetIds[i]);
            if (i != assetIds.Count - 1)
            {
                sb.Append(",");
            }
        }
        rp.data.Add(Param.ASSET_IDS, sb.ToString());
        rp.callback = handle;
        apiCaller.GetAssets(rp);
    }
Esempio n. 17
0
    public static void GetPictures(string token, List <string> pictureIds,
                                   ResponseHandle handle)
    {
        ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
        rp.data = new Dictionary <string, string>();
        rp.data.Add(Param.TOKEN, token);
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < pictureIds.Count; ++i)
        {
            if (pictureIds[i] == null)
            {
                continue;
            }
            sb.Append(pictureIds[i]);
            if (i != pictureIds.Count - 1)
            {
                sb.Append(",");
            }
        }
        rp.data.Add(Param.PICTURES, sb.ToString());
        rp.callback = handle;
        apiCaller.GetPictures(rp);
    }
Esempio n. 18
0
 public static void UploadScene(string token, string metaData, string unityPath,
                                string iphonePath, string androidPath,
                                ResponseHandle handle)
 {
     ApiCaller.RequestParams rp = new ApiCaller.RequestParams();
     rp.data = new Dictionary <string, string>();
     rp.data.Add(Param.TOKEN, token);
     rp.data.Add(Param.META_DATA, metaData);
     rp.data.Add(Param.ASSET_TYPE, "scene");
     if (!string.IsNullOrEmpty(unityPath))
     {
         rp.data.Add(Param.ASSET_UNITY, unityPath);
     }
     if (!string.IsNullOrEmpty(iphonePath))
     {
         rp.data.Add(Param.ASSET_IPHONE, iphonePath);
     }
     if (!string.IsNullOrEmpty(androidPath))
     {
         rp.data.Add(Param.ASSET_ANDROID, androidPath);
     }
     rp.callback = handle;
     apiCaller.UploadAssetBundle(rp);
 }