Jump to content

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


MonkeyBusiness

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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