Thread: [VENCILLIO] Weird error?

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 [VENCILLIO] Weird error? 
    Registered Member Kelluke's Avatar
    Join Date
    Apr 2016
    Posts
    160
    Thanks given
    29
    Thanks received
    18
    Rep Power
    41
    So yesterday i was trying to pack a new data, but i didint use the main files, made a copy of a cache and a client, eventually failed to pack the data so i deleted the files i tried them on. But today I was trying to run my server with the original client ive been using and original source, and it throws this error to source.

    [SPOIL]Could not load blacklisted hosts.
    [2017-08-27 16:29:14] java.lang.NullPointerException
    [2017-08-27 16:29:14] at com.dark.core.cache.ByteStreamExt.readUnsignedWord (ByteStreamExt.java:24)
    [2017-08-27 16:29:14] at com.dark.core.cache.map.ObjectDef.loadConfig(Objec tDef.java:330)
    [2017-08-27 16:29:14] at com.dark.GameDataLoader$1.run(GameDataLoader.java: 93)
    [2017-08-27 16:29:14] java.io.FileNotFoundException: .\data\def\interface (The system cannot find the path specified)
    [2017-08-27 16:29:14] at java.io.FileInputStream.open0(Native Method)
    [2017-08-27 16:29:14] at java.io.FileInputStream.open(Unknown Source)
    [2017-08-27 16:29:14] at java.io.FileInputStream.<init>(Unknown Source)
    [2017-08-27 16:29:14] at com.dark.core.cache.map.RSInterface.unpack(RSInter face.java:6344)
    [2017-08-27 16:29:14] at com.dark.GameDataLoader.load(GameDataLoader.java:1 15)
    [2017-08-27 16:29:14] at com.dark.core.GameThread.startup(GameThread.java:6 9)
    [2017-08-27 16:29:14] at com.dark.core.GameThread.init(GameThread.java:34)
    [2017-08-27 16:29:14] at com.dark.Server.main(Server.java:105)
    [2017-08-27 16:29:14] java.lang.NullPointerException
    [2017-08-27 16:29:14] at com.dark.core.cache.map.RSInterface.unpack(RSInter face.java:6352)
    [2017-08-27 16:29:14] at com.dark.GameDataLoader.load(GameDataLoader.java:1 15)
    [2017-08-27 16:29:14] at com.dark.core.GameThread.startup(GameThread.java:6 9)
    [2017-08-27 16:29:14] at com.dark.core.GameThread.init(GameThread.java:34)
    [2017-08-27 16:29:14] at com.dark.Server.main(Server.java:105)[/SPOIL]


    I mean first of all I didint have any errors yesterday, neither it shows any left side of the eclipse (only shows error on running the server.) Second how come packing a data in a different folders can harm the source and third i eventually deleted the thing i did and moved into the source i used and it didint work anymore. I might sound stupid so i really looking forward to help, thanks.


    Problems it causes:

    *NPCs wont spawn (execpt minigame one ex. fight caves)
    *Wont compile anything
    *Eclipse wont run the server, only can do it with run.bat




    Spoiler for Objectdef.java lines 327-341:
    public static void loadConfig() {
    stream = new ByteStreamExt(getBuffer("loc.dat"));
    ByteStreamExt stream = new ByteStreamExt(getBuffer("loc.idx"));
    objects = stream.readUnsignedWord();
    streamIndices = new int[objects];
    int i = 2;
    for (int j = 0; j < objects; j++) {
    streamIndices[j] = i;
    i += stream.readUnsignedWord();
    }
    cache = new ObjectDef[20];
    for (int k = 0; k < 20; k++) {
    cache[k] = new ObjectDef();
    }
    logger.info(Utility.format(objects) + " Objects have been loaded successfully.");




    if any other lines is needed to post for help please make sure to tell me
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,253
    Thanks given
    1,145
    Thanks received
    909
    Rep Power
    2081
    Oh my Java diagnostics really do suck major ass, 'null' is just a fancy term of saying nothin, you referencing nothin, your trying to load nothing and it's having a hissy fit
    Reply With Quote  
     

  3. #3  
    Registered Member Kelluke's Avatar
    Join Date
    Apr 2016
    Posts
    160
    Thanks given
    29
    Thanks received
    18
    Rep Power
    41
    Quote Originally Posted by Fire Cape View Post
    Oh my Java diagnostics really do suck major ass, 'null' is just a fancy term of saying nothin, you referencing nothin, your trying to load nothing and it's having a hissy fit
    Any nonironical solutions to my problem?

    any1?
    Attached image
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    My first assumption would be that the resource you're providing to ByteStreamExt is non-existant. i.e; getBuffer("loc.XXX"). Make sure that file exists at its relative location.
    Reply With Quote  
     

  5. #5  
    Registered Member Kelluke's Avatar
    Join Date
    Apr 2016
    Posts
    160
    Thanks given
    29
    Thanks received
    18
    Rep Power
    41
    Quote Originally Posted by Jason View Post
    My first assumption would be that the resource you're providing to ByteStreamExt is non-existant. i.e; getBuffer("loc.XXX"). Make sure that file exists at its relative location.

    I really havent touched those files, before they worked fine and they seem to be in the right place



    Attached image
    Attached image
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    show method getBuffer
    Reply With Quote  
     

  7. #7  
    Registered Member Kelluke's Avatar
    Join Date
    Apr 2016
    Posts
    160
    Thanks given
    29
    Thanks received
    18
    Rep Power
    41
    Quote Originally Posted by Professor Oak View Post
    show method getBuffer

    obectdef.java
    [SPOIL] public static void loadConfig() {
    stream = new ByteStreamExt(getBuffer("loc.dat"));
    ByteStreamExt stream = new ByteStreamExt(getBuffer("loc.idx"));
    objects = stream.readUnsignedWord();
    streamIndices = new int[objects];
    int i = 2;
    for (int j = 0; j < objects; j++) {
    streamIndices[j] = i;
    i += stream.readUnsignedWord();
    }
    cache = new ObjectDef[20];
    for (int k = 0; k < 20; k++) {
    cache[k] = new ObjectDef();
    }
    logger.info(Utility.format(objects) + " Objects have been loaded successfully.");
    } [/SPOIL]




    streambuffer.java

    [SPOIL]
    public static final class InBuffer extends StreamBuffer {

    /**
    * The internal buffer.
    */
    private ChannelBuffer buffer;

    /**
    * Creates a new InBuffer.
    *
    * @param buffer
    * the buffer
    */
    private InBuffer(ChannelBuffer buffer) {
    this.buffer = buffer;
    }

    /**
    * Gets the internal buffer.
    *
    * @return the buffer
    */
    public ChannelBuffer getBuffer() {
    return buffer;
    }

    /**
    * Reads a standard signed byte.
    *
    * @return the value
    */
    public int readByte() {
    return readByte(true, ValueType.STANDARD);
    }

    /**
    * Reads a standard byte.
    *
    * @param signed
    * the signedness
    * @return the value
    */
    public int readByte(boolean signed) {
    return readByte(signed, ValueType.STANDARD);
    }

    /**
    * Reads a value as a byte.
    *
    * @param signed
    * the signedness
    * @param type
    * the value type
    * @return the value
    */
    public int readByte(boolean signed, ValueType type) {
    int value = buffer.readByte();
    switch (type) {
    case A:
    value = value - 128;
    break;
    case C:
    value = -value;
    break;
    case S:
    value = 128 - value;
    break;
    default:
    break;
    }
    return signed ? value : value & 0xff;
    }

    /**
    * Reads a signed byte.
    *
    * @param type
    * the value type
    * @return the value
    */
    public int readByte(ValueType type) {
    return readByte(true, type);
    }

    /**
    * Reads the amuont of bytes into the array, starting at the current
    * location.
    *
    * @param amount
    * the amount to read
    * @return a buffer filled with the data
    */
    public byte[] readBytes(int amount) {
    return readBytes(amount, ValueType.STANDARD);
    }

    /**
    * Reads the amount of bytes into a byte array, starting at the current
    * location.
    *
    * @param amount
    * the amount of bytes
    * @param type
    * the value type of each byte
    * @return a buffer filled with the data
    */
    public byte[] readBytes(int amount, ValueType type) {
    byte[] data = new byte[amount];
    for (int i = 0; i < amount; i++) {
    data[i] = (byte) readByte(type);
    }
    return data;
    }

    /**
    * Reads the amount of bytes from the buffer in reverse, starting at
    * current location + amount and reading in reverse until the current
    * location.
    *
    * @param amount
    * the amount of bytes
    * @param type
    * the value type of each byte
    * @return a buffer filled with the data
    */
    public byte[] readBytesReverse(int amount, ValueType type) {
    byte[] data = new byte[amount];
    int dataLocation = 0;
    for (int i = buffer.readerIndex() + amount - 1; i >= buffer.readerIndex(); i--) {
    int value = buffer.getByte(i);
    switch (type) {
    case A:
    value -= 128;
    break;
    case C:
    value = -value;
    break;
    case S:
    value = 128 - value;
    break;
    default:
    break;
    }
    data[dataLocation++] = (byte) value;
    }
    return data;
    }

    /**
    * Reads a signed standard big-endian integer.
    *
    * @return the value
    */
    public int readInt() {
    return (int) readInt(true, ValueType.STANDARD, ByteOrder.BIG);
    }

    /**
    * Reads a standard big-endian integer.
    *
    * @param signed
    * the signedness
    * @return the value
    */
    public long readInt(boolean signed) {
    return readInt(signed, ValueType.STANDARD, ByteOrder.BIG);
    }

    /**
    * Reads a standard integer.
    *
    * @param signed
    * the signedness
    * @param order
    * the byte order
    * @return the value
    */
    public long readInt(boolean signed, ByteOrder order) {
    return readInt(signed, ValueType.STANDARD, order);
    }

    /**
    * Reads a big-endian integer.
    *
    * @param signed
    * the signedness
    * @param type
    * the value type
    * @return the value
    */
    public long readInt(boolean signed, ValueType type) {
    return readInt(signed, type, ByteOrder.BIG);
    }

    /**
    * Reads an integer.
    *
    * @param signed
    * the signedness
    * @param type
    * the value type
    * @param order
    * the byte order
    * @return the value
    */
    public long readInt(boolean signed, ValueType type, ByteOrder order) {
    long value = 0;
    switch (order) {
    case BIG:
    value |= readByte(false) << 24;
    value |= readByte(false) << 16;
    value |= readByte(false) << 8;
    value |= readByte(false, type);
    break;
    case MIDDLE:
    value |= readByte(false) << 8;
    value |= readByte(false, type);
    value |= readByte(false) << 24;
    value |= readByte(false) << 16;
    break;
    case INVERSE_MIDDLE:
    value |= readByte(false) << 16;
    value |= readByte(false) << 24;
    value |= readByte(false, type);
    value |= readByte(false) << 8;
    break;
    case LITTLE:
    value |= readByte(false, type);
    value |= readByte(false) << 8;
    value |= readByte(false) << 16;
    value |= readByte(false) << 24;
    break;
    }
    return signed ? value : value & 0xffffffffL;
    }

    /**
    * Reads a signed standard integer.
    *
    * @param order
    * the byte order
    * @return the value
    */
    public int readInt(ByteOrder order) {
    return (int) readInt(true, ValueType.STANDARD, order);
    }

    /**
    * Reads a signed big-endian integer.
    *
    * @param type
    * the value type
    * @return the value
    */
    public int readInt(ValueType type) {
    return (int) readInt(true, type, ByteOrder.BIG);
    }

    /**
    * Reads a signed integer.
    *
    * @param type
    * the value type
    * @param order
    * the byte order
    * @return the value
    */
    public int readInt(ValueType type, ByteOrder order) {
    return (int) readInt(true, type, order);
    }

    /**
    * Reads a signed standard big-endian long.
    *
    * @return the value
    */
    public long readLong() {
    return readLong(ValueType.STANDARD, ByteOrder.BIG);
    }

    /**
    * Reads a signed standard long.
    *
    * @param order
    * the byte order
    * @return the value
    */
    public long readLong(ByteOrder order) {
    return readLong(ValueType.STANDARD, order);
    }

    /**
    * Reads a signed big-endian long
    *
    * @param type
    * the value type
    * @return the value
    */
    public long readLong(ValueType type) {
    return readLong(type, ByteOrder.BIG);
    }

    /**
    * Reads a signed long value.
    *
    * @param type
    * the value type
    * @param order
    * the byte order
    * @return the value
    */
    public long readLong(ValueType type, ByteOrder order) {
    long value = 0;
    switch (order) {
    case BIG:
    value |= (long) readByte(false) << 56L;
    value |= (long) readByte(false) << 48L;
    value |= (long) readByte(false) << 40L;
    value |= (long) readByte(false) << 32L;
    value |= (long) readByte(false) << 24L;
    value |= (long) readByte(false) << 16L;
    value |= (long) readByte(false) << 8L;
    value |= readByte(false, type);
    break;
    case MIDDLE:
    throw new UnsupportedOperationException("middle-endian long is not implemented!");
    case INVERSE_MIDDLE:
    throw new UnsupportedOperationException("inverse-middle-endian long is not implemented!");
    case LITTLE:
    value |= readByte(false, type);
    value |= (long) readByte(false) << 8L;
    value |= (long) readByte(false) << 16L;
    value |= (long) readByte(false) << 24L;
    value |= (long) readByte(false) << 32L;
    value |= (long) readByte(false) << 40L;
    value |= (long) readByte(false) << 48L;
    value |= (long) readByte(false) << 56L;
    break;
    }
    return value;
    }

    /**
    * Reads a standard signed big-endian short.
    *
    * @return the value
    */
    public int readShort() {
    return readShort(true, ValueType.STANDARD, ByteOrder.BIG);
    }

    /**
    * Reads a standard big-endian short.
    *
    * @param signed
    * the signedness
    * @return the value
    */
    public int readShort(boolean signed) {
    return readShort(signed, ValueType.STANDARD, ByteOrder.BIG);
    }

    /**
    * Reads a standard short.
    *
    * @param signed
    * the signedness
    * @param order
    * the byte order
    * @return the value
    */
    public int readShort(boolean signed, ByteOrder order) {
    return readShort(signed, ValueType.STANDARD, order);
    }

    /**
    * Reads a big-endian short.
    *
    * @param signed
    * the signedness
    * @param type
    * the value type
    * @return the value
    */
    public int readShort(boolean signed, ValueType type) {
    return readShort(signed, type, ByteOrder.BIG);
    }

    /**
    * Reads a short value.
    *
    * @param signed
    * the signedness
    * @param type
    * the value type
    * @param order
    * the byte order
    * @return the value
    */
    public int readShort(boolean signed, ValueType type, ByteOrder order) {
    int value = 0;
    switch (order) {
    case BIG:
    value |= readByte(false) << 8;
    value |= readByte(false, type);
    break;
    case MIDDLE:
    throw new UnsupportedOperationException("Middle-endian short is impossible!");
    case INVERSE_MIDDLE:
    throw new UnsupportedOperationException("Inverse-middle-endian short is impossible!");
    case LITTLE:
    value |= readByte(false, type);
    value |= readByte(false) << 8;
    break;
    }
    return signed ? value : value & 0xffff;
    }

    /**
    * Reads a signed standard short.
    *
    * @param order
    * the byte order
    * @return the value
    */
    public int readShort(ByteOrder order) {
    return readShort(true, ValueType.STANDARD, order);
    }

    /**
    * Reads a signed big-endian short.
    *
    * @param type
    * the value type
    * @return the value
    */
    public int readShort(ValueType type) {
    return readShort(true, type, ByteOrder.BIG);
    }

    /**
    * Reads a signed short.
    *
    * @param type
    * the value type
    * @param order
    * the byte order
    * @return the value
    */
    public int readShort(ValueType type, ByteOrder order) {
    return readShort(true, type, order);
    }

    /**
    * Reads a RuneScape string value.
    *
    * @return the string
    */
    public String readString() {
    byte temp;
    StringBuilder b = new StringBuilder();
    while ((temp = (byte) readByte()) != 10) {
    b.append((char) temp);
    }
    return b.toString();
    }

    public void reset() {
    buffer.readerIndex(0);
    }

    @Override
    void switchAccessType(AccessType type) {
    if (type == AccessType.BIT_ACCESS) {
    throw new UnsupportedOperationException("Reading bits is not implemented!");
    }
    }
    }

    /**
    * A StreamBuffer used to write outgoing data.
    *
    * @author blakeman8192
    */
    public static final class OutBuffer extends StreamBuffer {

    /**
    * The internal buffer.
    */
    private ChannelBuffer buffer;
    /**
    * The location of the packet length in the packet header.
    */
    private int lengthLocation = 0;

    /**
    * Creates a new OutBuffer.
    *
    * @param size
    * the size
    */
    private OutBuffer(int size) {
    buffer = ChannelBuffers.buffer(size);
    }

    /**
    * Finishes a variable packet header by writing the actual packet length
    * at the length byte's location. Call this when the construction of the
    * actual variable length packet is complete.
    */
    public void finishVariablePacketHeader() {
    buffer.setByte(lengthLocation, (byte) (buffer.writerIndex() - lengthLocation - 1));
    }

    /**
    * Finishes a variable packet header by writing the actual packet length
    * at the length short's location. Call this when the construction of
    * the variable length packet is complete.
    */
    public void finishVariableShortPacketHeader() {
    buffer.setShort(lengthLocation, (short) (buffer.writerIndex() - lengthLocation - 2));
    }

    /**
    * Gets the internal buffer.
    *
    * @return the buffer
    */
    public ChannelBuffer getBuffer() {
    return buffer;
    }
    } [/SPOIL]
    Attached image
    Reply With Quote  
     

  8. #8  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    Quote Originally Posted by Fire Cape View Post
    Oh my Java diagnostics really do suck major ass, 'null' is just a fancy term of saying nothin, you referencing nothin, your trying to load nothing and it's having a hissy fit
    Java diagnostics are beautiful; especially compared to languages w/o (some form of) reflection.
    Reply With Quote  
     

  9. #9  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by Kelluke View Post
    ......
    Lol, show the getBuffer method in ObjectDef, not in the stream class
    Reply With Quote  
     

  10. #10  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    ByteStreamExt stream = new ByteStreamExt(getBuffer("loc.idx"));
    getBuffer() returns a null most likely which causes the ByteStreamExt to become null as well; it's probably due to the loc.idx file not being in the correct directory.
    Attached image
    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. Weird Error
    By Typhoeus in forum Help
    Replies: 2
    Last Post: 03-12-2009, 04:58 AM
  2. A weird error on my 508
    By Koston in forum Help
    Replies: 2
    Last Post: 03-11-2009, 11:42 PM
  3. Weird error...
    By blacksh00t in forum Help
    Replies: 3
    Last Post: 02-21-2009, 09:18 PM
  4. Replies: 1
    Last Post: 01-21-2009, 03:34 PM
  5. Weird error!?
    By Oh my gawd in forum Requests
    Replies: 0
    Last Post: 01-15-2009, 06:00 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
  •