mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Moved randoms from provider to client
This commit is contained in:
@@ -15,6 +15,7 @@ public class Configuration {
|
||||
public static final String GET_BOT_VERSION = "http://bot.parabot.org/version.txt";
|
||||
public static final String REGISTRATION_PAGE = "https://www.parabot.org/community/index.php?app=core&module=global§ion=register";
|
||||
public static final String GET_PASSWORD = "http://bdn.parabot.org/api/get.php?action=password";
|
||||
public static final String GET_RANDOMS = "http://bdn.parabot.org/api/get.php?action=randoms";
|
||||
|
||||
public static final double BOT_VERSION = 2.1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.parabot.core.parsers.randoms;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author JKetelaar
|
||||
*/
|
||||
public abstract class RandomParser {
|
||||
|
||||
private static final ArrayList<RandomParser> parsers = new ArrayList<>();
|
||||
|
||||
public static void enable() {
|
||||
parsers.add(new PublicRandoms());
|
||||
|
||||
for (RandomParser randomParser : parsers) {
|
||||
randomParser.parse();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void parse();
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.parabot.environment.servers.executers;
|
||||
|
||||
import org.parabot.core.Context;
|
||||
import org.parabot.core.parsers.randoms.RandomParser;
|
||||
import org.parabot.core.ui.components.PaintComponent;
|
||||
import org.parabot.environment.servers.ServerProvider;
|
||||
|
||||
@@ -23,6 +24,7 @@ public abstract class ServerExecuter {
|
||||
Context context = Context.getInstance(provider);
|
||||
context.load();
|
||||
PaintComponent.getInstance().startPainting(context);
|
||||
RandomParser.enable();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user