static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MyFrameWork.ByteBuffer obj = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int WriteInt(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MyFrameWork.ByteBuffer obj = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.WriteInt(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ReadBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MyFrameWork.ByteBuffer     obj = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         LuaInterface.LuaByteBuffer o   = obj.ReadBuffer();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ToBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MyFrameWork.ByteBuffer obj = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         byte[] o = obj.ToBytes();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ReadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MyFrameWork.ByteBuffer obj = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MyFrameWork.ByteBuffer obj  = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ByteBuffer));
         LuaByteBuffer          arg0 = new LuaByteBuffer(ToLua.CheckByteBuffer(L, 2));
         obj.WriteBuffer(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 7
0
 static int SendMessage(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MyFrameWork.NetworkManager obj  = (MyFrameWork.NetworkManager)ToLua.CheckObject(L, 1, typeof(MyFrameWork.NetworkManager));
         MyFrameWork.ByteBuffer     arg0 = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 2, typeof(MyFrameWork.ByteBuffer));
         obj.SendMessage(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 8
0
 static int AddEvent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         MyFrameWork.ByteBuffer arg1 = (MyFrameWork.ByteBuffer)ToLua.CheckObject(L, 2, typeof(MyFrameWork.ByteBuffer));
         MyFrameWork.NetworkManager.AddEvent(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int _CreateMyFrameWork_ByteBuffer(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            MyFrameWork.ByteBuffer obj = new MyFrameWork.ByteBuffer();
            ToLua.PushObject(L, obj);
            return(1);
        }
        else if (count == 1 && ToLua.CheckTypes(L, 1, typeof(byte[])))
        {
            byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
            MyFrameWork.ByteBuffer obj = new MyFrameWork.ByteBuffer(arg0);
            ToLua.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: MyFrameWork.ByteBuffer.New");
        }

        return(0);
    }