static public int constructor(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); Groot.Network.MessageBase o; if (argc == 1) { o = new Groot.Network.MessageBase(); pushValue(l, true); pushValue(l, o); return(2); } else if (argc == 4) { Groot.Network.EMsgDirection a1; checkEnum(l, 2, out a1); Groot.Network.EMsgType a2; checkEnum(l, 3, out a2); System.UInt16 a3; checkType(l, 4, out a3); o = new Groot.Network.MessageBase(a1, a2, a3); pushValue(l, true); pushValue(l, o); return(2); } return(error(l, "New object failed.")); } catch (Exception e) { return(error(l, e)); } }
static public int get_MsgDirection(IntPtr l) { try { Groot.Network.MessageBase self = (Groot.Network.MessageBase)checkSelf(l); pushValue(l, true); pushValue(l, self.MsgDirection); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int set_MsgType(IntPtr l) { try { Groot.Network.MessageBase self = (Groot.Network.MessageBase)checkSelf(l); System.Byte v; checkType(l, 2, out v); self.MsgType = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public bool SendMsg(MessageBase _msg) { return(m_net_provider.SendMsg(_msg)); }
/// <summary> /// /// </summary> /// <param name="_msg"></param> /// <returns></returns> public bool SendMessage(MessageBase _msg) { //消息序列化 Byte[] msg_body = SerializerHelper.SerializeMessage(_msg); return(m_client.Send(msg_body, msg_body.Length)); }