public void run() {
		try {
			InetAddress ipAddress = clientSocket.getInetAddress();
			String remoteIP = ipAddress.getHostAddress();
			player.setIPAddress(remoteIP);
			
			if (!(player.getIPAddress().equals(null))) {
				System.out.println("Player IP is: " + player.getIPAddress());
			}
			
			OutputStream registerStartOutput = clientSocket.getOutputStream();
			
			new PrintWriter(registerStartOutput).println(ProtocolConstants.REGISTER_START);
			BufferedReader registrationStringReader = new BufferedReader(new InputStreamReader(
					clientSocket.getInputStream()));
			System.out.println(registrationStringReader.readLine());
			String input = registrationStringReader.readLine();
			
			while (input == null) {
				input = registrationStringReader.readLine();
			}
			
			InputStream stream = new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8));
			player.setTeamName(receiveTeamInfo(stream).getTeamName().toString());
			player.setTeamColor(receiveTeamInfo(stream).getColorHex().toString());
			
			if (!(player.getTeamName().equals("") && player.getTeamColor().equals(""))) {
				System.out.print("Player team name is: " + player.getTeamName());
				System.out.print("Player color is: " + player.getTeamColor());
			}
			
			// registrationStringReader.close();
			// stream.close();

			OutputStream registerEndOutput = clientSocket.getOutputStream();
			new PrintWriter(registerEndOutput).println(ProtocolConstants.REGISTER_END);
			registerEndOutput.close();

			System.out.println("Ended Registration. Closing Socket.");
			clientSocket.close();
			
			if (clientSocket.isClosed()) {
				System.out.println("Socket closed");
			}

		} catch (IOException e) {
			// report exception somewhere.
			e.printStackTrace();
		}
	}