mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
total players registerd
This commit is contained in:
@@ -9,6 +9,7 @@ import org.apache.mina.transport.socket.nio.SocketAcceptor;
|
|||||||
import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
|
import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
|
||||||
|
|
||||||
import redone.integrations.PlayersOnlineWebsite;
|
import redone.integrations.PlayersOnlineWebsite;
|
||||||
|
import redone.integrations.RegisteredAccsWebsite;
|
||||||
import redone.integrations.SettingsLoader;
|
import redone.integrations.SettingsLoader;
|
||||||
import redone.integrations.discord.JavaCord;
|
import redone.integrations.discord.JavaCord;
|
||||||
import redone.event.CycleEventHandler;
|
import redone.event.CycleEventHandler;
|
||||||
@@ -171,6 +172,7 @@ public class Server {
|
|||||||
pestControl.process();
|
pestControl.process();
|
||||||
CycleEventHandler.getSingleton().process();
|
CycleEventHandler.getSingleton().process();
|
||||||
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
|
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
|
||||||
|
RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
|
||||||
if (System.currentTimeMillis() - lastMassSave > 300000) {
|
if (System.currentTimeMillis() - lastMassSave > 300000) {
|
||||||
for (Player p : PlayerHandler.players) {
|
for (Player p : PlayerHandler.players) {
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import java.net.URL;
|
|||||||
public class PlayersOnlineWebsite {
|
public class PlayersOnlineWebsite {
|
||||||
|
|
||||||
static String password;
|
static String password;
|
||||||
|
private static boolean hasntwared = true;
|
||||||
|
|
||||||
private static void setWebsitePlayersOnline(int amount) throws IOException {
|
private static void setWebsitePlayersOnline(int amount) throws IOException {
|
||||||
URL url;
|
URL url;
|
||||||
@@ -30,7 +31,8 @@ public class PlayersOnlineWebsite {
|
|||||||
} else {
|
} else {
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (hasntwared) {
|
||||||
|
hasntwared = false;
|
||||||
System.out.println("No Players Online On Website Password Set So Task Stopped");
|
System.out.println("No Players Online On Website Password Set So Task Stopped");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package redone.integrations;
|
||||||
|
|
||||||
|
import redone.game.players.PlayerHandler;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
public class RegisteredAccsWebsite {
|
||||||
|
static String password;
|
||||||
|
private static boolean hasntwarned = true;
|
||||||
|
|
||||||
|
private static void setAccountsRegistered(int amount) throws IOException {
|
||||||
|
URL url;
|
||||||
|
url = new URL("https://2006rebotted.tk/accountsregistered.php?pass=" + password + "&amount=" + amount);
|
||||||
|
url.openStream().close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int count = 50;
|
||||||
|
public static void addUpdateRegisteredUsersTask() {
|
||||||
|
if (password != null && !password.equals("")) {
|
||||||
|
if (count == 0) {
|
||||||
|
try {
|
||||||
|
setAccountsRegistered(new File("data/characters/").list().length);
|
||||||
|
count = 50;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
} else if (hasntwarned) {
|
||||||
|
hasntwarned = false;
|
||||||
|
System.out.println("You need to provide the powpass secret to use this!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user