Example #1
0
        static int _m_OnRawMsg(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);



                {
                    byte[] _msg          = LuaAPI.lua_tobytes(L, 2);
                    int    _handle_count = LuaAPI.xlua_tointeger(L, 3);

                    var gen_ret = gen_to_be_invoked.OnRawMsg(_msg, _handle_count);
                    LuaAPI.lua_pushboolean(L, gen_ret);



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

                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.luaOnDisconnect = (XLua.LuaFunction)translator.GetObject(L, 2, typeof(XLua.LuaFunction));
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Example #3
0
        static int _g_get_luaOnDisconnect(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.luaOnDisconnect);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Example #4
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TTABLE))
                {
                    XLua.LuaTable _sp = (XLua.LuaTable)translator.GetObject(L, 2, typeof(XLua.LuaTable));

                    var gen_ret = new LuaWebSocket(_sp);
                    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 LuaWebSocket constructor!"));
        }
Example #5
0
        static int _m_OpenUrl(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);



                {
                    string _url = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.OpenUrl(_url);



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


                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);



                {
                    WebSocketSharp.ErrorEventArgs _e = (WebSocketSharp.ErrorEventArgs)translator.GetObject(L, 2, typeof(WebSocketSharp.ErrorEventArgs));

                    gen_to_be_invoked.OnErr(_e);



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


                LuaWebSocket gen_to_be_invoked = (LuaWebSocket)translator.FastGetCSObj(L, 1);



                {
                    int    _reason = LuaAPI.xlua_tointeger(L, 2);
                    string _str    = LuaAPI.lua_tostring(L, 3);

                    gen_to_be_invoked.OnDisconnect(_reason, _str);



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