Example #1
0
        /// <summary>
        /// Writes the properties to be sync on an outgoing message.
        /// </summary>
        /// <param name="message">The outgoing message</param>
        /// <param name="includedFields">Indicates the fields that must synchronized</param>
        protected void WriteSyncMessage(OutgoingMessage message, RoomInfoFieldsFlags includedFields)
        {
            message.Write((byte)includedFields);

            if (includedFields.HasFlag(RoomInfoFieldsFlags.Name))
            {
                message.Write(this.Name);
            }

            if (includedFields.HasFlag(RoomInfoFieldsFlags.PlayerCount))
            {
                message.Write(this.playerCount);
            }

            if (includedFields.HasFlag(RoomInfoFieldsFlags.MaxPlayers))
            {
                message.Write(this.maxPlayers);
            }

            if (includedFields.HasFlag(RoomInfoFieldsFlags.PropertiesListedInLobby))
            {
                message.Write(this.propertiesListedInLobby);
            }
        }
Example #2
0
 /// <summary>
 /// Writes the properties to be sync on an outgoing message.
 /// </summary>
 /// <param name="message">The outgoing message</param>
 internal void WriteSyncMessage(OutgoingMessage message)
 {
     this.WriteSyncMessage(message, this.pendingSyncFields);
     this.pendingSyncFields = RoomInfoFieldsFlags.None;
 }