static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <System.Net.WebSockets.HttpListenerWebSocketContext>(L, 2) && translator.Assignable <DCET.Model.AService>(L, 3)) { System.Net.WebSockets.HttpListenerWebSocketContext _webSocketContext = (System.Net.WebSockets.HttpListenerWebSocketContext)translator.GetObject(L, 2, typeof(System.Net.WebSockets.HttpListenerWebSocketContext)); DCET.Model.AService _service = (DCET.Model.AService)translator.GetObject(L, 3, typeof(DCET.Model.AService)); DCET.Model.WChannel gen_ret = new DCET.Model.WChannel(_webSocketContext, _service); translator.Push(L, gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <System.Net.WebSockets.WebSocket>(L, 2) && translator.Assignable <DCET.Model.AService>(L, 3)) { System.Net.WebSockets.WebSocket _webSocket = (System.Net.WebSockets.WebSocket)translator.GetObject(L, 2, typeof(System.Net.WebSockets.WebSocket)); DCET.Model.AService _service = (DCET.Model.AService)translator.GetObject(L, 3, typeof(DCET.Model.AService)); DCET.Model.WChannel gen_ret = new DCET.Model.WChannel(_webSocket, _service); 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.WChannel constructor!")); }
static int _e_AcceptCallback(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); int gen_param_count = LuaAPI.lua_gettop(L); DCET.Model.AService gen_to_be_invoked = (DCET.Model.AService)translator.FastGetCSObj(L, 1); System.Action <DCET.Model.AChannel> gen_delegate = translator.GetDelegate <System.Action <DCET.Model.AChannel> >(L, 3); if (gen_delegate == null) { return(LuaAPI.luaL_error(L, "#3 need System.Action<DCET.Model.AChannel>!")); } if (gen_param_count == 3) { if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { gen_to_be_invoked.AcceptCallback += gen_delegate; return(0); } if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { gen_to_be_invoked.AcceptCallback -= 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.AService.AcceptCallback!"); return(0); }
static int _m_Update(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DCET.Model.AService gen_to_be_invoked = (DCET.Model.AService)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Update( ); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_ConnectChannel(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DCET.Model.AService gen_to_be_invoked = (DCET.Model.AService)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 _ipEndPoint = (System.Net.IPEndPoint)translator.GetObject(L, 2, typeof(System.Net.IPEndPoint)); DCET.Model.AChannel gen_ret = gen_to_be_invoked.ConnectChannel(_ipEndPoint); 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.AService.ConnectChannel!")); }
static int _m_Remove(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DCET.Model.AService gen_to_be_invoked = (DCET.Model.AService)translator.FastGetCSObj(L, 1); { long _channelId = LuaAPI.lua_toint64(L, 2); gen_to_be_invoked.Remove(_channelId); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_GetChannel(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); DCET.Model.AService gen_to_be_invoked = (DCET.Model.AService)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)); } }