예제 #1
0
    static int _CreateColaFramework_NetWork_ByteBuffer(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                ColaFramework.NetWork.ByteBuffer obj = new ColaFramework.NetWork.ByteBuffer();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
                ColaFramework.NetWork.ByteBuffer obj = new ColaFramework.NetWork.ByteBuffer(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ColaFramework.NetWork.ByteBuffer.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #2
0
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.ByteBuffer>(L, 1);
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #3
0
 static int WriteByte(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.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));
     }
 }
예제 #4
0
 static int ToBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.ByteBuffer>(L, 1);
         byte[] o = obj.ToBytes();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #5
0
 static int ReadBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.ByteBuffer>(L, 1);
         LuaInterface.LuaByteBuffer       o   = obj.ReadBuffer();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #6
0
 static int ReadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.ByteBuffer>(L, 1);
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #7
0
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.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));
     }
 }
예제 #8
0
 static int WriteuLong(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ColaFramework.NetWork.ByteBuffer obj = (ColaFramework.NetWork.ByteBuffer)ToLua.CheckObject <ColaFramework.NetWork.ByteBuffer>(L, 1);
         ulong arg0 = LuaDLL.tolua_checkuint64(L, 2);
         obj.WriteuLong(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }