public ChatServerMain(int portNumber) {
        isRunning = true;
        audioRooms = new TreeMap<String, AudioThread>();
        databaseSetup();

        /* Create the server socket */
        try {
            port = portNumber;
            serverSocket = new ServerSocket(portNumber);
            System.out.println(serverSocket); //debug
        } catch (IOException e) {
            System.out.println("IOException: " + e);
            System.exit(1);
        }
        /* In the main thread, continuously listen for new clients and spin off threads for them. */
        while (isRunning) {
            try {
                /* Get a new client */
                Socket clientSocket = serverSocket.accept();
                System.out.println("New connection from "+clientSocket.getInetAddress().toString());
                /* Create a thread for it and start, giving it the right id. */
                ChatServerThread clientThread = new ChatServerThread(clientSocket, null, mainRoom, this); //null user because the thread has to take the username/password
                clientThread.start();
                chatRooms.get("main").addThread(clientThread); //0 index is the main lobby
                //clientThread.start();
            } catch (IOException e) {
                System.out.println("Accept failed: " + e);
                System.out.println("Server has stopped running.");
                System.exit(1);
            }
        }
        System.out.println("Server has stopped running.");
    }