Example #1
0
        private static int MyCallback(LuaState state)
        {
            LuaStackObject strObj = state.Stack(1);

            Console.WriteLine(strObj.GetString());
            return(0);
        }
Example #2
0
        static bool GuardDoString(LuaState state, String text)
        {
            int ret = state.LoadString(text);
            if (ret != 0)
            {
                LuaStackObject errObj = new LuaStackObject(state, -1);
                state.Pop();
                return false;
            }

            ret = state.PCall(0, -1, 0);
            if (ret != 0)
            {
                LuaStackObject errObj = new LuaStackObject(state, -1);
                state.Pop();
            }

            return true;
        }
Example #3
0
        static bool GuardDoString(LuaState state, String text)
        {
            int ret = state.LoadString(text);

            if (ret != 0)
            {
                LuaStackObject errObj = new LuaStackObject(state, -1);
                state.Pop();
                return(false);
            }

            ret = state.PCall(0, -1, 0);
            if (ret != 0)
            {
                LuaStackObject errObj = new LuaStackObject(state, -1);
                state.Pop();
            }

            return(true);
        }