help would be appriacted - i usually do that on a ENITRLY different file but i have no clue how to describe the INT's for a different file - note if you didnt read its supposed to be for teleportPet_process() which if you want to look at that code its in the extremely long code x.x
ive also tried to describe the INTS myself by maknig it do npcHandler.process();
by doing it like

int npcType = npcHandler;

where it reads npcHandler as NPCHandler() where NPCHandler is the name of the file - or am i trying this all wrong and i should just combine the timer int eh 2nd part of the coding in with void newPetNPC to do the work?

Attachments
import java.net.*;
import java.sql.*;
import java.io.*;
import java.util.StringTokenizer;
import java.util.Calendar;
import java.util.GregorianCalendar;


public class server implements Runnable {

    public server() {// the current way of controlling the server at runtime and a great debugging/testing tool
        // jserv js = new jserv(this);
        // js.start();
    }
    // TODO: yet to figure out proper value for timing, but 500 seems good
    public static final int cycleTime = 500;
    public static boolean updateServer = false;
    public static int updateSeconds = 180; // 180 because it doesnt make the time jump at the start :P
    public static long startTime;

    public static void main(java.lang.String args[]) {
        clientHandler = new server();
        (new Thread(clientHandler)).start(); // launch server listener

        playerHandler = new PlayerHandler();
	FollowHandler = new FollowHandler();
        textHandler = new TextHandler();
        npcHandler = new NPCHandler();
        itemHandler = new ItemHandler();
        shopHandler = new ShopHandler();
        antilag = new antilag();
        itemspawnpoints = new itemspawnpoints();
        GraphicsHandler = new GraphicsHandler();
        objectHandler = new ObjectHandler();
	Castlewars = new Castlewars();
	restartTimer = new restartTimer();
        int waitFails = 0;
        long lastTicks = System.currentTimeMillis();
        long totalTimeSpentProcessing = 0;
        int cycle = 0;

        while (!shutdownServer) {
            if (updateServer) {
                calcTime();
            }

            // could do game updating stuff in here...
            // maybe do all the major stuff here in a big loop and just do the packet
            // sending/receiving in the client subthreads. The actual packet forming code
            // will reside within here and all created packets are then relayed by the subthreads.
            // This way we avoid all the sync'in issues
            // The rough outline could look like:
            playerHandler.process(); // updates all player related stuff
            npcHandler.process();
	    Castlewars.process();
	    restartTimer.process();
            itemHandler.process();
            shopHandler.process();
	    npcHandler.teleportPet_process((int) npcType, (int) x, (int) y, (int) summonedBy);
            antilag.process();
            itemspawnpoints.process();
            objectHandler.process();
            objectHandler.firemaking_process();
            System.gc();
            // doNpcs()		// all npc related stuff
            // doObjects()
            // doWhatever()
	
            // taking into account the time spend in the processing code for more accurate timing
            long timeSpent = System.currentTimeMillis() - lastTicks;

            totalTimeSpentProcessing += timeSpent;
            if (timeSpent >= cycleTime) {
                timeSpent = cycleTime;
                if (++waitFails > 100) {
                    // shutdownServer = true;
                    misc.println(
                            "[KERNEL]: machine is too slow to run this server!");
                }
            }
            try {
                Thread.sleep(cycleTime - timeSpent);
            } catch (java.lang.Exception _ex) {}
            lastTicks = System.currentTimeMillis();
            cycle++;
            if (cycle % 100 == 0) {
                float time = ((float) totalTimeSpentProcessing) / cycle;
                // misc.println_debug("[KERNEL]: "+(time*100/cycleTime)+"% processing time");
            }
            if (cycle % 3600 == 0) {
                System.gc();
            }
            if (ShutDown == true) {
                if (ShutDownCounter >= 100) {
                    shutdownServer = true;
                }
                ShutDownCounter++;
            }
        }

        // shut down the server
        playerHandler.destruct();
        clientHandler.killServer();
        clientHandler = null;
    }

    public Socket acceptSocketSafe(ServerSocket x) { // Anti-nuller by Slysoft
        boolean socketFound = false;
        Socket s = null;

        do {
            try {
                s = x.accept();
                int i = s.getInputStream().read();

                if ((i & 0xFF) == 14) {
                    socketFound = true;
                }
            } catch (Exception e) {}
        } while (!socketFound);

        return s;
    }

    public static server clientHandler = null; // handles all the clients
    public static int cwarszammymax = 0;
    public static int cwarssaramax = 0;
    public static int team1 = 0;
    public static int team2 = 0;
    public static int zammyscore = 0;
    public static int sarascore = 0;
    public static Castlewars Castlewars = null;
    public static restartTimer restartTimer = null;
    public static NPCHandler teleportPet = null;
    public static java.net.ServerSocket clientListener = null;
    public static boolean shutdownServer = false; // set this to true in order to shut down and kill the server
    public static boolean shutdownClientHandler; // signals ClientHandler to shut down
    public static int serverlistenerPort = 43594; // 43594=default

    public static PlayerHandler playerHandler = null;
    public static NPCHandler npcHandler = null;
    public static TextHandler textHandler = null;
    public static ItemHandler itemHandler = null;
    public static ShopHandler shopHandler = null;
    public static antilag antilag = null;
    public static itemspawnpoints itemspawnpoints = null;
    public static GraphicsHandler GraphicsHandler = null;
    public static ObjectHandler objectHandler = null;
    public static FollowHandler FollowHandler = null;

    public static void calcTime() {
        long curTime = System.currentTimeMillis();

        updateSeconds = 180 - ((int) (curTime - startTime) / 1000);
        if (updateSeconds == 0) {
            shutdownServer = true;
        }
    }

    public void run() {
        // setup the listener
        try {
            shutdownClientHandler = false;
            clientListener = new java.net.ServerSocket(serverlistenerPort, 1,
                    null);
            misc.println("champscape");
            misc.println("- - - Now Online!   :D");
            while (true) {
                java.net.Socket s = acceptSocketSafe(clientListener);

                s.setTcpNoDelay(true);
                String connectingHost = s.getInetAddress().getHostName();

                if (/* connectingHost.startsWith("localhost") || connectingHost.equals("127.0.0.1")*/true) {
                    if (connectingHost.startsWith("computing")
                            || connectingHost.startsWith("server2")) {
                        misc.println(
                                connectingHost
                                        + ": Checking if server still is online...");
                    } else {
                        int Found = -1;

                        for (int i = 0; i < MaxConnections; i++) {
                            if (Connections[i] == connectingHost) {
                                Found = ConnectionCount[i];
                                break;
                            }
                        }
                        if (Found < 3) {
                            misc.println(
                                    "Connection accepted from " + connectingHost
                                    + ": " + s.getPort() + ".");
                            playerHandler.newPlayerClient(s, connectingHost);                  
                        } else {
                            s.close();
                        }
                    }
                } else {
                    misc.println(
                            "ClientHandler: Rejected " + connectingHost + ":"
                            + s.getPort());
                    s.close();
                }
            }
        } catch (java.io.IOException ioe) {
            if (!shutdownClientHandler) {
                misc.println(
                        "Error: Unable to startup listener on "
                                + serverlistenerPort + " - port already in use?");
            } else {
                misc.println("ClientHandler was shut down.");
            }
        }
    }
        public void castleWars() {
            if(Castlewars.gameTime == 0) {
                zammyscore = 0;
                sarascore = 0;
            }
            if(Castlewars.waitTime == 0) {
                cwarssaramax = 0;
                cwarszammymax = 0;
            }
        }
	public void restartTimer() {
		if(restartTimer.Time == 120) {
		misc.println("restarting in 1 minuute!"); //added this so it would work.
		PlayerHandler.messageToAll = ("server restarting in one minute, get ur stuff from ge!");
		}
	}
	
    public void killServer() {
        try {
            shutdownClientHandler = true;
            if (clientListener != null) {
                clientListener.close();
            }
            clientListener = null;
        } catch (java.lang.Exception __ex) {
            __ex.printStackTrace();
        }
    }

    public static int EnergyRegian = 0;

    public static int MaxConnections = 2;
    public static String[] Connections = new String[MaxConnections];
    public static int[] ConnectionCount = new int[MaxConnections];
    public static boolean ShutDown = false;
    public static int ShutDownCounter = 0;
}

the send part of that was also VERy important since it showed all the things used to make it work - without it tehre would be no way in hell to tell how to fix it becuase know one would know how to describe the int's - i'll attach the second part as well as a different .txt so if someone decides to help they can get it correct x.x

Comments
The mod was merely trying to correct your own mistake. Attitude is not needed.
Attachments
import java.io.*;


public class NPCHandler {
public void newPetNPC(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) { 
int slot = -1; 
for (int i = 1; i < maxNPCs; i++) { 
if (npcs[i] == null) { 
slot = i; 
break; 
} 
} 
if(slot == -1) 
return; 
if(HP <= 0) { 
HP = 100; 
} 
int Timer = 60; // about 30 seconds
int teleportTimer = -1;
if(teleportTimer >= 0) {
teleportTimer -= 1;
}
if(teleportTimer == -1) {
teleportTimer = Timer;
}
if(teleportTimer == 0) {
NPC newNPC = new NPC(slot, npcType);
newNPC.absX = summonedBy; 
newNPC.absY = summonedBy; 
newNPC.makeX = summonedBy; 
newNPC.makeY = summonedBy; 
newNPC.moverangeX1 = rangex1; 
newNPC.moverangeY1 = rangey1; 
newNPC.moverangeX2 = rangex2; 
newNPC.moverangeY2 = rangey2; 
newNPC.walkingType = WalkingType; 
newNPC.HP = HP; 
newNPC.MaxHP = HP; 
newNPC.heightLevel = heightLevel; 
newNPC.Respawns = Respawns; 
newNPC.followPlayer = summonedBy; 
newNPC.followingPlayer = true; 
}
NPC newNPC = new NPC(slot, npcType); 
newNPC.absX = x; 
newNPC.absY = y; 
newNPC.makeX = x; 
newNPC.makeY = y; 
newNPC.moverangeX1 = rangex1; 
newNPC.moverangeY1 = rangey1; 
newNPC.moverangeX2 = rangex2; 
newNPC.moverangeY2 = rangey2; 
newNPC.walkingType = WalkingType; 
newNPC.HP = HP; 
newNPC.MaxHP = HP; 
newNPC.heightLevel = heightLevel; 
newNPC.Respawns = Respawns; 
newNPC.followPlayer = summonedBy; 
newNPC.followingPlayer = true; 
npcs[slot] = newNPC; 
}

    public static int maxNPCs = 10000;
    public static int maxListedNPCs = 10000;
    public static int maxNPCDrops = 10000;
    public NPC npcs[] = new NPC[maxNPCs];
    public NPCList NpcList[] = new NPCList[maxListedNPCs];
    public NPCDrops NpcDrops[] = new NPCDrops[maxNPCDrops];

    NPCHandler() {
        for (int i = 0; i < maxNPCs; i++) {
            npcs[i] = null;
        }
        for (int i = 0; i < maxListedNPCs; i++) {
            NpcList[i] = null;
        }
        for (int i = 0; i < maxNPCDrops; i++) {
            NpcDrops[i] = null;
        }
        loadNPCList("npc.cfg");
        loadNPCDrops("npcdrops.cfg");
        loadAutoSpawn("autospawn.cfg");
    }
							
    public void newNPC(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns) {
        // first, search for a free slot
        int slot = -1;

        for (int i = 1; i < maxNPCs; i++) {
            if (npcs[i] == null) {
                slot = i;
                break;
            }
        }

        if (slot == -1) {
            return;
        }		// no free slot found
        if (HP <= 0) { // This will cause client crashes if we don't use this :) - xero
            HP = 3000;
        }
        NPC newNPC = new NPC(slot, npcType);

        newNPC.absX = x;
        newNPC.absY = y;
        newNPC.makeX = x;
        newNPC.makeY = y;
        newNPC.moverangeX1 = rangex1;
        newNPC.moverangeY1 = rangey1;
        newNPC.moverangeX2 = rangex2;
        newNPC.moverangeY2 = rangey2;
        newNPC.walkingType = WalkingType;
        newNPC.HP = HP;
        newNPC.MaxHP = HP;
        newNPC.MaxHit = (int) Math.floor((HP / 100));
        if (newNPC.MaxHit < 1) {
            newNPC.MaxHit = 1;
        }
        newNPC.heightLevel = heightLevel;
        newNPC.Respawns = Respawns;
        npcs[slot] = newNPC;
    }

    public void newSummonedNPC(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) {
        // first, search for a free slot
        int slot = -1;

        for (int i = 1; i < maxNPCs; i++) {
            if (npcs[i] == null) {
                slot = i;
                break;
            }
        }

        if (slot == -1) {
            return;
        }		// no free slot found
        if (HP <= 0) { // This will cause client crashes if we don't use this :) - xero
            HP = 3000;
        }
        NPC newNPC = new NPC(slot, npcType);

        newNPC.absX = x;
        newNPC.absY = y;
        newNPC.makeX = x;
        newNPC.makeY = y;
        newNPC.moverangeX1 = rangex1;
        newNPC.moverangeY1 = rangey1;
        newNPC.moverangeX2 = rangex2;
        newNPC.moverangeY2 = rangey2;
        newNPC.walkingType = WalkingType;
        newNPC.HP = HP;
        newNPC.MaxHP = HP;
        newNPC.MaxHit = (int) Math.floor((HP / 100));
        if (newNPC.MaxHit < 1) {
            newNPC.MaxHit = 10;
        }
        newNPC.heightLevel = heightLevel;
        newNPC.Respawns = Respawns;
        newNPC.followPlayer = summonedBy;
        newNPC.followingPlayer = true;
        npcs[slot] = newNPC;
    }

    public void newNPCList(int npcType, String npcName, int combat, int HP) {
        // first, search for a free slot
        int slot = -1;

        for (int i = 0; i < maxListedNPCs; i++) {
            if (NpcList[i] == null) {
                slot = i;
                break;
            }
        }

        if (slot == -1) {
            return;
        }		// no free slot found

        NPCList newNPCList = new NPCList(npcType);

        newNPCList.npcName = npcName;
        newNPCList.npcCombat = combat;
        newNPCList.npcHealth = HP;
        NpcList[slot] = newNPCList;
    }

    public void newNPCDrop(int npcType, int dropType, int Items[], int ItemsN[]) {
        // first, search for a free slot
        int slot = -1;

        for (int i = 0; i < maxNPCDrops; i++) {
            if (NpcDrops[i] == null) {
                slot = i;
                break;
            }
        }

        if (slot == -1) {
            return;
        }		// no free slot found

        NPCDrops newNPCDrop = new NPCDrops(npcType);

        newNPCDrop.DropType = dropType;
        newNPCDrop.Items = Items;
        newNPCDrop.ItemsN = ItemsN;
        NpcDrops[slot] = newNPCDrop;
    }

    /*
     public boolean IsInWorldMap(int coordX, int coordY) {
     for (int i = 0; i < worldmap[0].length; i++) {
     //if (worldmap[0][i] == coordX && worldmap[1][i] == coordY) {
     return true;
     //}
     }
     return false;
     }
     public boolean IsInWorldMap2(int coordX, int coordY) {
     for (int i = 0; i < worldmap2[0].length; i++) {
     if (worldmap2[0][i] == coordX && worldmap2[1][i] == coordY) {
     return true;
     }
     }
     return true;
     }

     public boolean IsInRange(int NPCID, int MoveX, int MoveY) {
     int NewMoveX = (npcs[NPCID].absX + MoveX);
     int NewMoveY = (npcs[NPCID].absY + MoveY);
     if (NewMoveX <= npcs[NPCID].moverangeX1 && NewMoveX >= npcs[NPCID].moverangeX2 && NewMoveY <= npcs[NPCID].moverangeY1 && NewMoveY >= npcs[NPCID].moverangeY2) {
     if ((npcs[NPCID].walkingType == 1 && IsInWorldMap(NewMoveX, NewMoveY) == true) || (npcs[NPCID].walkingType == 2 && IsInWorldMap2(NewMoveX, NewMoveY) == false)) {
     if (MoveX == MoveY) {
     if ((IsInWorldMap(NewMoveX, npcs[NPCID].absY) == true && IsInWorldMap(npcs[NPCID].absX, NewMoveY) == true) || (IsInWorldMap2(NewMoveX, npcs[NPCID].absY) == false && IsInWorldMap2(npcs[NPCID].absX, NewMoveY) == false)) {
     return true;
     }
     return false;
     }
     return true;
     }
     }
     return false;
     }*/
    public int GetMove(int Place1, int Place2) { // Thanks to diablo for this! Fixed my npc follow code <3
        if ((Place1 - Place2) == 0) {
            return 0;
        } else if ((Place1 - Place2) < 0) {
            return 1;
        } else if ((Place1 - Place2) > 0) {
            return -1;
        }
        return 0;
    }

    public void FollowPlayer(int NPCID) {
        int follow = npcs[NPCID].followPlayer;
        int playerX = server.playerHandler.players[follow].absX;
        int playerY = server.playerHandler.players[follow].absY;

        npcs[NPCID].RandomWalk = false;
        if (server.playerHandler.players[follow] != null) {
            if (playerY < npcs[NPCID].absY) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY + 1);
            } else if (playerY > npcs[NPCID].absY) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY - 1);
            } else if (playerX < npcs[NPCID].absX) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX + 1);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY);
            } else if (playerX > npcs[NPCID].absX) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX - 1);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY);
            }
            npcs[NPCID].getNextNPCMovement();                                              
            npcs[NPCID].updateRequired = true;
        }
    }

    public void FollowPlayerCB(int NPCID, int playerID) {
        int playerX = server.playerHandler.players[playerID].absX;
        int playerY = server.playerHandler.players[playerID].absY;

        npcs[NPCID].RandomWalk = false;
        if (server.playerHandler.players[playerID] != null) {
            if (playerY < npcs[NPCID].absY) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY + 1);
            } else if (playerY > npcs[NPCID].absY) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY - 1);
            } else if (playerX < npcs[NPCID].absX) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX + 1);
                npcs[NPCID].moveY = GetMove(npcs[NPCID].absY, playerY);
            } else if (playerX > npcs[NPCID].absX) {
                npcs[NPCID].moveX = GetMove(npcs[NPCID].absX, playerX - 1);
                npcs[NPCID].moveY

you also messed up the important part about were the error was at - again sorry for double posting but you sort of ruined what i was trying to get help with - the part i was getting errors on was if you notice in java.txt were it says like

Castlewars = Castlewars.process()

i need it to look a little something like

teleportPet = npcHandler.teleportPet_process(int npcType, int x, int y, int summonedBy);

thats what i need and as you can tell above he completely removed that x.x. java2.txt is also known as NPCHandler. thats where the INT's are handled if someone can figure out for me how exactly they are described than put them into java.txt that would be the greats and i'd give you credits. thanks!

you also messed up the important part about were the error was at - again sorry for double posting but you sort of ruined what i was trying to get help with - the part i was getting errors on was if you notice in java.txt were it says like

Castlewars = Castlewars.process()

i need it to look a little something like

teleportPet = npcHandler.teleportPet_process(int npcType, int x, int y, int summonedBy);

thats what i need and as you can tell above he completely removed that x.x. java2.txt is also known as NPCHandler. thats where the INT's are handled if someone can figure out for me how exactly they are described than put them into java.txt that would be the greats and i'd give you credits. thanks!

"You", "He", "They", who are you referring to? That's a massive file you attached in the second post. What exactly is the question? Are there some posts missing on this thread?

"You", "He", "They", who are you referring to? That's a massive file you attached in the second post. What exactly is the question? Are there some posts missing on this thread?

in the REAL files there two different files, the first one handles updates to the client the second one is where it handle's the process. i need someone to help me describe the INT's so it would work and not give the 'cannot find symbol' error. its pretty much just making a int to read from a different file which i have no clue how to do, if thats even possible?

This article has been dead for over six months. Start a new discussion instead.