How to make a Project Insanity WebClient
WHAT YOU WILL NEED
[*] A Project Insanity Client
[*] Dropbox (Dropbox - Simplify your life)
[*] Winrar
[*] JarMaker (JarMaker.rar)
VIDEOS
[*]How to Jar and Sign your Project Insanity Client
STEP 1:
Putting your cache together. First off drag your 'Sprites' folder into your 'Cache' folder. Once you have done that go into your 'Cache folder and select all the files by pressing 'Ctrl+A' then right click one of the items inside the 'Cache' folder while the items inside it are still selected and press the 'Add to archive' option. Then rename it to 'Cache.zip' instead of 'Cache.rar'
STEP 2:
Making the cache auto download. You will need to download THIS file and add it into your Client folder. Then open up 'Client.java' and search for
and under that add this
Code:
new CacheDownloader(this).downloadCache();
STEP 3:
Changing the directories. Go into the 'Sign' folder and open up 'Signlink.java' and search for
Code:
public static String findcachedir() {
return "./Cache/";
}
then delete that method and put this one there
Code:
public static String findcachedir()
{
boolean exists = (new File(System.getProperty("user.home") + "/Cachenamehere/")).exists();
if (exists) {
System.out.println("Directory exists");
return System.getProperty("user.home") + "/Cachenamehere/";
} else {
File f = new File(System.getProperty("user.home") + "/Cachenamehere/");
f.mkdir();
System.out.println("Directory doesnt exist, making directory");
return System.getProperty("user.home") + "/Cachenamehere/";
}
}
Now open up 'Class36.java' and search for
Code:
abyte0 = FileOperations.ReadFile("./Cache/data/" + file + ".dat");
and change that to
Code:
abyte0 = FileOperations.ReadFile(sign.signlink.findcachedir() + "data/" + file + ".dat");
Now open up 'ModelDecompressor.java' and search for
Code:
DataInputStream indexFile = new DataInputStream(new FileInputStream("./Cache/models.idx"));
DataInputStream dataFile = new DataInputStream(new FileInputStream("./Cache/models.dat"));
and change that to
Code:
DataInputStream indexFile = new DataInputStream(new FileInputStream(sign.signlink.findcachedir() + "models.idx"));
DataInputStream dataFile = new DataInputStream(new FileInputStream(sign.signlink.findcachedir() + "models.dat"));
Now open up 'Sprite.java' and search for
Code:
public String location = "./Sprites/";
and change that to
Code:
public String location = sign.signlink.findcachedir() + "Sprites/";
Now it is time to download Dropbox so we can host your cache properly! So go to the link I provided right up the top and download dropbox and then install it! You will now have a new folder in 'My Documents' called 'Dropbox' and inside there you will have 'Photos' and 'Public' Now remember when we made that Cache.zip file. Copy and paste it into your 'Public' folder. Then right click it and there will be a dropbox option, then click 'Copy public link' Then go back to your client and open up 'CacheDownloader.java and search for
Code:
YOUR CACHE URL HERE
Now delete that and press 'Ctrl+V' or paste and your cache URL will appear there! Then save and exit 'CacheDownloader.java'
Now you will have to Jar and Sign your client, watch the video I posted at the top of this thread to see on how to do this! You will also need 'JarMaker' for this which you can download also at the top of this thread as I provided a download link for it!
The HTML code for you website
Code:
<HTML>
<HEAD>
<TITLE>YOUR SERVERS NAME HERE</TITLE>
<body bgcolor="black">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
<BODY>
<center>
<applet name="YOURSERVERSNAMEHERE'S WebClient" width="765" height="503" archive="Client.jar" code="Client.class">
<param name="java_arguments" value="-Xmx1024m">
</applet>
<p>
</BODY>
</HTML>
CREDITS
Justinnn - For all of the code
Me - Making this tutorial and changing some of the code - Making the HTML code for your website - Making the video on how to Jar and Sign your Client