Ejemplo n.º 1
0
 static int detachBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NetCore.ByteStream obj = (NetCore.ByteStream)ToLua.CheckObject(L, 1, typeof(NetCore.ByteStream));
         obj.detachBuffer();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 2
0
 static int readInt16(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NetCore.ByteStream obj = (NetCore.ByteStream)ToLua.CheckObject(L, 1, typeof(NetCore.ByteStream));
         short o = obj.readInt16();
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 3
0
 static int writeInt8(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NetCore.ByteStream obj = (NetCore.ByteStream)ToLua.CheckObject(L, 1, typeof(NetCore.ByteStream));
         byte arg0 = (byte)LuaDLL.luaL_checknumber(L, 2);
         obj.writeInt8(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 4
0
 static int byteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NetCore.ByteStream obj = (NetCore.ByteStream)ToLua.CheckObject(L, 1, typeof(NetCore.ByteStream));
         NetCore.ByteArray  o   = obj.byteBuffer();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 5
0
 static int writeString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NetCore.ByteStream obj  = (NetCore.ByteStream)ToLua.CheckObject(L, 1, typeof(NetCore.ByteStream));
         string             arg0 = ToLua.CheckString(L, 2);
         obj.writeString(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 6
0
    static int _CreateNetCore_ByteStream(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

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