@Override
    public void start() {

        while (ProjectInfernoServer.isRunning()) {
            try {

                // Create a new socket for connecting player.
                Socket socket = ProjectInfernoServer.server.accept();

                // Recieve the clients Username.
                ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                String username = (String) ois.readObject();

                // Check to see if the clients username is valid.
                if (ProjectInfernoServer.getClient(username) != null) {
                    // Send error to client that username is already in use.
                    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                    oos.writeObject("2:Connection Failed;Sorry, Username already in use!");
                    System.out.println("A new player has failed to joined with the username '" + username + "'.");
                } else if (username == null || username.equalsIgnoreCase("") || username.isEmpty()) {
                    // Send error to client that no username was specified.
                    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                    oos.writeObject("2:Connection Failed;You require a username to join!");
                    System.out.println("A new player has failed to joined with the username '" + username + "'.");
                } else {
                    // Send completion & welcome message to client.
                    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                    oos.writeObject("1:Welcome to Project Inferno!");
                    
                    // Start handling the client.
                    ProjectInfernoServer.addConnection(username, socket);
                    System.out.println("A new player has successfully joined with the username '" + username + "'.");
                }
            } catch (Exception ex) {
            }
        }

    }