summaryrefslogtreecommitdiff
path: root/NET/worlds/console/WebControlImp.java
blob: 45a1e488bd399bab2611a9e94a8bf8bee0679eb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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
 */