Ejemplo n.º 1
0
        public async Task SendResetBoard(string roomID)
        {
            BingoRoom room = _roomManager.GetRoom(roomID);

            room.ResetBoard();
            foreach (KeyValuePair <string, BingoUser> entry in room.Users)
            {
                await Clients.Client(entry.Key).SendAsync("ReceiveResetBoard", room.BoardToJSON());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a user to the room with the given ID and returns their assigned colour.
        /// </summary>
        /// <param name="roomID"></param>
        /// <param name="connectionID"></param>
        /// <param name="username"></param>
        /// <returns>The user's assigned colour.</returns>
        public string AddUserToRoom(string roomID, string connectionID, string username)
        {
            BingoRoom room = GetRoom(roomID);

            if (room != null)
            {
                return(room.AddUser(connectionID, username));
            }
            else
            {
                return(null);
            }
        }