コード例 #1
0
        public void SetDLCCallbackWithParams(TDSDLCCallback callback, bool checkOnce, string publicKey)
        {
            Command command = new Command.Builder()
                .Service(TDSLicenseConstants.TDS_LICENSE_SERVICE)
                .Method("setDLCCallbackWithParams")
                .Callback(true)
                .Args("checkOnce", checkOnce)
                .Args("publicKey", publicKey)
                .CommandBuilder();
            EngineBridge.GetInstance().CallHandler(command, (result) =>
             {
                 Debug.Log("result:" + result.toJSON());
                 if (result.code != Result.RESULT_SUCCESS)
                 {
                     return;
                 }

                 if (string.IsNullOrEmpty(result.content))
                 {
                     return;
                 }

                 Dictionary<string, object> dic = Json.Deserialize(result.content) as Dictionary<string, object>;

                 string dlc = SafeDictionary.GetValue<string>(dic, "orderDLC") as string;
                 if (!string.IsNullOrEmpty(dlc))
                 {
                     int statusCode = SafeDictionary.GetValue<int>(dic, "orderStatus");
                     callback.OnOrderCallBack(dlc, statusCode);
                     return;
                 }

                 int code = SafeDictionary.GetValue<int>(dic, "queryCode");
                 string queryListJson = SafeDictionary.GetValue<string>(dic, "queryResult");

                 Dictionary<string, object> quertListDic = Json.Deserialize(queryListJson) as Dictionary<string, object>;

                 callback.OnQueryCallBack(code, quertListDic);
             });
        }
コード例 #2
0
 public static void SetDLCCallbackWithParams(TDSDLCCallback callback, bool checkOnce, string publicKey)
 {
     TDSLicenseImpl.GetInstance().SetDLCCallbackWithParams(callback, checkOnce, publicKey);
 }
コード例 #3
0
 public void SetDLCCallback(TDSDLCCallback callback)
 {
     SetDLCCallbackWithParams(callback, false, null);
 }
コード例 #4
0
 public static void SetDLCCallback(TDSDLCCallback callback)
 {
     TDSLicenseImpl.GetInstance().SetDLCCallback(callback);
 }