Thread: PI-Error that shuts server down every so often

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 PI-Error that shuts server down every so often 
    Banned
    Join Date
    Oct 2011
    Posts
    416
    Thanks given
    3
    Thanks received
    4
    Rep Power
    0
    Hello anyone help me with this error please. i will rep++.

    [1/15/12 2:11 AM]: java.lang.ArrayIndexOutOfBoundsException: -1
    [1/15/12 2:11 AM]: at server.world.WalkingHandler$TiledMap.getFlag(Walki ngH
    andler.java:67)
    [1/15/12 2:11 AM]: at server.world.WalkingHandler.traversable(WalkingHan dle
    r.java:27)
    [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextWalkingDirection(NPC. jav
    a:233)
    [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextNPCMovement(NPC.java: 244
    )
    [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandl er.
    java:2810)
    [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.process(NPCHandler.ja va:
    1857)
    [1/15/12 2:11 AM]: at server.Server.main(Server.java:200)
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    Post the line that the error is on then?
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Oct 2011
    Posts
    416
    Thanks given
    3
    Thanks received
    4
    Rep Power
    0
    i dont even understand where the error is mate thats what im saying
    Reply With Quote  
     

  4. #4  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    422
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    You must have followed that NPC/player clipping tutorial...

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

  5. #5  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Code:
    [1/15/12 2:11 AM]: java.lang.ArrayIndexOutOfBoundsException: -1
    [1/15/12 2:11 AM]: at server.world.WalkingHandler$TiledMap.getFlag(Walki ngH
    andler.java:67)
    [1/15/12 2:11 AM]: at server.world.WalkingHandler.traversable(WalkingHan dle
    r.java:27)
    [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextWalkingDirection(NPC. jav
    a:233)
    [1/15/12 2:11 AM]: at server.model.npcs.NPC.getNextNPCMovement(NPC.java: 244
    )
    [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.followPlayer(NPCHandl er.
    java:2810)
    [1/15/12 2:11 AM]: at server.model.npcs.NPCHandler.process(NPCHandler.ja va:
    1857)
    [1/15/12 2:11 AM]: at server.Server.main(Server.java:200)
    Marked in red is where the problem is at post it pls?


    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Oct 2011
    Posts
    416
    Thanks given
    3
    Thanks received
    4
    Rep Power
    0
    here you go sorry
    public void initialize() throws Exception {
    long delta = System.currentTimeMillis();
    RandomAccessFile raf = new RandomAccessFile("data/lolmap.bin", "r");
    FileChannel channel = raf.getChannel();
    MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
    int length = buffer.getInt();
    for(int i = 0; i < length; i++) {
    int x = buffer.getShort();
    int y = buffer.getShort();
    byte flag = buffer.get();
    map.flag(x, y, flag);
    }
    System.out.println("Loaded clipmap in " + (System.currentTimeMillis() - delta) + "ms.");
    }

    private static class TiledMap {

    private final byte[] plane;

    public TiledMap(int width, int height) {
    this.plane = new byte[width * 10000 + height];
    }

    public int getFlag(int x, int y) {
    return plane[x * 10000 + y];
    }

    public void flag(int x, int y, byte flag) {
    this.plane[x * 10000 + y] = flag;
    }

    }

    }
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    Quote Originally Posted by garrydowling2011 View Post
    here you go sorry
    Highlight the line it is so we know what it is aswell?
    Were getting there... lol
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Oct 2011
    Posts
    416
    Thanks given
    3
    Thanks received
    4
    Rep Power
    0
    Quote Originally Posted by Faris View Post
    Highlight the line it is so we know what it is aswell?
    Were getting there... lol
    there you go sorry im fairly new haha i will learn you watch me lol thanks for this help guys!
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    Quote Originally Posted by garrydowling2011 View Post
    there you go sorry im fairly new haha i will learn you watch me lol thanks for this help guys!
    No probs
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    So have you like, tryed to add castle wars or something? Can you tell me what that is for ?
    Code:
    public int getFlag(int x, int y) {
    return plane[x * 10000 + y];
    }
    Reply With Quote  
     

Page 1 of 3 123 LastLast

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. [PI]Error shuts server
    By kopjekoffiee in forum Help
    Replies: 9
    Last Post: 02-04-2011, 04:18 PM
  2. Error Shuts Down Server
    By flyfot in forum Help
    Replies: 3
    Last Post: 01-26-2011, 12:29 AM
  3. [PI] Shuts down after about 10 minutes?
    By NathanCoder in forum Help
    Replies: 3
    Last Post: 11-09-2010, 12:10 PM
  4. Client shuts down[HELP!!!]
    By nascarnate in forum Help
    Replies: 5
    Last Post: 02-07-2009, 03:59 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •