summaryrefslogtreecommitdiff
path: root/NET/worlds/console/WebControlImp.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/WebControlImp.java')
-rw-r--r--NET/worlds/console/WebControlImp.java152
1 files changed, 152 insertions, 0 deletions
diff --git a/NET/worlds/console/WebControlImp.java b/NET/worlds/console/WebControlImp.java
new file mode 100644
index 0000000..45a1e48
--- /dev/null
+++ b/NET/worlds/console/WebControlImp.java
@@ -0,0 +1,152 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.core.Std;
+/* */ import NET.worlds.network.Galaxy;
+/* */ import NET.worlds.network.NetUpdate;
+/* */ import NET.worlds.network.WorldServer;
+/* */ import NET.worlds.scape.Pilot;
+/* */ import NET.worlds.scape.Room;
+/* */ import java.util.Enumeration;
+/* */ import java.util.Vector;
+/* */
+/* */ public abstract class WebControlImp implements NET.worlds.scape.TextureSurfaceRenderer
+/* */ {
+/* */ public static final int downloadBegin = 0;
+/* */ public static final int downloadEnd = 1;
+/* */ public static final int titleChanged = 2;
+/* */ public static final int propertyChanged = 3;
+/* */ public static final int statusChanged = 4;
+/* */ public static final int commandStateChanged = 5;
+/* */ Vector<WebControlListener> listeners;
+/* */
+/* */ WebControlImp(int hwnd)
+/* */ {
+/* 24 */ this.listeners = new Vector();
+/* */ }
+/* */
+/* */
+/* */
+/* */ public static String processURL(String pURL)
+/* */ {
+/* 31 */ if ((pURL.indexOf("$USERNAME") == -1) &&
+/* 32 */ (pURL.indexOf("$UPGRADESERVER") == -1) &&
+/* 33 */ (pURL.indexOf("$SCRIPTSERVER") == -1) &&
+/* 34 */ (pURL.indexOf("$SERIALNUM") == -1) &&
+/* 35 */ (pURL.indexOf("$WORLD") == -1) &&
+/* 36 */ (pURL.indexOf("$ROOM") == -1)) {
+/* 37 */ return pURL;
+/* */ }
+/* */
+/* 40 */ pURL = Std.replaceStr(pURL, "$UPGRADESERVER",
+/* 41 */ NetUpdate.getUpgradeServerURL());
+/* */
+/* 43 */ if (Console.getActive() != null) {
+/* 44 */ pURL = Std.replaceStr(pURL, "$SCRIPTSERVER", Console.getActive()
+/* 45 */ .getScriptServer());
+/* */ }
+/* 47 */ else if (pURL.indexOf("$SCRIPTSERVER") != -1) {
+/* 48 */ return null;
+/* */ }
+/* */
+/* */
+/* 52 */ if (Pilot.getActive() != null) {
+/* 53 */ Pilot p = Pilot.getActive();
+/* 54 */ if ((p != null) && (p.getWorld() != null)) {
+/* 55 */ pURL = Std.replaceStr(pURL, "$WORLD", p.getWorld().toString());
+/* */ }
+/* */
+/* 58 */ Room r = Pilot.getActiveRoom();
+/* 59 */ if (r != null) {
+/* 60 */ pURL = Std.replaceStr(pURL, "$ROOM", Pilot.getActiveRoom()
+/* 61 */ .toString());
+/* */ }
+/* */
+/* 64 */ WorldServer w = Pilot.getActive().getServer();
+/* 65 */ if ((w != null) && (w.getGalaxy() != null)) {
+/* 66 */ String name = w.getGalaxy().getChatname();
+/* 67 */ if (pURL.indexOf("$USERNAME") != -1) {
+/* 68 */ if ((name == null) || (name.equals(""))) {
+/* 69 */ return null;
+/* */ }
+/* 71 */ pURL = Std.replaceStr(pURL, "$USERNAME", name);
+/* */ }
+/* */
+/* 74 */ String serial = w.getGalaxy().getSerialNum();
+/* 75 */ if (pURL.indexOf("$SERIALNUM") != -1) {
+/* 76 */ if ((serial == null) || (serial.equals("")))
+/* 77 */ return null;
+/* 78 */ pURL = Std.replaceStr(pURL, "$SERIALNUM", serial);
+/* */ }
+/* */ }
+/* 81 */ else if ((pURL.indexOf("$SERIALNUM") != -1) ||
+/* 82 */ (pURL.indexOf("$USERNAME") != -1)) {
+/* 83 */ return null;
+/* */ }
+/* */ }
+/* 86 */ if ((pURL.indexOf("$SERIALNUM") != -1) || (pURL.indexOf("$USERNAME") != -1))
+/* 87 */ return null;
+/* 88 */ return pURL;
+/* */ }
+/* */
+/* */
+/* */
+/* */ public abstract boolean setURL(String paramString);
+/* */
+/* */
+/* */
+/* */ public abstract boolean setURL(String paramString1, String paramString2);
+/* */
+/* */
+/* */ public abstract void goBack();
+/* */
+/* */
+/* */ public abstract void goForward();
+/* */
+/* */
+/* */ public abstract void stop();
+/* */
+/* */
+/* */ public abstract void refresh();
+/* */
+/* */
+/* */ public abstract void home();
+/* */
+/* */
+/* */ public abstract void resize(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
+/* */
+/* */
+/* */ public abstract int getHWND();
+/* */
+/* */
+/* */ public abstract void renderTo(int paramInt);
+/* */
+/* */
+/* */ public void addListener(WebControlListener l)
+/* */ {
+/* 126 */ this.listeners.addElement(l);
+/* */ }
+/* */
+/* */ public void removeListener(WebControlListener l) {
+/* 130 */ this.listeners.removeElement(l);
+/* */ }
+/* */
+/* */ void receiveEvent(int eventID)
+/* */ {
+/* 135 */ Enumeration<WebControlListener> e = this.listeners.elements();
+/* 136 */ while (e.hasMoreElements()) {
+/* 137 */ WebControlListener l = (WebControlListener)e.nextElement();
+/* 138 */ if (l != null)
+/* 139 */ l.webControlEvent(eventID);
+/* */ }
+/* */ }
+/* */
+/* */ public void detach() {
+/* 144 */ this.listeners.removeAllElements();
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\WebControlImp.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file