public void Send(object msg) { FieldInfo fieldInfo = msg.GetType().GetField("PACKET_ID"); uint packetId = (uint)fieldInfo.GetValue(msg); Gamnet.Packet packet = new Gamnet.Packet(); packet.Id = packetId; packet.Serialize(msg); base.Send(packet); }
private void SendReliableAckNtf() { SystemPacket.Msg_ReliableAck_Ntf ntf = new SystemPacket.Msg_ReliableAck_Ntf(); ntf.recv_seq = recv_seq; Packet packet = new Packet(); packet.Id = SystemPacket.Msg_ReliableAck_Ntf.MSG_ID; packet.Serialize(ntf); Send(packet); }