public void beginServer() throws IOException, ClassNotFoundException {
		JOptionPane.showMessageDialog(null, "Hosting server on port: " + myPort);
		
		// Start the socketserver
		myServerSocket = new ServerSocket(myPort);
		
		JOptionPane.showMessageDialog(null, "Successfully started server. Waiting for connection");
		
		// Accept the first connection request (cannot accept and more)
		mySocket = myServerSocket.accept();
		
		System.out.println("Accepted connection from: " + mySocket.getInetAddress());
		
		// Create the input and output streams to communicate with the client
		myOut = new ObjectOutputStream(mySocket.getOutputStream());
		myIn = new ObjectInputStream(mySocket.getInputStream());
		
		// Start a game (all the client-server communications are handled in the Game class
		GameBattle game = new GameBattle(true, myIn, myOut, 0);
		//Thread t = new Thread(game);
		//t.start();
		game.loop();
		
	}