static int set_frames(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj = (DNet.VideoData)o;
            System.Collections.Generic.List <DNet.VideoFrameData> arg0 = (System.Collections.Generic.List <DNet.VideoFrameData>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <DNet.VideoFrameData>));
            obj.frames = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index frames on a nil value"));
        }
    }
    static int get_rule(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj = (DNet.VideoData)o;
            string         ret = obj.rule;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index rule on a nil value"));
        }
    }
    static int get_headData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj = (DNet.VideoData)o;
            byte[]         ret = obj.headData;
            LuaDLL.tolua_pushlstring(L, ret, ret.Length);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index headData on a nil value"));
        }
    }
    static int get_frames(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj = (DNet.VideoData)o;
            System.Collections.Generic.List <DNet.VideoFrameData> ret = obj.frames;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index frames on a nil value"));
        }
    }
    static int set_headData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj  = (DNet.VideoData)o;
            byte[]         arg0 = ToLua.CheckByteBuffer(L, 2);
            obj.headData = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index headData on a nil value"));
        }
    }
    static int set_rule(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DNet.VideoData obj  = (DNet.VideoData)o;
            string         arg0 = ToLua.CheckString(L, 2);
            obj.rule = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index rule on a nil value"));
        }
    }
 static int QPYX__CreateDNet_VideoData_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 0)
         {
             DNet.VideoData QPYX_obj_YXQP = new DNet.VideoData();
             ToLua.PushObject(L_YXQP, QPYX_obj_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to ctor method: DNet.VideoData.New"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
    static int _CreateDNet_VideoData(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                DNet.VideoData obj = new DNet.VideoData();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: DNet.VideoData.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int QPYX_set_frames_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            System.Collections.Generic.List <DNet.VideoFrameData> QPYX_arg0_YXQP = (System.Collections.Generic.List <DNet.VideoFrameData>)ToLua.CheckObject(L_YXQP, 2, typeof(System.Collections.Generic.List <DNet.VideoFrameData>));
            QPYX_obj_YXQP.frames = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index frames on a nil value"));
        }
    }
    static int QPYX_get_headData_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            byte[] QPYX_ret_YXQP = QPYX_obj_YXQP.headData;
            LuaDLL.tolua_pushlstring(L_YXQP, QPYX_ret_YXQP, QPYX_ret_YXQP.Length);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index headData on a nil value"));
        }
    }
    static int QPYX_get_rule_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            string QPYX_ret_YXQP = QPYX_obj_YXQP.rule;
            LuaDLL.lua_pushstring(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index rule on a nil value"));
        }
    }
    static int QPYX_get_frames_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            System.Collections.Generic.List <DNet.VideoFrameData> QPYX_ret_YXQP = QPYX_obj_YXQP.frames;
            ToLua.PushSealed(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index frames on a nil value"));
        }
    }
    static int QPYX_set_headData_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            byte[] QPYX_arg0_YXQP = ToLua.CheckByteBuffer(L_YXQP, 2);
            QPYX_obj_YXQP.headData = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index headData on a nil value"));
        }
    }
    static int QPYX_set_rule_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        DNet.VideoData QPYX_obj_YXQP = (DNet.VideoData)QPYX_o_YXQP;
            string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
            QPYX_obj_YXQP.rule = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index rule on a nil value"));
        }
    }
示例#15
0
        public VideoData GetPlayBackInfo(byte[] Buffer_)
        {
            videoData = new VideoData();
            int offSet = 0;

            //游戏版本号
            byte[] versionByte = new byte[4];
            versionByte[0] = Buffer_[offSet];
            versionByte[1] = Buffer_[offSet + 1];
            versionByte[2] = Buffer_[offSet + 2];
            versionByte[3] = Buffer_[offSet + 3];
            uint version = BitConverter.ToUInt32(versionByte, 0);

            byte[] gzLengthByte = new byte[2];
            uint   gzLength     = 0;

            if (version != 1)
            {
                gzLengthByte[0] = Buffer_[offSet];
                gzLengthByte[1] = Buffer_[offSet + 1];
                gzLength        = BitConverter.ToUInt16(gzLengthByte, 0);
                byte[] headData = new byte[gzLength];
                Array.Copy(Buffer_, offSet + 2, headData, 0, gzLength);
                videoData.headData = headData;
            }
            else
            {
                offSet         += 4;
                gzLengthByte[0] = Buffer_[offSet];
                gzLengthByte[1] = Buffer_[offSet + 1];
                gzLength        = BitConverter.ToUInt16(gzLengthByte, 0);
                //规则,如人数、等等
                byte[] gzStrByte = new byte[gzLength];
                Array.Copy(Buffer_, offSet + 2, gzStrByte, 0, gzLength);
                videoData.rule = System.Text.Encoding.UTF8.GetString(gzStrByte);
            }

            offSet += (int)gzLength + 2;
            CDecompress cd = new CDecompress();

            while (true)
            {
                byte[] HeadByte = new byte[2];
                HeadByte[0] = Buffer_[offSet];
                HeadByte[1] = Buffer_[offSet + 1];
                ushort length_  = BitConverter.ToUInt16(HeadByte, 0);
                byte[] BodyByte = new byte[length_];
                Array.Copy(Buffer_, offSet += 2, BodyByte, 0, length_);
                offSet += length_;
                uint length__ = 0;
                uint jbz      = 0;
                cd.PreDecompress(BodyByte, out length__, out jbz);
                byte[] GS = new byte[length__];
                cd.Decompress(BodyByte, ref GS);
                videoData.frames.Add(new VideoFrameData(GS));
                if (offSet == Buffer_.Length)
                {
                    break;
                }
                else if (offSet >= Buffer_.Length)
                {
                    Debug.Log("解析出问题了 offSet: " + offSet + " Buffer_.Length: " + Buffer_.Length);
                    break;
                }
            }
            return(videoData);
        }