Exemplo n.º 1
0
        static int _m_Post(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            CatLib.Contracts.Network.IConnectorHttp __cl_gen_to_be_invoked = (CatLib.Contracts.Network.IConnectorHttp)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    byte[] bytes = LuaAPI.lua_tobytes(L, 2);

                    __cl_gen_to_be_invoked.Post(bytes);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.Dictionary <string, string> >(L, 3))
                {
                    string action = LuaAPI.lua_tostring(L, 2);
                    System.Collections.Generic.Dictionary <string, string> fields = (System.Collections.Generic.Dictionary <string, string>)translator.GetObject(L, 3, typeof(System.Collections.Generic.Dictionary <string, string>));

                    __cl_gen_to_be_invoked.Post(action, fields);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    string action = LuaAPI.lua_tostring(L, 2);
                    byte[] bytes  = LuaAPI.lua_tobytes(L, 3);

                    __cl_gen_to_be_invoked.Post(action, bytes);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.WWWForm>(L, 3))
                {
                    string action = LuaAPI.lua_tostring(L, 2);
                    UnityEngine.WWWForm formData = (UnityEngine.WWWForm)translator.GetObject(L, 3, typeof(UnityEngine.WWWForm));

                    __cl_gen_to_be_invoked.Post(action, formData);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to CatLib.Contracts.Network.IConnectorHttp.Post!"));
        }
Exemplo n.º 2
0
 /** リクエスト。ロードURL。テクスチャファイル。
  */
 public void RequestLoadUrlTextureFile(Path a_url_path, UnityEngine.WWWForm a_post_data, Fee.File.CustomCertificateHandler a_certificate_handler)
 {
     this.request_type                = RequestType.LoadUrlTextureFile;
     this.request_path                = a_url_path;
     this.request_post_data           = a_post_data;
     this.request_certificate_handler = a_certificate_handler;
 }
Exemplo n.º 3
0
        /** リクエスト。ロードURL。テクスチャファイル。
         */
        public bool RequestLoadUrlTextureFile(Path a_url_path, UnityEngine.WWWForm a_post_data, Fee.File.CustomCertificateHandler a_certificate_handler)
        {
            if (this.is_busy == false)
            {
                this.is_busy = true;

                //is_cancel
                this.is_cancel = false;

                //request
                this.request_post_data           = a_post_data;
                this.request_certificate_handler = a_certificate_handler;
                this.request_path = a_url_path;

                //result
                this.result_progress       = 0.0f;
                this.result_errorstring    = null;
                this.result_type           = ResultType.None;
                this.result_asset          = null;
                this.result_responseheader = null;

                Function.Function.StartCoroutine(this.DoLoadUrlTextureFile());
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        /** RequestLoadUrl
         */
        public Item RequestLoadUrl(LoadRequestType a_request_type, Path a_path, UnityEngine.WWWForm a_post_data = null, Fee.File.CustomCertificateHandler a_certificate_handler = null)
        {
            switch (a_request_type)
            {
            //ロードURL。

            case LoadRequestType.LoadUrlBinaryFile:
            {
                WorkItem t_work_item = new WorkItem();
                t_work_item.RequestLoadUrlBinaryFile(a_path, a_post_data, a_certificate_handler);
                this.add_list.Add(t_work_item);
                return(t_work_item.GetItem());
            } break;

            case LoadRequestType.LoadUrlTextFile:
            {
                WorkItem t_work_item = new WorkItem();
                t_work_item.RequestLoadUrlTextFile(a_path, a_post_data, a_certificate_handler);
                this.add_list.Add(t_work_item);
                return(t_work_item.GetItem());
            } break;

            case LoadRequestType.LoadUrlTextureFile:
            {
                WorkItem t_work_item = new WorkItem();
                t_work_item.RequestLoadUrlTextureFile(a_path, a_post_data, a_certificate_handler);
                this.add_list.Add(t_work_item);
                return(t_work_item.GetItem());
            } break;
            }

            Tool.Assert(false);
            return(null);
        }
Exemplo n.º 5
0
        static StackObject *PostUrlWithFormData_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Action <System.Int32, System.String> @cb = (System.Action <System.Int32, System.String>) typeof(System.Action <System.Int32, System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.WWWForm @form_data = (UnityEngine.WWWForm) typeof(UnityEngine.WWWForm).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.String @url = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            Casinos.MbAsyncLoadAssets instance_of_this_method = (Casinos.MbAsyncLoadAssets) typeof(Casinos.MbAsyncLoadAssets).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.PostUrlWithFormData(@url, @form_data, @cb);

            return(__ret);
        }
Exemplo n.º 6
0
        /** リクエスト。ロードストリーミングアセット。テクスチャファイル。
         */
        public bool RequestLoadStreamingAssetsTextureFile(Path a_relative_path)
        {
            if (this.is_busy == false)
            {
                this.is_busy = true;

                //is_cancel
                this.is_cancel = false;

                //request
                this.request_post_data           = null;
                this.request_certificate_handler = null;
                this.request_path = a_relative_path;

                //result
                this.result_progress       = 0.0f;
                this.result_errorstring    = null;
                this.result_type           = ResultType.None;
                this.result_asset          = null;
                this.result_responseheader = null;

                Function.Function.StartCoroutine(this.DoLoadStreamingAssetsTextureFile());
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Set or overwrite the internal form. Remarks: on WP8 it doesn't supported!
        /// </summary>
        public void SetFields(UnityEngine.WWWForm wwwForm)
        {
#if !UNITY_WP8
            FormUsage = HTTPFormUsage.Unity;
            FormImpl  = new UnityForm(wwwForm);
#endif
        }
Exemplo n.º 8
0
        static StackObject *Post_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.WWWForm @formData = (UnityEngine.WWWForm) typeof(UnityEngine.WWWForm).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @uri = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            var result_of_this_method = UnityEngine.Networking.UnityWebRequest.Post(@uri, @formData);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemplo n.º 9
0
        static int _m_PostUrlWithFormData(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Casinos.MbHelper gen_to_be_invoked = (Casinos.MbHelper)translator.FastGetCSObj(L, 1);



                {
                    string _url = LuaAPI.lua_tostring(L, 2);
                    UnityEngine.WWWForm         _form_data = (UnityEngine.WWWForm)translator.GetObject(L, 3, typeof(UnityEngine.WWWForm));
                    System.Action <int, string> _cb        = translator.GetDelegate <System.Action <int, string> >(L, 4);

                    gen_to_be_invoked.PostUrlWithFormData(_url, _form_data, _cb);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemplo n.º 10
0
        /** constructor
         */
        public WorkItem()
        {
            //mode
            this.mode = Mode.Start;

            //request_type
            this.request_type = RequestType.None;

            //request_path
            this.request_path = null;

            //request_post_data
            this.request_post_data = null;

            //request_certificate_handler
            this.request_certificate_handler = null;

            //request_binary
            this.request_binary = null;

            //request_text
            this.request_text = null;

            //request_texture
            this.request_texture = null;

            //item
            this.item = new Item();
        }
Exemplo n.º 11
0
        /** リクエスト。ロードストリーミングアセット。サウンドプール。
         */
        public bool RequestLoadStreamingAssetsSoundPool(Fee.File.Path a_path, uint a_data_version)
        {
            if (this.is_busy == false)
            {
                this.is_busy = true;

                //is_cancel
                this.is_cancel = false;

                //request
                this.request_path                = a_path;
                this.request_post_data           = null;
                this.request_certificate_handler = null;
                this.request_data_version        = a_data_version;

                //result
                this.result_progress       = 0.0f;
                this.result_errorstring    = null;
                this.result_type           = ResultType.None;
                this.result_soundpool      = null;
                this.result_responseheader = null;

                Function.Function.StartCoroutine(this.DoLoadStreamingAssetsSoundPool());
                return(true);
            }

            return(false);
        }
Exemplo n.º 12
0
        /** リクエスト。ロードURL。サウンドプール。
         *
         *      ロード後ローカルセーブ。
         *
         */
        public Item RequestLoadUrlSoundPool(File.Path a_path, UnityEngine.WWWForm a_post_data, Fee.File.CustomCertificateHandler a_certificate_handler, uint a_data_version)
        {
            WorkItem t_work_item = new WorkItem();

            t_work_item.RequestLoadUrlBinaryFile(a_path, a_post_data, a_certificate_handler, a_data_version);
            this.add_list.Add(t_work_item);
            return(t_work_item.GetItem());
        }
Exemplo n.º 13
0
 /** リクエスト。ロードURL。サウンドプール。
  */
 public void RequestLoadUrlBinaryFile(File.Path a_url_path, UnityEngine.WWWForm a_post_data, Fee.File.CustomCertificateHandler a_certificate_handler, uint a_data_version)
 {
     this.request_type                = RequestType.LoadUrlSoundPool;
     this.request_path                = a_url_path;
     this.request_post_data           = a_post_data;
     this.request_certificate_handler = a_certificate_handler;
     this.request_data_version        = a_data_version;
 }
Exemplo n.º 14
0
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *__ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new UnityEngine.WWWForm();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemplo n.º 15
0
 public WWW(System.String url, UnityEngine.WWWForm form)
 {
     //Mock Data:
     m_functionCallCounts = new Dictionary <string, int>();
     if (!m_functionCallCounts.ContainsKey("Void .ctor(String, WWWForm)"))
     {
         m_functionCallCounts.Add("Void .ctor(String, WWWForm)", 0);
     }
     m_functionCallCounts["Void .ctor(String, WWWForm)"]++;
 }
Exemplo n.º 16
0
        static int _g_get_headers(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.WWWForm __cl_gen_to_be_invoked = (UnityEngine.WWWForm)translator.FastGetCSObj(L, 1);
                translator.Push(L, __cl_gen_to_be_invoked.headers);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
        static int _g_get_data(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.WWWForm gen_to_be_invoked = (UnityEngine.WWWForm)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.data);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
        static int _m_AddBinaryData(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.WWWForm gen_to_be_invoked = (UnityEngine.WWWForm)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    string _fieldName = LuaAPI.lua_tostring(L, 2);
                    byte[] _contents  = LuaAPI.lua_tobytes(L, 3);

                    gen_to_be_invoked.AddBinaryData(_fieldName, _contents);



                    return(0);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING))
                {
                    string _fieldName = LuaAPI.lua_tostring(L, 2);
                    byte[] _contents  = LuaAPI.lua_tobytes(L, 3);
                    string _fileName  = LuaAPI.lua_tostring(L, 4);

                    gen_to_be_invoked.AddBinaryData(_fieldName, _contents, _fileName);



                    return(0);
                }
                if (gen_param_count == 5 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 5) || LuaAPI.lua_type(L, 5) == LuaTypes.LUA_TSTRING))
                {
                    string _fieldName = LuaAPI.lua_tostring(L, 2);
                    byte[] _contents  = LuaAPI.lua_tobytes(L, 3);
                    string _fileName  = LuaAPI.lua_tostring(L, 4);
                    string _mimeType  = LuaAPI.lua_tostring(L, 5);

                    gen_to_be_invoked.AddBinaryData(_fieldName, _contents, _fileName, _mimeType);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.WWWForm.AddBinaryData!"));
        }
Exemplo n.º 19
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string url = LuaAPI.lua_tostring(L, 2);

                    UnityEngine.WWW __cl_gen_ret = new UnityEngine.WWW(url);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.WWWForm>(L, 3))
                {
                    string url = LuaAPI.lua_tostring(L, 2);
                    UnityEngine.WWWForm form = (UnityEngine.WWWForm)translator.GetObject(L, 3, typeof(UnityEngine.WWWForm));

                    UnityEngine.WWW __cl_gen_ret = new UnityEngine.WWW(url, form);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    string url      = LuaAPI.lua_tostring(L, 2);
                    byte[] postData = LuaAPI.lua_tobytes(L, 3);

                    UnityEngine.WWW __cl_gen_ret = new UnityEngine.WWW(url, postData);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.Dictionary <string, string> >(L, 4))
                {
                    string url      = LuaAPI.lua_tostring(L, 2);
                    byte[] postData = LuaAPI.lua_tobytes(L, 3);
                    System.Collections.Generic.Dictionary <string, string> headers = (System.Collections.Generic.Dictionary <string, string>)translator.GetObject(L, 4, typeof(System.Collections.Generic.Dictionary <string, string>));

                    UnityEngine.WWW __cl_gen_ret = new UnityEngine.WWW(url, postData, headers);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.WWW constructor!"));
        }
        static int _m_AddField(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.WWWForm gen_to_be_invoked = (UnityEngine.WWWForm)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    string _fieldName = LuaAPI.lua_tostring(L, 2);
                    int    _i         = LuaAPI.xlua_tointeger(L, 3);

                    gen_to_be_invoked.AddField(_fieldName, _i);



                    return(0);
                }
                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
                {
                    string _fieldName = LuaAPI.lua_tostring(L, 2);
                    string _value     = LuaAPI.lua_tostring(L, 3);

                    gen_to_be_invoked.AddField(_fieldName, _value);



                    return(0);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Text.Encoding>(L, 4))
                {
                    string _fieldName       = LuaAPI.lua_tostring(L, 2);
                    string _value           = LuaAPI.lua_tostring(L, 3);
                    System.Text.Encoding _e = (System.Text.Encoding)translator.GetObject(L, 4, typeof(System.Text.Encoding));

                    gen_to_be_invoked.AddField(_fieldName, _value, _e);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.WWWForm.AddField!"));
        }
Exemplo n.º 21
0
        /// <summary>Adds the given form to this request.
        /// Note that if you wish to also use custom headers with a form, call this first.
        /// Then, add to the Headers property.</summary>
        /// <param name="form">The form to attach to this request.</param>
        public void AttachForm(UnityEngine.WWWForm form)
        {
            // Get the payload:
            request = form.data;

            // Add each header (but don't overwrite):
            Headers rH = requestHeaders;

            foreach (KeyValuePair <string, string> kvp in form.headers)
            {
                // Add:
                rH.AddIfNew(kvp.Key, kvp.Value);
            }
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    var gen_ret = new UnityEngine.WWWForm();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.WWWForm constructor!"));
        }
Exemplo n.º 23
0
        static StackObject *Ctor_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.WWWForm form = (UnityEngine.WWWForm) typeof(UnityEngine.WWWForm).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String url = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = new UnityEngine.WWW(url, form);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemplo n.º 24
0
        /** constructor
         */
        public Main_WebRequest()
        {
            this.is_busy     = false;
            this.is_cancel   = false;
            this.is_shutdown = false;

            //request
            this.request_post_data           = null;
            this.request_certificate_handler = null;
            this.request_path = null;

            //result
            this.result_progress       = 0.0f;
            this.result_errorstring    = null;
            this.result_type           = ResultType.None;
            this.result_asset          = null;
            this.result_responseheader = null;
        }
Exemplo n.º 25
0
        public static System.Collections.IEnumerator Post(string url)
        {
            UnityEngine.WWWForm form = new UnityEngine.WWWForm();
            form.AddField("key", "value");
            form.AddField("name", "dely");

            UnityEngine.Networking.UnityWebRequest webRequest = UnityEngine.Networking.UnityWebRequest.Post(url, form);

            yield return(webRequest.SendWebRequest());

            if (webRequest.isHttpError || webRequest.isNetworkError)
            {
                Debug.Log(webRequest.error);
            }
            else
            {
                Debug.Log(webRequest.downloadHandler.text);
            }
        }
Exemplo n.º 26
0
        /** constructor
         */
        public Main_File()
        {
            this.is_busy     = false;
            this.is_cancel   = false;
            this.is_shutdown = false;

            //request
            this.request_path                = null;
            this.request_post_data           = null;
            this.request_certificate_handler = null;
            this.request_data_version        = 0;

            //result
            this.result_progress       = 0.0f;
            this.result_errorstring    = null;
            this.result_type           = ResultType.None;
            this.result_soundpool      = null;
            this.result_responseheader = null;
        }
Exemplo n.º 27
0
        static StackObject *AddField_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @i = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @fieldName = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.WWWForm instance_of_this_method = (UnityEngine.WWWForm) typeof(UnityEngine.WWWForm).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AddField(@fieldName, @i);

            return(__ret);
        }
Exemplo n.º 28
0
        /** constructor
         */
        public WorkItem()
        {
            //mode
            this.mode = Mode.Start;

            //request_type
            this.request_type = RequestType.None;

            //request_path
            this.request_path = null;

            //request_post_data
            this.request_post_data = null;

            //request_certificate_handler
            this.request_certificate_handler = null;

            //request_data_version
            this.request_data_version = 0;

            //item
            this.item = new Item();
        }
Exemplo n.º 29
0
        /** CreateWebRequestInstance
         */
        private static UnityEngine.Networking.UnityWebRequest CreateWebRequestInstance(Fee.File.Path a_path, UnityEngine.WWWForm a_post_data, Fee.File.CustomCertificateHandler a_certificate_handler)
        {
            UnityEngine.Networking.UnityWebRequest t_webrequest = null;

            if (a_post_data != null)
            {
                t_webrequest = UnityEngine.Networking.UnityWebRequest.Post(a_path.GetPath(), a_post_data);
            }
            else
            {
                t_webrequest = UnityEngine.Networking.UnityWebRequest.Get(a_path.GetPath());
            }

            if (a_certificate_handler != null)
            {
                a_certificate_handler.InitializeCheck();
                t_webrequest.certificateHandler = a_certificate_handler;
            }
            else
            {
                t_webrequest.certificateHandler = new Fee.File.CustomCertificateHandler(Fee.File.File.GetInstance().GetCertificateString(a_path.GetPath()));
            }

            return(t_webrequest);
        }
Exemplo n.º 30
0
        int UnityEngineNetworkingUnityWebRequest_m_Post_xlua_st_(RealStatePtr L, int gen_param_count)
        {
            ObjectTranslator translator = this;


            if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
            {
                string _uri      = LuaAPI.lua_tostring(L, 1);
                string _postData = LuaAPI.lua_tostring(L, 2);

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _postData);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && translator.Assignable <System.Uri>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
            {
                System.Uri _uri      = (System.Uri)translator.GetObject(L, 1, typeof(System.Uri));
                string     _postData = LuaAPI.lua_tostring(L, 2);

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _postData);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.WWWForm>(L, 2))
            {
                string _uri = LuaAPI.lua_tostring(L, 1);
                UnityEngine.WWWForm _formData = (UnityEngine.WWWForm)translator.GetObject(L, 2, typeof(UnityEngine.WWWForm));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _formData);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && translator.Assignable <System.Uri>(L, 1) && translator.Assignable <UnityEngine.WWWForm>(L, 2))
            {
                System.Uri          _uri      = (System.Uri)translator.GetObject(L, 1, typeof(System.Uri));
                UnityEngine.WWWForm _formData = (UnityEngine.WWWForm)translator.GetObject(L, 2, typeof(UnityEngine.WWWForm));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _formData);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> >(L, 2))
            {
                string _uri = LuaAPI.lua_tostring(L, 1);
                System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> _multipartFormSections = (System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _multipartFormSections);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && translator.Assignable <System.Uri>(L, 1) && translator.Assignable <System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> >(L, 2))
            {
                System.Uri _uri = (System.Uri)translator.GetObject(L, 1, typeof(System.Uri));
                System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> _multipartFormSections = (System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _multipartFormSections);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.Dictionary <string, string> >(L, 2))
            {
                string _uri = LuaAPI.lua_tostring(L, 1);
                System.Collections.Generic.Dictionary <string, string> _formFields = (System.Collections.Generic.Dictionary <string, string>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, string>));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _formFields);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 2 && translator.Assignable <System.Uri>(L, 1) && translator.Assignable <System.Collections.Generic.Dictionary <string, string> >(L, 2))
            {
                System.Uri _uri = (System.Uri)translator.GetObject(L, 1, typeof(System.Uri));
                System.Collections.Generic.Dictionary <string, string> _formFields = (System.Collections.Generic.Dictionary <string, string>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, string>));

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _formFields);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> >(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
            {
                string _uri = LuaAPI.lua_tostring(L, 1);
                System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> _multipartFormSections = (System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>));
                byte[] _boundary = LuaAPI.lua_tobytes(L, 3);

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _multipartFormSections, _boundary);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 3 && translator.Assignable <System.Uri>(L, 1) && translator.Assignable <System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> >(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
            {
                System.Uri _uri = (System.Uri)translator.GetObject(L, 1, typeof(System.Uri));
                System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> _multipartFormSections = (System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection>));
                byte[] _boundary = LuaAPI.lua_tobytes(L, 3);

                UnityEngine.Networking.UnityWebRequest gen_ret = UnityEngine.Networking.UnityWebRequest.Post(_uri, _multipartFormSections, _boundary);
                translator.Push(L, gen_ret);



                return(1);
            }


            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Networking.UnityWebRequest.Post!"));
        }