Exemplo n.º 1
0
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)ToLua.CheckObject <ColaFramework.NetWork.SocketManager>(L, 1);
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 2
0
 static int SetTimeOut(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)ToLua.CheckObject <ColaFramework.NetWork.SocketManager>(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.SetTimeOut(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 3
0
 static int Connect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)ToLua.CheckObject <ColaFramework.NetWork.SocketManager>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         int    arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.Connect(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
 static int SendMsg(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)ToLua.CheckObject <ColaFramework.NetWork.SocketManager>(L, 1);
         int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         byte[] arg1 = ToLua.CheckByteBuffer(L, 3);
         obj.SendMsg(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 5
0
    static int set_OnErrorCode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)o;
            System.Action <int> arg0 = (System.Action <int>)ToLua.CheckDelegate <System.Action <int> >(L, 2);
            obj.OnErrorCode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OnErrorCode on a nil value"));
        }
    }
Exemplo n.º 6
0
    static int get_IsConnceted(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)o;
            bool ret = obj.IsConnceted;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index IsConnceted on a nil value"));
        }
    }
Exemplo n.º 7
0
    static int get_OnErrorCode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ColaFramework.NetWork.SocketManager obj = (ColaFramework.NetWork.SocketManager)o;
            System.Action <int> ret = obj.OnErrorCode;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OnErrorCode on a nil value"));
        }
    }
Exemplo n.º 8
0
    static int _CreateColaFramework_NetWork_SocketManager(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

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