Skip to content

Commit 48ba175

Browse files
authored
Merge pull request #182 from runejs/refactor/gpu-preperations
Remove some dead code from GameShell
2 parents 4e4c6f1 + a8d3466 commit 48ba175

File tree

1 file changed

+2
-67
lines changed

1 file changed

+2
-67
lines changed

src/main/java/org/runejs/client/GameShell.java

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import java.awt.*;
1313
import java.awt.event.*;
14-
import java.io.IOException;
1514
import java.lang.reflect.Method;
1615
import java.net.InetAddress;
1716
import java.net.URL;
@@ -139,39 +138,16 @@ public synchronized void closeGameShell() {
139138
}
140139
}
141140

142-
public void stop() {
143-
if (this == currentGameShell && !closedClient)
144-
exitTimeInMillis = System.currentTimeMillis() + 4000L;
145-
}
146-
147-
public boolean verifyHost(int arg0) {
148-
String string = getDocumentBase().getHost().toLowerCase();
149-
if (arg0 != 31)
150-
return false;
151-
if (string.endsWith("127.0.0.1"))
152-
return true;
153-
for (/**/; string.length() > 0 && string.charAt(string.length() - 1) >= '0' && string.charAt(string.length() + -1) <= 57; string = string.substring(0, string.length() - 1)) {
154-
/* empty */
155-
}
156-
if (string.endsWith("192.168.1."))
157-
return true;
158-
openErrorPage("invalidhost");
159-
return false;
160-
}
161-
162141
public void windowOpened(WindowEvent arg0) {
163142
}
164143

165144
public void openErrorPage(String gameError) {
145+
// Previously opened an error page in a browser
146+
// getAppletContext().showDocument(new URL(getCodeBase(), ("error_game_" + gameError + ".ws")));
166147
if (!gameShellError) {
167148
gameShellError = true;
168149
System.out.println("error_game_" + gameError);
169-
try {
170-
// getAppletContext().showDocument(new URL(getCodeBase(), ("error_game_" + gameError + ".ws")));
171-
} catch (Exception exception) {
172-
}
173150
}
174-
175151
}
176152

177153
public void start() {
@@ -216,27 +192,6 @@ public URL getDocumentBase() {
216192
}
217193
return null;
218194
}
219-
220-
public void displayClientFrame(int clientVersion, int width, int height, int fileStoreId) {
221-
if (currentGameShell != null) {
222-
openErrorPage("alreadyloaded");
223-
return;
224-
}
225-
MovedStatics.width = height;
226-
Game.clientVersion = clientVersion;
227-
MovedStatics.height = width;
228-
currentGameShell = this;
229-
if (Game.signlink == null) {
230-
try {
231-
MovedStatics.signlink = Game.signlink = new Signlink(false, this, InetAddress.getByName(getCodeBase().getHost()), fileStoreId, null, 0);
232-
} catch (IOException e) {
233-
e.printStackTrace();
234-
}
235-
}
236-
Game.signlink.createThreadNode(1, this);
237-
windowActivated(null);
238-
}
239-
240195
public void windowIconified(WindowEvent arg0) {
241196
}
242197

@@ -276,14 +231,6 @@ public void runAfterGameLoop() {
276231
this.game.updateStatusText();
277232
}
278233

279-
// public AppletContext getAppletContext() {
280-
// if(Class35.aFrame1732 != null)
281-
// return null;
282-
// if(ISAAC.aClass31_521 != null && ISAAC.aClass31_521.anApplet740 != this)
283-
// return ISAAC.aClass31_521.anApplet740.getAppletContext();
284-
// return super.getAppletContext();
285-
// }
286-
287234
public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStoreId, InetAddress inetAddress, int clientVersion) {
288235
try {
289236
int height = 503;
@@ -294,7 +241,6 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
294241
currentGameShell = this;
295242
clientFrame = new Frame();
296243
clientFrame.setTitle(Configuration.SERVER_DISPLAY_NAME);
297-
// Class35.aFrame1732.setResizable(false);
298244
ScreenController.frameMode(ScreenMode.FIXED);
299245
clientFrame.setPreferredSize(new Dimension(width, height));
300246
clientFrame.setResizable(ScreenController.frameMode == ScreenMode.RESIZABLE);
@@ -303,7 +249,6 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
303249
clientFrame.toFront();
304250
Insets insets = clientFrame.getInsets();
305251
clientFrame.setSize(insets.right + width + insets.left, insets.bottom + insets.top + height);
306-
// Class35.aFrame1732.setLocationRelativeTo(null);
307252
MovedStatics.signlink = Game.signlink = new Signlink(true, null, inetAddress, fileStoreId, cacheFolder, cacheIndexes);
308253
Game.signlink.createThreadNode(1, this);
309254
} catch (Exception exception) {
@@ -323,21 +268,11 @@ public void windowClosing(WindowEvent windowEvent) {
323268
destroy();
324269
}
325270

326-
// public String getParameter(String parameter) {
327-
// if(Class35.aFrame1732 != null)
328-
// return null;
329-
// if(ISAAC.aClass31_521 != null && this != ISAAC.aClass31_521.anApplet740)
330-
// return ISAAC.aClass31_521.anApplet740.getParameter(parameter);
331-
// return super.getParameter(parameter);
332-
// }
333-
334271
public void windowDeactivated(WindowEvent windowEvent) {
335272
}
336273

337274
public synchronized void setCanvas() {
338275
Container container = clientFrame;
339-
// else
340-
// container = ISAAC.aClass31_521.anApplet740;
341276
if (Game.gameCanvas != null) {
342277
Game.gameCanvas.removeFocusListener(this);
343278
container.remove(Game.gameCanvas);

0 commit comments

Comments
 (0)