コード例 #1
0
    static int Abort(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
                obj.Abort();
                return(0);
            }
            else if (count == 2)
            {
                ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
                bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
                obj.Abort(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ShibaInu.HttpRequest.Abort"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
 static int CleanPostData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
         obj.CleanPostData();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #3
0
 static int SetLuaCallback(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ShibaInu.HttpRequest obj  = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
         LuaFunction          arg0 = ToLua.CheckLuaFunction(L, 2);
         obj.SetLuaCallback(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
 static int SetProxy(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         int    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.SetProxy(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #5
0
 static int AppedPostData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)ToLua.CheckObject <ShibaInu.HttpRequest>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         string arg1 = ToLua.CheckString(L, 3);
         obj.AppedPostData(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #6
0
    static int set_callback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest        obj  = (ShibaInu.HttpRequest)o;
            System.Action <int, string> arg0 = (System.Action <int, string>)ToLua.CheckDelegate <System.Action <int, string> >(L, 2);
            obj.callback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index callback on a nil value"));
        }
    }
コード例 #7
0
    static int set_postData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.postData = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index postData on a nil value"));
        }
    }
コード例 #8
0
    static int set_timeout(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.timeout = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeout on a nil value"));
        }
    }
コード例 #9
0
    static int get_requeting(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)o;
            bool ret = obj.requeting;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index requeting on a nil value"));
        }
    }
コード例 #10
0
    static int get_callback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest        obj = (ShibaInu.HttpRequest)o;
            System.Action <int, string> ret = obj.callback;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index callback on a nil value"));
        }
    }
コード例 #11
0
    static int get_postData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)o;
            string ret = obj.postData;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index postData on a nil value"));
        }
    }
コード例 #12
0
    static int get_timeout(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ShibaInu.HttpRequest obj = (ShibaInu.HttpRequest)o;
            int ret = obj.timeout;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeout on a nil value"));
        }
    }
コード例 #13
0
 static int SendHttpRequest(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         string               arg0 = ToLua.CheckString(L, 1);
         LuaFunction          arg1 = ToLua.CheckLuaFunction(L, 2);
         string               arg2 = ToLua.CheckString(L, 3);
         ShibaInu.HttpRequest o    = ShibaInu.LuaHelper.SendHttpRequest(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #14
0
    static int _CreateShibaInu_HttpRequest(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                ShibaInu.HttpRequest obj = new ShibaInu.HttpRequest();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ShibaInu.HttpRequest.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }