Results 1 to 2 of 2
Thread: Sitelocking a game
- 07-02-2011, 05:43 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
Sitelocking a game
Hi everyone, I'm pretty new to both the forums and Java.
I've been working on a code to sitelock a game to a website, but I'm getting way too many errors and they don't even make sense.
Here's the code:However, when I compile, I get 41 of the same error. It expects all of my voids, ifs, and even }'s to be a class, interface, or enum :\Java Code:public void testlocation() { try { JSObject localJSObject = JSObject.getWindow(this); int j = 0; localJSObject.eval("var sti=''+top.location;"); String str2 = String.valueOf(String.valueOf(localJSObject.getMember("sti"))); int m = 0; if (str2.startsWith("http:/")) while (m < str2.length() - 1) { if (str2.startsWith("arcadeprehacks.com", m)) j = 1; m++; } else j = 1; if (j == 0) { this.rd.setColor(new Color(0, 0, 0)); this.rd.fillRect(0, 0, 550, 400); this.rd.setColor(new Color(255, 255, 255)); this.rd.drawString("Access Denied !", 30, 50); this.rd.drawString("This game will not run under this loaction:", 30, 100); this.rd.drawString("" + str2, 30, 120); this.rd.drawString("Please contact ArcadePreHacks.com for details.", 30, 200); repaint(); localJSObject.eval("window.open('http://www.arcadeprehacks/','olen','menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=1');"); this.gamer.stop(); } } catch (Exception localException1) { int i = 0; String str1 = "" + getDocumentBase(); int k = 0; if (str1.startsWith("http:/")) while (k < str1.length() - 1) { if (str1.startsWith("arcadeprehacks.com", k)) i = 1; k++; } else i = 1; if (i == 0) { this.rd.setColor(new Color(0, 0, 0)); this.rd.fillRect(0, 0, 550, 400); this.rd.setColor(new Color(255, 255, 255)); this.rd.drawString("Access Denied !", 30, 50); this.rd.drawString("This game will not run under this loaction:", 30, 100); this.rd.drawString("" + str1, 30, 120); this.rd.drawString("Please contact ArcadePreHacks.com for details.", 30, 200); repaint(); try { URL localURL = new URL("http://www.arcadeprehacks.com/"); getAppletContext().showDocument(localURL, "olen"); } catch (Exception localException2) { } this.gamer.stop(); } } } public void stop() { if ((this.exwist) && (this.gamer != null)) { System.gc(); this.gamer.stop(); this.gamer = null; } this.exwist = true; }
What am I doing wrong?
Sample of the errors:
Java Code:sitelock.java:1: class, interface, or enum expected public void testlocation() ^ sitelock.java:6: class, interface, or enum expected int j = 0; ^ sitelock.java:7: class, interface, or enum expected localJSObject.eval("var sti=''+top.location;"); ^Last edited by SandSpur; 07-02-2011 at 05:47 PM.
-
Can you post the whole class, including the class header (you know, that states public class SoAndSo {... )
Similar Threads
-
Complete Game Engine for beginner and intermediate game programmers
By rdjava in forum Java GamingReplies: 1Last Post: 06-02-2011, 09:29 AM -
Implementing "Game Over" in Minesweeper game based on Gridworld framework.
By JFlash in forum New To JavaReplies: 2Last Post: 08-05-2010, 04:49 AM -
game code for any game
By deathnote202 in forum Java GamingReplies: 4Last Post: 06-10-2010, 08:06 AM -
Help with my game!
By Manikyr in forum New To JavaReplies: 6Last Post: 06-06-2009, 11:09 AM -
2D strategy game or 2D war game
By led1433 in forum Java 2DReplies: 5Last Post: 02-10-2009, 06:00 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks