mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
a9d45373e0
Added proper object size calculations. Removed old objectDistance code. Added current task support, allows easy creation of player tasks that cannot duplicate.
39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package redone.integrations;
|
|
|
|
import redone.game.players.PlayerHandler;
|
|
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
|
|
public class PlayersOnlineWebsite {
|
|
|
|
static String password;
|
|
private static boolean hasntwared = true;
|
|
|
|
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();
|
|
}
|
|
|
|
private static int count = 50;
|
|
public static void addUpdatePlayersOnlineTask() {
|
|
if (password != null && !password.equals("")) {
|
|
if (count == 0) {
|
|
try {
|
|
setWebsitePlayersOnline(PlayerHandler.getPlayerCount());
|
|
count = 50;
|
|
} catch (IOException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
} else {
|
|
count--;
|
|
}
|
|
} else if (hasntwared) {
|
|
hasntwared = false;
|
|
System.out.println("No Website Password Set So Website Integration Tasks Stopped");
|
|
}
|
|
}
|
|
}
|