Moved randoms from provider to client

This commit is contained in:
JKetelaar
2015-02-03 14:05:06 +01:00
parent 27a92b57d5
commit 87a5aa0791
3 changed files with 24 additions and 0 deletions
@@ -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&section=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();
}