コード例 #1
0
    static int set_NetErrorCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NetCore.Net          obj       = (NetCore.Net)o;
            NetCore.Net.NetError arg0      = null;
            LuaTypes             funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (NetCore.Net.NetError)ToLua.CheckObject(L, 2, typeof(NetCore.Net.NetError));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(NetCore.Net.NetError), func) as NetCore.Net.NetError;
            }

            obj.NetErrorCallback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index NetErrorCallback on a nil value" : e.Message));
        }
    }
コード例 #2
0
    static int pushNetTask(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            NetCore.Net          obj       = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
            NetCore.Net.NetError arg0      = null;
            LuaTypes             funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (NetCore.Net.NetError)ToLua.CheckObject(L, 2, typeof(NetCore.Net.NetError));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(NetCore.Net.NetError), func) as NetCore.Net.NetError;
            }

            obj.pushNetTask(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #3
0
 static int shutdownNet(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NetCore.Net obj = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         obj.shutdownNet();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
 static int notifyError(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NetCore.Net  obj  = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         NetErrorType arg0 = (NetErrorType)ToLua.CheckObject(L, 2, typeof(NetErrorType));
         obj.notifyError(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #5
0
 static int pickRevQueue(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NetCore.Net       obj = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         NetCore.ByteArray o   = obj.pickRevQueue();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #6
0
 static int sendBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NetCore.Net       obj  = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         NetCore.ByteArray arg0 = (NetCore.ByteArray)ToLua.CheckObject(L, 2, typeof(NetCore.ByteArray));
         obj.sendBytes(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #7
0
 static int setIp(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NetCore.Net obj  = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         string      arg0 = ToLua.CheckString(L, 2);
         int         arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.setIp(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #8
0
    static int get_NetErrorCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NetCore.Net          obj = (NetCore.Net)o;
            NetCore.Net.NetError ret = obj.NetErrorCallback;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index NetErrorCallback on a nil value" : e.Message));
        }
    }
コード例 #9
0
 static int CallMethod(IntPtr L)
 {
     try
     {
         int         count = LuaDLL.lua_gettop(L);
         NetCore.Net obj   = (NetCore.Net)ToLua.CheckObject(L, 1, typeof(NetCore.Net));
         string      arg0  = ToLua.CheckString(L, 2);
         object[]    arg1  = ToLua.ToParamsObject(L, 3, count - 2);
         object[]    o     = obj.CallMethod(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #10
0
    static int _CreateNetCore_Net(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

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