Thread: Loading worldmap.bin

Results 1 to 6 of 6
  1. #1 Loading worldmap.bin 
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    Base: Impact/Pi
    Problem: loading worldmap.bin
    Errors(Compiling Errors): arrayindex out of bound exeption.
    Other Information/Media(Pictures, etc):
    Code:
    [2011-03-21 15:37]: java.lang.ArrayIndexOutOfBoundsException: 17354
    [2011-03-21 15:37]:     at server.world.map.I.close(I.java:280)
    [2011-03-21 15:37]:     at server.world.map.I.I(I.java:27)
    [2011-03-21 15:37]:     at server.world.map.VirtualWorld.init(VirtualWorld.java:
    27)
    [2011-03-21 15:37]:     at server.Server.main(Server.java:139)
    Help is appreciated and will be rewarded.
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
     

  2. #2  
    Super Donator

    Tyluur's Avatar
    Join Date
    Jun 2010
    Posts
    4,021
    Thanks given
    1,362
    Thanks received
    1,277
    Rep Power
    682
    I'll give you on MSN.
    [Only registered and activated users can see links. ]

    Quote Originally Posted by Velocity View Post
    i'd love to get called in the middle of the night just to hear an indian voice whisper "the nulls are back friend, how i fix"
     

  3. #3  
    Rune-Server Affiliate
    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    3,909
    Thanks given
    1,491
    Thanks received
    1,942
    Rep Power
    4870
    I'll hit you up when I get home and show you for free, it's pretty simple. At school right now so can't do anything.
     

  4. #4  
    Registered Member
    MerzA's Avatar
    Join Date
    Jul 2008
    Age
    25
    Posts
    592
    Thanks given
    36
    Thanks received
    28
    Rep Power
    95
    Gravedigging this, I'm having the same problems.
     

  5. #5  
    🍕

    Linus's Avatar
    Join Date
    Dec 2008
    Age
    26
    Posts
    2,758
    Thanks given
    903
    Thanks received
    406
    Rep Power
    0
    package server.world;

    import java.io.RandomAccessFile;
    import java.nio.MappedByteBuffer;
    import java.nio.channels.FileChannel;

    public class WalkingHandler {

    public static final int WIDTH = 12000;
    public static final int HEIGHT = 9900;

    private final TiledMap map;

    private WalkingHandler() {
    this.map = new TiledMap(WIDTH, HEIGHT);
    }

    private static class SingletonContainer {
    private static final WalkingHandler SINGLETON = new WalkingHandler();
    }

    public static WalkingHandler getSingleton() {
    return SingletonContainer.SINGLETON;
    }

    public boolean traversable(int x, int y, int direction) {
    int flag = map.getFlag(x, y);
    //System.out.println(direction);
    if (direction == 0 && (flag == 1 || flag == 4 || flag == 6 || flag == 7 || flag == 9 || flag == 11 || flag == 13 || flag == 14)) {
    return false;
    } else if (direction == 4 && (flag == 1 || flag == 7 || flag == 15 || flag == 10 || flag == 11 || flag == 12 || flag == 14 || flag == 5)) {
    return false;
    } else if (direction == 8 && (flag == 1 || flag == 2 || flag == 3 || flag == 4 || flag == 5 || flag == 6 || flag == 7 || flag == 12)) {
    return false;
    } else if (direction == 12 && (flag == 1 || flag == 3 || flag == 6 || flag == 9 || flag == 10 || flag == 11 || flag == 12 || flag == 8)) {
    return false;
    } else if(flag > 0 && flag < 15) {
    return false;
    }
    return true;
    }

    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;
    }

    }

    }
    [Only registered and activated users can see links. ]
    Spoiler for sig too large:

    ╠╬╣
    ╦╦
    ╠╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╠╬╬╬╬╬╬╣
    ╚╩╩╩╩╩╩╝

    ╠╬╬╬╣

    Quote Originally Posted by Huey View Post
    I always applaud ppl that actually release shit. But okay me again and I'm negging your okaying ass. K homie?
    [Only registered and activated users can see links. ]
     

  6. #6  
    Banned
    Join Date
    Mar 2011
    Posts
    199
    Thanks given
    6
    Thanks received
    15
    Rep Power
    0
    *nvm
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Loading worldmap but the .bat closes
    By Mickt3 in forum Help
    Replies: 4
    Last Post: 11-14-2010, 06:40 PM
  2. 317 WorldMap
    By RevolutionPking in forum Tools
    Replies: 6
    Last Post: 06-13-2010, 04:49 PM
  3. Loading worldmap, need autorestarter
    By philby93 in forum Help
    Replies: 0
    Last Post: 02-18-2010, 01:37 PM
  4. RunServer Error[Loading WorldMap]
    By Arvid in forum Help
    Replies: 7
    Last Post: 04-19-2009, 09:38 PM
  5. Little WorldMap help
    By Rukin1 in forum Help
    Replies: 8
    Last Post: 03-29-2009, 10:04 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
  •