Players Online On Website, Changed packaging a little & added SettingsLoader (#44)

This commit is contained in:
Daniel Ginovker
2019-10-09 17:30:43 -04:00
committed by GitHub
parent 1f49bff69d
commit b97a843428
12 changed files with 96 additions and 41 deletions
@@ -0,0 +1,37 @@
package redone.integrations;
import redone.game.players.PlayerHandler;
import java.io.IOException;
import java.net.URL;
public class PlayersOnlineWebsite {
static String password;
private static void setWebsitePlayersOnline(int amount) throws IOException {
URL url;
url = new URL("https://2006rebotted.tk/playersonline.php?pass=" + password + "&amount=" + amount);
url.openStream().close();
System.out.println("Test!");
}
private static int count = 50;
public static void addUpdatePlayersOnlineTask() {
if (!password.equals("")) {
if (count == 0) {
try {
setWebsitePlayersOnline(PlayerHandler.getPlayerCount());
count = 50;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
count--;
}
} else {
System.out.println("No Players Online On Website Password Set So Task Stopped");
}
}
}