• Welcome to ForumKorner!
    Join today and become a part of the community.

How to make a Webclient.

T A K 3 N

Member
Reputation
0
Hope you guys enjoy, if you use please give credits/post your opinions!
I AM XxJtxX ON MOPAR, JUSTINNN ON R-S AND Justin ON RL!​

Requirements:



Videos:

Step One: (Correctly zipping your cache)
Now that you have WinRAR, we are going to drag our "Sprites" folder into our "Cache" folder. So the location of our Sprites will be "Cache/Sprites/". Now that you have your Sprites in the correct place, you need to zip your cache. DO NOT ZIP YOUR CACHE FOLDER! JUST THE FILES! Also, remember ZIP not RAR.

Step Two: (Getting a Auto-Cache Downloader)
Thank-you openice123 for this. Thank-you Onlyme for a quick fix.
Create a new class file named CacheDownloader. In that class file, put THIS in there. Edit where it says "YOUR DIRECT DOWNLOAD TO YOUR CACHE!" to your direct download to your cache. Now, go into your client.java and search for ""Starting up"". Directly under that, add this code:
Code:
        new CacheDownloader(this).downloadCache();
Step Three: (Changing where your client grabs the Cache from)
Thank-you ric914 for this.
To change where your Cache grabs the cache from, go into sign>signlink.java. Now, search for:
Code:
    public static String findcachedir() {
        return "./Cache/";
    }
Change that to:
Code:
public static String findcachedir()
	{
		boolean exists = (new File(System.getProperty("user.home") + "/Your_Client_Name_Cache/")).exists();
		if (exists) {
			System.out.println("Directory exists");
			return System.getProperty("user.home") + "/Your_Client_Name_Cache/";
		} else {
			File f = new File(System.getProperty("user.home") + "/Your_Client_Name_Cache/");
			f.mkdir();
			System.out.println("Directory doesnt exist, making directory");
			return System.getProperty("user.home") + "/Your_Client_Name_Cache/";
		}
	}
Now, open up the following files:

  • Class36.java
  • ModelDecompressor.java
  • Sprite.java

In Class36, search for:
Code:
        abyte0 = FileOperations.ReadFile("./Cache/data/" + file + ".dat");
Change that to:
Code:
        abyte0 = FileOperations.ReadFile(sign.signlink.findcachedir() + "data/" + file + ".dat");
Now, in ModelDecompressor, search for:
Code:
            DataInputStream indexFile = new DataInputStream(new FileInputStream("./Cache/models.idx"));
            DataInputStream dataFile = new DataInputStream(new FileInputStream("./Cache/models.dat"));
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, in Sprite, search for:
Code:
    public String location = "./Sprites/";
Change that to:
Code:
    public String location = sign.signlink.findcachedir() + "Sprites/";
Step Four: (Editing the init method)
In client.java, search for:
Code:
    public void init() {
        nodeID = 10;
        portOff = 0;
        setHighMem();
        isMembers = true;
        initClientFrame(503, 765);
    }
Change that method to:
Code:
    public void init() {
        try {
            nodeID = 10;
            portOff = 0;
            setLowMem();
            isMembers = true;
            signlink.storeid = 32;
            signlink.startpriv(InetAddress.getLocalHost());
            initClientFrame(505,767);
        } 
        catch (Exception exception) {
            return;
        }
    }
Step Five: (Editing the main method)
In client.java, search for:
Code:
    public static void main(String args[]) {
        try {
            System.out.println("RS2 user client - release #" + 317);
            if(args.length != 5) {
                System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
                return;
            }
            nodeID = Integer.parseInt(args[0]);
            //portOff = Integer.parseInt(args[1]);
            portOff = 0;
            if(args[2].equals("lowmem"))
                setLowMem();
            else if(args[2].equals("highmem")) {
                setHighMem();
            } else {
                System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
                return;
            }
            if(args[3].equals("free"))
                isMembers = false;
            else if(args[3].equals("members")) {
                isMembers = true;
            } else {
                System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
                return;
            }
            signlink.storeid = Integer.parseInt(args[4]);
            signlink.startpriv(InetAddress.getLocalHost());
            new Jframe(args);
            //client client1 = new client();
            //client1.createClientFrame(503, 765);
        } catch(Exception exception) {
        }
    }
Change that method to:
Code:
    public static void main(String args[]) {
        try {
            nodeID = 10;
            portOff = 0;
            setLowMem();
            isMembers = true;
            signlink.storeid = 32;
            signlink.startpriv(InetAddress.getLocalHost());
            client client1 = new client();
            client1.createClientFrame(505, 767);
        }
        catch(Exception exception)
        {
        }
    }
Step Six: (JARing your client)
Please use the video located at the top for this.

Step Seven: (Uploading your webclient)
This is basically common sense, all you have to do is upload your client.jar, and make an html page. Here is a basic outline for a webclient page.

Code:
<HTML>
<HEAD>
<TITLE>YOUR CLIENT</TITLE>
<body bgcolor="black">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>

<BODY>
<center>
<applet name="Webclient Tutorial by Justin!" width="765" height="503" archive="client.jar" code="client.class">
<param name="java_arguments" value="-Xmx1024m">
</applet>
<p>
<font color="white"><b>NOTE:</b> <I>

YOUR SPECIAL NOTE HERE!!
</br>
Another note here..
</I></font>

</BODY>
</HTML>
 

SlizZ

Member
Reputation
0
wow. Thought is was harder then this to make a web client :) Thanks for sharing your knowledge with us ;)
 
Top