public AuthStatus init(APIKey key, Player player, LoggerHook loggerHook) {
		instance = this;
		
		this.key = key;
		this.player = player;
		this.loggerHook = loggerHook;
		
		try {
			URL url = new URL(SERVER_LOCATION + "/api/" + VERSION + "/auth/login.php?key=" + key.getKey() + "&username=" + player.getName()
					+ "&password=" + player.getPassword().getPassword());
			
			URLConnection connection = url.openConnection();
		    connection.addRequestProperty("Protocol", "Http/1.1");
		    connection.addRequestProperty("Connection", "keep-alive");
		    connection.addRequestProperty("Keep-Alive", "1000");
		    connection.addRequestProperty("User-Agent", "Web-Agent");

			BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));

			String result = in.readLine();
			
			if (result.contains("true")) {
				session = new Session(in.readLine());
				status = AuthStatus.GOOD;
				loggerHook.printInfo("Logged in successfully");
				player.loadData();
			} else if (result.contains("false")) {
				if(result.contains("Invalid API key")) {
					status = AuthStatus.INVALID_API_KEY;
					loggerHook.printError("Invalid API key");
				} else if (result.contains("Invalid user")) {
					status = AuthStatus.BAD;
					loggerHook.printError("Invalid user");
				} else if(result.contains("offine")) {
					status = AuthStatus.OFFLINE;
					loggerHook.printError("Server is offline");
				}
			} else {
				status = AuthStatus.UNKNOWN;
				loggerHook.printError("Unknown AuthStatus");
			}

			in.close();
		} catch (Exception e) { }
		
		return status;
	}