Esempio n. 1
0
        static int _e_ReadCallback(RealStatePtr L)
        {
            try {
                ObjectTranslator translator           = ObjectTranslatorPool.Instance.Find(L);
                int gen_param_count                   = LuaAPI.lua_gettop(L);
                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);
                System.Action <System.IO.MemoryStream> gen_delegate = translator.GetDelegate <System.Action <System.IO.MemoryStream> >(L, 3);
                if (gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#3 need System.Action<System.IO.MemoryStream>!"));
                }

                if (gen_param_count == 3)
                {
                    if (LuaAPI.xlua_is_eq_str(L, 2, "+"))
                    {
                        gen_to_be_invoked.ReadCallback += gen_delegate;
                        return(0);
                    }


                    if (LuaAPI.xlua_is_eq_str(L, 2, "-"))
                    {
                        gen_to_be_invoked.ReadCallback -= gen_delegate;
                        return(0);
                    }
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            LuaAPI.luaL_error(L, "invalid arguments to DCET.Model.AChannel.ReadCallback!");
            return(0);
        }
Esempio n. 2
0
        static int _s_set_Error(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.Error = LuaAPI.xlua_tointeger(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Esempio n. 3
0
        static int _g_get_RemoteAddress(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.RemoteAddress);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Esempio n. 4
0
        static int _g_get_Service(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.Service);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Esempio n. 5
0
        static int _m_Start(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Start(  );



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


                DCET.Model.KService gen_to_be_invoked = (DCET.Model.KService)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <System.Net.IPEndPoint>(L, 2))
                {
                    System.Net.IPEndPoint _remoteEndPoint = (System.Net.IPEndPoint)translator.GetObject(L, 2, typeof(System.Net.IPEndPoint));

                    DCET.Model.AChannel gen_ret = gen_to_be_invoked.ConnectChannel(_remoteEndPoint);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _address = LuaAPI.lua_tostring(L, 2);

                    DCET.Model.AChannel gen_ret = gen_to_be_invoked.ConnectChannel(_address);
                    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 DCET.Model.KService.ConnectChannel!"));
        }
Esempio n. 7
0
        static int _m_Send(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DCET.Model.AChannel gen_to_be_invoked = (DCET.Model.AChannel)translator.FastGetCSObj(L, 1);



                {
                    System.IO.MemoryStream _stream = (System.IO.MemoryStream)translator.GetObject(L, 2, typeof(System.IO.MemoryStream));

                    gen_to_be_invoked.Send(_stream);



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


                DCET.Model.Session gen_to_be_invoked = (DCET.Model.Session)translator.FastGetCSObj(L, 1);



                {
                    DCET.Model.AChannel _aChannel = (DCET.Model.AChannel)translator.GetObject(L, 2, typeof(DCET.Model.AChannel));

                    gen_to_be_invoked.Awake(_aChannel);



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


                DCET.Model.KService gen_to_be_invoked = (DCET.Model.KService)translator.FastGetCSObj(L, 1);



                {
                    long _id = LuaAPI.lua_toint64(L, 2);

                    DCET.Model.AChannel gen_ret = gen_to_be_invoked.GetChannel(_id);
                    translator.Push(L, gen_ret);



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


                DCET.Model.NetworkComponent gen_to_be_invoked = (DCET.Model.NetworkComponent)translator.FastGetCSObj(L, 1);



                {
                    DCET.Model.AChannel _channel = (DCET.Model.AChannel)translator.GetObject(L, 2, typeof(DCET.Model.AChannel));

                    DCET.Model.Session gen_ret = gen_to_be_invoked.OnAccept(_channel);
                    translator.Push(L, gen_ret);



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