Exemplo n.º 1
0
    static int SendCommand(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                obj.SendCommand(arg0);
                return(0);
            }
            else if (count == 3)
            {
                CFramework.NetworkManager obj = (CFramework.NetworkManager)ToLua.CheckObject <CFramework.NetworkManager>(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                CFramework.ByteBuffer arg1 = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 3);
                obj.SendCommand(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CFramework.NetworkManager.SendCommand"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 2
0
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.ByteBuffer obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 3
0
 static int WriteByte(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.ByteBuffer obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         byte arg0 = (byte)LuaDLL.luaL_checknumber(L, 2);
         obj.WriteByte(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 4
0
 static int ToBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.ByteBuffer obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         byte[] o = obj.ToBytes();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 5
0
 static int ReadBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.ByteBuffer      obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         LuaInterface.LuaByteBuffer o   = obj.ReadBuffer();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 6
0
 static int ReadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         CFramework.ByteBuffer obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 7
0
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.ByteBuffer obj  = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         LuaByteBuffer         arg0 = new LuaByteBuffer(ToLua.CheckByteBuffer(L, 2));
         obj.WriteBuffer(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 8
0
 static int WriteLong(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         CFramework.ByteBuffer obj = (CFramework.ByteBuffer)ToLua.CheckObject <CFramework.ByteBuffer>(L, 1);
         long arg0 = LuaDLL.tolua_checkint64(L, 2);
         obj.WriteLong(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 9
0
    static int _CreateCFramework_ByteBuffer(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                CFramework.ByteBuffer obj = new CFramework.ByteBuffer();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes <byte[]>(L, 1))
            {
                byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
                CFramework.ByteBuffer obj = new CFramework.ByteBuffer(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes <bool>(L, 1))
            {
                bool arg0 = LuaDLL.lua_toboolean(L, 1);
                CFramework.ByteBuffer obj = new CFramework.ByteBuffer(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: CFramework.ByteBuffer.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }