using System; namespace Microsoft.Xna.Framework.Net { /// /// Message sent by the host to reject a join request. /// public class JoinRejectedMessage : INetworkMessage { public byte MessageType => 6; /// /// The reason for the rejection. /// public NetworkSessionJoinError ErrorCode { get; set; } /// /// Human-readable reason for rejection. /// public string Reason { get; set; } public void Serialize(PacketWriter writer) { writer.Write(MessageType); writer.Write((byte)ErrorCode); writer.Write(Reason ?? string.Empty); } public void Deserialize(PacketReader reader) { // Reader is positioned after the type byte ErrorCode = (NetworkSessionJoinError)reader.ReadByte(); Reason = reader.ReadString(); } } }