Esempio n. 1
0
        public bool __Gen_Delegate_Imp24(object p0, ref XLuaFramework.ByteBuffer p1, object p2)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.Push(L, p1);
            translator.PushAny(L, p2);

            PCall(L, 3, 2, errFunc);

            p1 = (XLuaFramework.ByteBuffer)translator.GetObject(L, errFunc + 2, typeof(XLuaFramework.ByteBuffer));

            bool __gen_ret = LuaAPI.lua_toboolean(L, errFunc + 1);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    XLuaFramework.ByteBuffer gen_ret = new XLuaFramework.ByteBuffer();
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    byte[] _data = LuaAPI.lua_tobytes(L, 2);

                    XLuaFramework.ByteBuffer gen_ret = new XLuaFramework.ByteBuffer(_data);
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to XLuaFramework.ByteBuffer constructor!"));
        }
        static int _m_Close(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLuaFramework.ByteBuffer gen_to_be_invoked = (XLuaFramework.ByteBuffer)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Close(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_ToBytes(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLuaFramework.ByteBuffer gen_to_be_invoked = (XLuaFramework.ByteBuffer)translator.FastGetCSObj(L, 1);



                {
                    byte[] gen_ret = gen_to_be_invoked.ToBytes(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_WriteFloat(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLuaFramework.ByteBuffer gen_to_be_invoked = (XLuaFramework.ByteBuffer)translator.FastGetCSObj(L, 1);



                {
                    float _v = (float)LuaAPI.lua_tonumber(L, 2);

                    gen_to_be_invoked.WriteFloat(_v);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }