Thread: fire making glitched

Results 1 to 9 of 9
  1. #1 fire making glitched 
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    When a player lights the logs it makes the server lag and drops lots lots of ashes, the server says invaild waypoint in walking queu!
    Reply With Quote  
     

  2. #2  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    paste your firemaking class.
    Reply With Quote  
     

  3. #3  
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    package server.model.skills.firemaking;

    import server.Server;

    import server.model.players.Client;
    //import server.world.Tiles;
    //import server.world.WalkingCheck;
    import server.model.players.Client;
    import server.Config;
    import server.*;
    import server.event.*;
    //import server.clip.region.*;
    //import server.world.map.VirtualWorld;
    //import server.clip.region.Region;
    import server.model.skills.woodcutting.Woodcutting;

    public class Firemaking {

    Client c;

    public Firemaking(Client c) {
    this.c = c;
    }

    //private static Tiles currentTile;

    private static int[][] data = {
    {1511, 1, 40, 25465}, // LOG
    {7406, 1, 250, 11406}, // RED LOG
    {7405, 1, 250, 11405}, // BLUE LOG
    {7404, 1, 250, 11404}, // RED LOG
    {2862, 1, 40, 25465}, // ACHEY
    {1521, 15, 60, 25465}, // OAK
    {1519, 30, 105, 25465}, // WILLOW
    {6333, 35, 105, 25465}, // TEAK
    {1517, 45, 135, 25465}, // MAPLE
    {10810,45, 135, 25465}, // ARTIC PINE
    {6332, 50, 158, 25465}, // MAHOGANY
    {1515, 60, 203, 25465}, // YEW
    {1513, 75, 304, 25465}, // MAGIC
    };

    public static boolean playerLogs(Client c, int i, int l) {
    boolean flag = false;
    for(int kl = 0; kl < data.length; kl++) {
    if((i == data[kl][0] && requiredItem(c, l)) || (requiredItem(c, i) && l == data[kl][0])) {
    flag = true;
    }
    }
    return flag;
    }

    private static int getAnimation(Client c, int item, int item1) {
    int[][] data = {
    {841, 6714}, {843, 6715}, {849, 6716}, {853, 6717},
    {857, 6718}, {861, 6719},
    };
    for(int i = 0; i < data.length; i++) {
    if(item == data[i][0] || item1 == data[i][0]) {
    return data[i][1];
    }
    }
    return 733;
    }

    private static boolean requiredItem(Client c, int i) {
    int[] data = {
    841, 843, 849, 853, 857, 861, 590
    };
    for(int l = 0; l < data.length; l++) {
    if(i == data[l]) {
    return true;
    }
    }
    return false;
    }


    public static void grabData(final Client c, final int useWith, final int withUse) {
    final int[] coords = new int[2];
    coords[0] = c.absX;
    coords[1] = c.absY;
    //if(c.playerIsWoodcutting) {
    //Woodcutting.resetWoodcut();
    //}
    for(int i = 0; i < data.length; i++) {
    if((requiredItem(c, useWith) && withUse == data[i][0] || useWith == data[i][0] && requiredItem(c, withUse))) {
    if(c.playerLevel[11] < data[i][1]) {
    c.sendMessage("You don't have the correct Firemaking level to light this log!");
    c.sendMessage("You need the Firemaking level of at least "+ data[i][1] +".");
    return;
    }
    if (System.currentTimeMillis() - c.lastFire > 1200) {

    if(c.playerIsFiremaking) {
    return;
    }

    final int[] time = new int[3];
    final int log = data[i][0];
    final int fire = data[i][3];
    if(System.currentTimeMillis() - c.lastFire > 3000) {
    c.startAnimation(getAnimation(c, useWith, withUse));
    time[0] = 4;
    time[1] = 3;
    } else {
    time[0] = 1;
    time[1] = 2;
    }

    c.playerIsFiremaking = true;

    Server.itemHandler.createGroundItem(c, log, coords[0], coords[1], 1, c.getId());

    World.getWorld().submit(new Event(time[0]) {
    @Override
    public void execute() {
    Server.objectHandler.createAnObject(c, fire, coords[0], coords[1]);
    Server.itemHandler.removeGroundItem(c, log, coords[0], coords[1], false);
    c.playerIsFiremaking = false;
    this.stop();
    }
    @Override
    public void stop() {

    }
    });

    //currentTile = new Tiles(c.absX - 1, c.absY, c.heightLevel);

    /*if (Region.getClipping(c.getX() - 1, c.getY(), c.heightLevel, -1, 0)) {
    c.getPA().walkTo(-1, 0);
    } else if (Region.getClipping(c.getX() + 1, c.getY(), c.heightLevel, 1, 0)) {
    c.getPA().walkTo(1, 0);
    } else if (Region.getClipping(c.getX(), c.getY() - 1, c.heightLevel, 0, -1)) {
    c.getPA().walkTo(0, -1);
    } else if (Region.getClipping(c.getX(), c.getY() + 1, c.heightLevel, 0, 1)) {
    c.getPA().walkTo(0, 1);
    }*/


    c.sendMessage("You light the logs.");

    World.getWorld().submit(new Event(time[1]) {
    @Override
    public void execute() {
    c.startAnimation(65535);
    this.stop();
    }
    @Override
    public void stop() {

    }
    });

    World.getWorld().submit(new Event(200) {
    @Override
    public void execute() {
    Server.objectHandler.createAnObject(c, -1, coords[0], coords[1]);
    Server.itemHandler.createGroundItem(c, 592, coords[0], coords[1], 1, c.getId());
    this.stop();
    }
    @Override
    public void stop() {

    }
    });

    c.getPA().addSkillXP(data[i][2] * Config.FIREMAKING_EXPERIENCE, 11);
    c.turnPlayerTo(c.absX+1, c.absY);
    c.getItems().deleteItem(data[i][0], c.getItems().getItemSlot(data[i][0]), 1);
    c.lastFire = System.currentTimeMillis();
    }
    }
    }
    }
    }
    Reply With Quote  
     

  4. #4  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Seems fine, could possibly be your object handler class causing the issue.
    Reply With Quote  
     

  5. #5  
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Arithium View Post
    Seems fine, could possibly be your object handler class causing the issue.
    package server.world;

    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;

    import server.Server;
    import server.model.objects.Objects;
    import server.model.players.Client;
    import server.model.players.Player;
    import server.util.Misc;

    /**
    * @author Sanity
    */

    public class ObjectHandler {


    public List<Objects> globalObjects = new ArrayList<Objects>();
    public ObjectHandler() {
    loadGlobalObjects("./Data/cfg/global-objects.cfg");
    loadDoorConfig("./Data/cfg/doors.cfg");
    }

    public void createAnObject(Client c, int id, int x, int y) {
    Objects OBJECT = new Objects(id, x, y, 0, 0, 10, 0);
    if(id == -1) {
    removeObject(OBJECT);
    } else {
    addObject(OBJECT);
    }
    Server.objectHandler.placeObject(OBJECT);
    }

    public void createAnObject(Client c, int id, int x, int y, int face) {
    Objects OBJECT = new Objects(id, x, y, 0, face, 10, 0);
    if(id == -1) {
    removeObject(OBJECT);
    } else {
    addObject(OBJECT);
    }
    Server.objectHandler.placeObject(OBJECT);
    }


    /**
    * Adds object to list
    **/
    public void addObject(Objects object) {
    globalObjects.add(object);
    }

    /**
    * Removes object from list
    **/
    public void removeObject(Objects object) {
    globalObjects.remove(object);
    }

    /**
    * Does object exist
    **/
    public Objects objectExists(int objectX, int objectY, int objectHeight) {
    for(Objects o : globalObjects) {
    if(o.getObjectX() == objectX && o.getObjectY() == objectY && o.getObjectHeight() == objectHeight) {
    return o;
    }
    }
    return null;
    }

    /**
    * Update objects when entering a new region or logging in
    **/
    public void updateObjects(Client c) {
    for(Objects o : globalObjects) {
    if(c != null) {
    if(c.heightLevel == o.getObjectHeight() && o.objectTicks == 0) {
    if (c.distanceToPoint(o.getObjectX(), o.getObjectY()) <= 60) {
    c.getPA().object(o.getObjectId(), o.getObjectX(), o.getObjectY(), o.getObjectFace(), o.getObjectType());
    }
    }
    }
    }
    if (c.distanceToPoint(2813, 3463) <= 60) {
    c.getFarming().updateHerbPatch();
    }
    if (c.distanceToPoint(2961, 3389) <= 60) {
    c.getPA().object(6552, 2961, 3389, -1, 10);
    }
    }


    /**
    * Creates the object for anyone who is within 60 squares of the object
    **/
    public void placeObject(Objects o) {
    for (Player p : Server.playerHandler.players){
    if(p != null) {
    Client person = (Client)p;
    if(person != null){
    if(person.heightLevel == o.getObjectHeight() && o.objectTicks == 0) {
    if (person.distanceToPoint(o.getObjectX(), o.getObjectY()) <= 60) {
    person.getPA().object(o.getObjectId(), o.getObjectX(), o.getObjectY(), o.getObjectFace(), o.getObjectType());
    }
    }
    }
    }
    }
    }

    public void process() {
    for (int j = 0; j < globalObjects.size(); j++) {
    if (globalObjects.get(j) != null) {
    Objects o = globalObjects.get(j);
    if(o.objectTicks > 0) {
    o.objectTicks--;
    }
    if (o.objectTicks == 1) {
    Objects deleteObject = objectExists(o.getObjectX(), o.getObjectY(), o.getObjectHeight());
    removeObject(deleteObject);
    o.objectTicks = 0;
    placeObject(o);
    removeObject(o);
    if (isObelisk(o.objectId)) {
    int index = getObeliskIndex(o.objectId);
    if (activated[index]) {
    activated[index] = false;
    teleportObelisk(index);
    }
    }
    }
    }

    }
    /*for(Objects o : globalObjects) {
    if(o.objectTicks > 0) {
    o.objectTicks--;
    }
    if(o.objectTicks == 1) {
    Objects deleteObject = objectExists(o.getObjectX(), o.getObjectY(), o.getObjectHeight());
    if(deleteObject != null) {
    removeObject(deleteObject);
    }
    o.objectTicks = 0;
    placeObject(o);
    removeObject(o);
    if (isObelisk(o.objectId)) {
    int index = getObeliskIndex(o.objectId);
    if (activated[index]) {
    activated[index] = false;
    teleportObelisk(index);
    }
    }
    break;
    }
    }*/
    }

    public boolean loadGlobalObjects(String fileName) {
    String line = "";
    String token = "";
    String token2 = "";
    String token2_2 = "";
    String[] token3 = new String[10];
    boolean EndOfFile = false;
    int ReadMode = 0;
    BufferedReader objectFile = null;
    try {
    objectFile = new BufferedReader(new FileReader("./"+fileName));
    } catch(FileNotFoundException fileex) {
    Misc.println(fileName+": file not found.");
    return false;
    }
    try {
    line = objectFile.readLine();
    } catch(IOException ioexception) {
    Misc.println(fileName+": error loading file.");
    return false;
    }
    while(EndOfFile == false && line != null) {
    line = line.trim();
    int spot = line.indexOf("=");
    if (spot > -1) {
    token = line.substring(0, spot);
    token = token.trim();
    token2 = line.substring(spot + 1);
    token2 = token2.trim();
    token2_2 = token2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token3 = token2_2.split("\t");
    if (token.equals("object")) {
    Objects object = new Objects(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), Integer.parseInt(token3[5]), 0);
    addObject(object);
    }
    } else {
    if (line.equals("[ENDOFOBJECTLIST]")) {
    try { objectFile.close(); } catch(IOException ioexception) { }
    return true;
    }
    }
    try {
    line = objectFile.readLine();
    } catch(IOException ioexception1) { EndOfFile = true; }
    }
    try { objectFile.close(); } catch(IOException ioexception) { }
    return false;
    }


    /**
    * Doors
    **/

    public static final int MAX_DOORS = 100;
    public static int[][] doors = new int[MAX_DOORS][5];
    public static int doorFace = 0;

    public void doorHandling(int doorId, int doorX, int doorY, int doorHeight) {
    for(int i = 0; i < doors.length; i++){
    if(doorX == doors[i][0] && doorY == doors[i][1] && doorHeight == doors[i][2]) {
    if(doors[i][4] == 0) {
    doorId++;
    } else {
    doorId--;
    }
    for (Player p : Server.playerHandler.players){
    if(p != null) {
    Client person = (Client)p;
    if(person != null){
    if(person.heightLevel == doorHeight) {
    if (person.distanceToPoint(doorX, doorY) <= 60) {
    person.getPA().object(-1, doors[i][0], doors[i][1], 0, 0);
    if(doors[i][3] == 0 && doors[i][4] == 1) {
    person.getPA().object(doorId, doors[i][0], doors[i][1]+1, -1, 0);
    } else if(doors[i][3] == -1 && doors[i][4] == 1) {
    person.getPA().object(doorId, doors[i][0]-1, doors[i][1], -2, 0);
    } else if(doors[i][3] == -2 && doors[i][4] == 1) {
    person.getPA().object(doorId, doors[i][0], doors[i][1]-1, -3, 0);
    } else if(doors[i][3] == -3 && doors[i][4] == 1) {
    person.getPA().object(doorId, doors[i][0]+1, doors[i][1], 0, 0);
    } else if(doors[i][3] == 0 && doors[i][4] == 0) {
    person.getPA().object(doorId, doors[i][0]-1, doors[i][1], -3, 0);
    } else if(doors[i][3] == -1 && doors[i][4] == 0) {
    person.getPA().object(doorId, doors[i][0], doors[i][1]-1, 0, 0);
    } else if(doors[i][3] == -2 && doors[i][4] == 0) {
    person.getPA().object(doorId, doors[i][0]+1, doors[i][1], -1, 0);
    } else if(doors[i][3] == -3 && doors[i][4] == 0) {
    person.getPA().object(doorId, doors[i][0], doors[i][1]+1, -2, 0);
    }
    }
    }
    }
    }
    }
    }
    }
    }

    public boolean loadDoorConfig(String fileName) {
    String line = "";
    String token = "";
    String token2 = "";
    String token2_2 = "";
    String[] token3 = new String[10];
    boolean EndOfFile = false;
    int ReadMode = 0;
    BufferedReader objectFile = null;
    try {
    objectFile = new BufferedReader(new FileReader("./"+fileName));
    } catch(FileNotFoundException fileex) {
    Misc.println(fileName+": file not found.");
    return false;
    }
    try {
    line = objectFile.readLine();
    } catch(IOException ioexception) {
    Misc.println(fileName+": error loading file.");
    return false;
    }
    int door = 0;
    while(EndOfFile == false && line != null) {
    line = line.trim();
    int spot = line.indexOf("=");
    if (spot > -1) {
    token = line.substring(0, spot);
    token = token.trim();
    token2 = line.substring(spot + 1);
    token2 = token2.trim();
    token2_2 = token2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token3 = token2_2.split("\t");
    if (token.equals("door")) {
    doors[door][0] = Integer.parseInt(token3[0]);
    doors[door][1] = Integer.parseInt(token3[1]);
    doors[door][2] = Integer.parseInt(token3[2]);
    doors[door][3] = Integer.parseInt(token3[3]);
    doors[door][4] = Integer.parseInt(token3[4]);
    door++;
    }
    } else {
    if (line.equals("[ENDOFDOORLIST]")) {
    try { objectFile.close(); } catch(IOException ioexception) { }
    return true;
    }
    }
    try {
    line = objectFile.readLine();
    } catch(IOException ioexception1) { EndOfFile = true; }
    }
    try { objectFile.close(); } catch(IOException ioexception) { }
    return false;
    }

    public final int IN_USE_ID = 14825;
    public boolean isObelisk(int id) {
    for (int j = 0; j < obeliskIds.length; j++) {
    if (obeliskIds[j] == id)
    return true;
    }
    return false;
    }
    public int[] obeliskIds = {14829,14830,111235,14828,14826,14831};
    public int[][] obeliskCoords = {{3154,3618},{3225,3665},{3033,3730},{3104,3792},{ 2978,3864},{3305,3914}};
    public boolean[] activated = {false,false,false,false,false,false};
    public void startObelisk(int obeliskId) {
    int index = getObeliskIndex(obeliskId);
    if (index >= 0) {
    if (!activated[index]) {
    activated[index] = true;
    Objects obby1 = new Objects(14825, obeliskCoords[index][0], obeliskCoords[index][1], 0, -1, 10, 0);
    Objects obby2 = new Objects(14825, obeliskCoords[index][0] + 4, obeliskCoords[index][1], 0, -1, 10, 0);
    Objects obby3 = new Objects(14825, obeliskCoords[index][0], obeliskCoords[index][1] + 4, 0, -1, 10, 0);
    Objects obby4 = new Objects(14825, obeliskCoords[index][0] + 4, obeliskCoords[index][1] + 4, 0, -1, 10, 0);
    addObject(obby1);
    addObject(obby2);
    addObject(obby3);
    addObject(obby4);
    Server.objectHandler.placeObject(obby1);
    Server.objectHandler.placeObject(obby2);
    Server.objectHandler.placeObject(obby3);
    Server.objectHandler.placeObject(obby4);
    Objects obby5 = new Objects(obeliskIds[index], obeliskCoords[index][0], obeliskCoords[index][1], 0, -1, 10, 10);
    Objects obby6 = new Objects(obeliskIds[index], obeliskCoords[index][0] + 4, obeliskCoords[index][1], 0, -1, 10, 10);
    Objects obby7 = new Objects(obeliskIds[index], obeliskCoords[index][0], obeliskCoords[index][1] + 4, 0, -1, 10, 10);
    Objects obby8 = new Objects(obeliskIds[index], obeliskCoords[index][0] + 4, obeliskCoords[index][1] + 4, 0, -1, 10, 10);
    addObject(obby5);
    addObject(obby6);
    addObject(obby7);
    addObject(obby8);
    }
    }
    }

    public int getObeliskIndex(int id) {
    for (int j = 0; j < obeliskIds.length; j++) {
    if (obeliskIds[j] == id)
    return j;
    }
    return -1;
    }

    public void teleportObelisk(int port) {
    int random = Misc.random(5);
    while (random == port) {
    random = Misc.random(5);
    }
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c = (Client)Server.playerHandler.players[j];
    if (c.goodDistance(c.getX(), c.getY(), obeliskCoords[port][0] + 2, obeliskCoords[port][1] + 2, 1)) {
    c.getPA().startTeleport2(obeliskCoords[random][0] + 2, obeliskCoords[random][1] + 2, 0);
    }
    }
    }
    }
    }
    Reply With Quote  
     

  6. #6  
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Arithium View Post
    Seems fine, could possibly be your object handler class causing the issue.
    can you check
    Reply With Quote  
     

  7. #7  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Cna you post a video of what is happening? I don't see anything that would cause a fire to cause the server to crash.
    Reply With Quote  
     

  8. #8  
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Arithium View Post
    Cna you post a video of what is happening? I don't see anything that would cause a fire to cause the server to crash.
    i cant but it just the fire jsut turns on and off and it drops ashes non stop and it never goes away
    Reply With Quote  
     

  9. #9  
    Registered Member ur mother's Avatar
    Join Date
    Jan 2012
    Posts
    532
    Thanks given
    26
    Thanks received
    5
    Rep Power
    11
    bump
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. fire making = server crash
    By Aymen in forum Help
    Replies: 4
    Last Post: 05-11-2012, 01:23 PM
  2. project insanity fire making help
    By dixienormus1 in forum Help
    Replies: 1
    Last Post: 06-17-2010, 07:00 PM
  3. Will this make glitches work?
    By Bridget7298 in forum Console
    Replies: 4
    Last Post: 04-29-2010, 11:32 AM
  4. Full Fire Making 100%
    By sarah101 in forum Tutorials
    Replies: 10
    Last Post: 05-04-2007, 12:03 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •