mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 00:38:16 +00:00
Whole new revision for BDN support
This commit is contained in:
@@ -134,7 +134,7 @@ public class WebUtil {
|
||||
|
||||
/**
|
||||
* Opens a connection
|
||||
*
|
||||
*
|
||||
* @param url
|
||||
* @return URLConnection to URL
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ public class WebUtil {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static BufferedReader getReader(final URL url, String username, String password) {
|
||||
try {
|
||||
String data = URLEncoder.encode("username", "UTF-8") + "=" + username;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package org.parabot.environment.input;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
|
||||
import org.parabot.core.Context;
|
||||
import org.parabot.environment.api.utils.Time;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
|
||||
/**
|
||||
*
|
||||
* A virtual mouse, dispatches mouse events to a component
|
||||
@@ -138,7 +137,7 @@ public class Mouse implements MouseListener, MouseMotionListener {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,9 @@ public class SDNScriptExecuter extends ScriptExecuter {
|
||||
@Override
|
||||
public void run(ThreadGroup tg) {
|
||||
try {
|
||||
final URLConnection urlConnection = WebUtil.getConnection(new URL(String.format(Configuration.GET_SDN_SCRIPT, manager.getAccount().getURLUsername(), manager.getAccount().getURLPassword(), this.id)));
|
||||
final URLConnection urlConnection = WebUtil.getConnection(new URL(
|
||||
Configuration.GET_SCRIPT + this.id), manager.getAccount().getURLUsername(), manager.getAccount().getURLPassword());
|
||||
|
||||
final String contentType = urlConnection.getHeaderField("Content-type");
|
||||
if(contentType.equals("text/html")) {
|
||||
// failed to fetch script
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.net.URL;
|
||||
*/
|
||||
public class PublicServerExecuter extends ServerExecuter {
|
||||
private String serverName;
|
||||
private int serverID;
|
||||
|
||||
private static AccountManager manager;
|
||||
|
||||
@@ -43,21 +42,20 @@ public class PublicServerExecuter extends ServerExecuter {
|
||||
|
||||
};
|
||||
|
||||
public PublicServerExecuter(final String serverName, final int serverID) {
|
||||
public PublicServerExecuter(final String serverName) {
|
||||
this.serverName = serverName;
|
||||
this.serverID = serverID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ServerProviderInfo serverProviderInfo = new ServerProviderInfo(new URL(Configuration.GET_SERVER_PROVIDER_INFO
|
||||
+ this.serverID), manager.getAccount().getURLUsername(), manager.getAccount().getURLPassword());
|
||||
+ this.serverName), manager.getAccount().getURLUsername(), manager.getAccount().getURLPassword());
|
||||
|
||||
final File destination = new File(Directories.getCachePath(),
|
||||
serverProviderInfo.getCRC32() + ".jar");
|
||||
final String jarUrl = Configuration.GET_SERVER_PROVIDER
|
||||
+ this.serverID;
|
||||
+ this.serverName;
|
||||
|
||||
Core.verbose("Downloading: " + jarUrl + " ...");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user