Description: To clean up alot of garbage from client.java
Difficulty: 1
Assumed Knowledge: how to copy and paste.
Tested Server: Project-Dayz(My source, its not released) will work on all.
Files/Classes Modified: client.java, objectClick1.java
Procedure
Step 1: Make a new file called objectclick1.java and put this inside of it.
Code:
import java.io.*;
public class objectClick1 {
public static void objectClick1(int objectID, int objectX, int objectY, int face, int face2, int GateID, int i) {
client c = (client) server.playerHandler.players[i];
int absX = c.absX;
int absY = c.absY;
int teleportToX = c.teleportToX;
int teleportToY = c.teleportToY;
switch(objectID) {
//object cases here
}
}
}
Step 2: open up client.java and search for
copy and paste all of the cases into the objectclick1.java
Step 3: in client.java search for
Code:
if(GoodDistance(absX, absY, objectX, objectY, destinationRange)) {
viewTo(objectX, objectY);
objectClick(objectID, objectX, objectY, 0, 0, 1);
directly under it add this.
Code:
objectClick1.objectClick1(objectID, objectX, objectY, 0, 0, 1, playerId);
and tadah! your server now calls your object clicks from the handler... reduces the size & lagg of your server.
Credits: Me