I noticed the unsigned URL has a reference to the server number as well. I went ahead and changed that, too. Here's the updated parameters code:
Code:
if (world.contains("1")
{
parameters.put("unsignedurl","http://www.runescape.com/classicapplet/classicgame.ws?f=1&j=1&a=1");
parameters.put("nodeid", "5001");
parameters.put("servertype", "1");
}
else if (world.contains("3")
{
parameters.put("unsignedurl","http://www.runescape.com/classicapplet/classicgame.ws?f=3&j=1&a=1");
parameters.put("nodeid", "5003");
parameters.put("servertype", "3");
}
else
{
parameters.put("unsignedurl","http://www.runescape.com/classicapplet/classicgame.ws?f=2&j=1&a=1");
parameters.put("nodeid", "5002");
parameters.put("servertype", "2");
}
I suppose I could create a method to do this based off a given world, just to cut down on repeat code. I'll work on that now.
edit:
Also, I was getting a NullPointerException, I guess because I didn't have "world" initialized until the main() method. If I set the world to 2 in the field declarations, will the parameters still set correctly when I switch worlds?
edit2:
Method for setting correct world parameters:
Code:
public static void setWorldParameters(String w)
{
parameters.put("unsignedurl","http://www.runescape.com/classicapplet/classicgame.ws?f=" + w + "&j=1&a=1");
parameters.put("nodeid", "500" + w);
parameters.put("servertype", w);
}
Then the updated static block:
Code:
static
{
parameters = new HashMap<String, String>();
setWorldParameters(world);
parameters.put("crashurl", "error_loader_crash.ws?a=0&j=1");
parameters.put("cabbase", "loader.cab");
parameters.put("java_arguments", "-Xmx96m -Dsun.java2d.noddraw=true");
parameters.put("country", "0");
parameters.put("haveie6", "0");
parameters.put("affid", "0");
parameters.put("js", "1");
parameters.put("objecttag", "0");
parameters.put("advertsuppressed", "1");
parameters.put("modewhat", "0");
parameters.put("modewhere", "0");
parameters.put("settings", "wwGlrZHF5gKN6D3mDdihco3oPeYN2KFybL9hUUFqOvk");
}
My question about initializing the world and setting it to 2 in the field declarations still remains though