<commit_before>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable enable

using System;
using System.Collections.Generic;

namespace osu.Game.Online.RealtimeMultiplayer
{
    /// <summary>
    /// A multiplayer room.
    /// </summary>
    [Serializable]
    public class MultiplayerRoom
    {
        /// <summary>
        /// The ID of the room, used for database persistence.
        /// </summary>
        public readonly long RoomID;

        /// <summary>
        /// The current state of the room (ie. whether it is in progress or otherwise).
        /// </summary>
        public MultiplayerRoomState State { get; set; }

        /// <summary>
        /// All currently enforced game settings for this room.
        /// </summary>
        public MultiplayerRoomSettings Settings { get; set; } = new MultiplayerRoomSettings();

        /// <summary>
        /// All users currently in this room.
        /// </summary>
        public List<MultiplayerRoomUser> Users { get; set; } = new List<MultiplayerRoomUser>();

        /// <summary>
        /// The host of this room, in control of changing room settings.
        /// </summary>
        public MultiplayerRoomUser? Host { get; set; }

        private object writeLock = new object();

        public MultiplayerRoom(in long roomId)
        {
            RoomID = roomId;
        }

        /// <summary>
        /// Request a lock on this room to perform a thread-safe update.
        /// </summary>
        public LockUntilDisposal LockForUpdate() => new LockUntilDisposal(writeLock);
    }
}<commit_msg>Add ToString implementation to MultiplayerRoom for easier debug<commit_after>// Copyright (c) p<NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable enable

using System;
using System.Collections.Generic;

namespace osu.Game.Online.RealtimeMultiplayer
{
    /// <summary>
    /// A multiplayer room.
    /// </summary>
    [Serializable]
    public class MultiplayerRoom
    {
        /// <summary>
        /// The ID of the room, used for database persistence.
        /// </summary>
        public readonly long RoomID;

        /// <summary>
        /// The current state of the room (ie. whether it is in progress or otherwise).
        /// </summary>
        public MultiplayerRoomState State { get; set; }

        /// <summary>
        /// All currently enforced game settings for this room.
        /// </summary>
        public MultiplayerRoomSettings Settings { get; set; } = new MultiplayerRoomSettings();

        /// <summary>
        /// All users currently in this room.
        /// </summary>
        public List<MultiplayerRoomUser> Users { get; set; } = new List<MultiplayerRoomUser>();

        /// <summary>
        /// The host of this room, in control of changing room settings.
        /// </summary>
        public MultiplayerRoomUser? Host { get; set; }

        private object writeLock = new object();

        public MultiplayerRoom(in long roomId)
        {
            RoomID = roomId;
        }

        /// <summary>
        /// Request a lock on this room to perform a thread-safe update.
        /// </summary>
        public LockUntilDisposal LockForUpdate() => new LockUntilDisposal(writeLock);

        public override string ToString() => $"RoomID:{RoomID} Host:{Host?.UserID} Users:{Users.Count} State:{State} Settings: [{Settings}]";
    }
}
{'fraction_non_alphanumeric': 0.11511199319535016, 'fraction_numerical': 0.0, 'mean_word_length': 2.0678260869565217, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7655879', 'n_tokens_mistral': 921, 'n_tokens_neox': 896, 'n_words': 327}