Jump to content

The hopToF2PWorld() method attempts to connect to a P2P world


Recommended Posts

Posted
59 minutes ago, FuryShark said:

You can do getWorlds().hopToF2PWorld();
What world is it trying to hop to ?

Isn't that a different way to access the same method?

I will need to monitor the members world(s) it is trying to hop to as it only happens occasionally. I was just wondering if I was doing something wrong before investigating.

Posted (edited)

You could make a list of worlds yourself.

 

Here is a snippet of what you could do (Nothing in here has to be static).

public static ArrayList<Integer> worlds = new ArrayList<Integer>();
public static ArrayList<Integer> blockedWorlds = new ArrayList<Integer>();
  
@Override
	public void onStart() throws InterruptedException {
  
  		blockWorlds();
  
		getWorlds().getAvailableWorlds(false).forEach(w -> {
			if (!w.isMembers() && !w.isPvpWorld() && !blockedWorlds.contains(w.getId()) && getWorlds().isWorldAllowedForHop(w)) {
				worlds.add(w.getId());
			}
		});
		log(worlds.size() + " worlds added to hop list.");
	}
  
  //To block worlds you just add to the array of integers called b
  static int[] b = {318, 400, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 443, 462, 463, 512, 535, 536};
	public static void blockWorlds() {
		for (int i : b) {
			blockedWorlds.add(i);
		}
	}

Then you could make a custom method to get a random world etc.

Not quite sure which worlds are blocked here, but it blocks league worlds (So they won't be added to worlds arraylist)

Edited by Medusa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...