Implementing PKGNX..

Results 1 to 7 of 7
  1. #1
    Member JessVanity is offline
    MemberRank
    Jan 2014 Join Date
    61Posts

    Implementing PKGNX..

    Hello, so I`ve been wanting to implement and use NX files instead of my WZ, so I`ve been trying to get that to work. Lithium takes forever to load and I`m hoping this would help. Anyways my problem is that when I changed the .wz files in certain directories such as MapleLifeFactory.java, to .nx, I`ve been getting this error about:
    PHP Code:
    SERVERFailed to load UTF in buffer 
    Anyways here is the full error, and yes I have all the files implemented in the source, and the NX folder in my source.
    PHP Code:
    Clarity Research In Motion MapleStory Development
    Starting Server Instances
    ...Jan 272014 6:33:08 PM provider.pkgnx.util.Seekable
    LittleEndianAccessor getUTFString
    SEVERE
    Failed to load UTF String in buffer.
    java.nio.charset.MalformedInputExceptionInput length 1
            at java
    .nio.charset.CoderResult.throwException(Unknown Source)
            
    at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:277)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:265)
            
    at provider.pkgnx.format.NXTables.<init>(NXTables.java:65)
            
    at provider.pkgnx.NXFile.parse(NXFile.java:110)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:99)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:73)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:63)
            
    at provider.nx.NXDataProvider.<init>(NXDataProvider.java:19)
            
    at provider.MapleDataProviderFactory.getWZ(MapleDataProviderFactory.java
    :20)
            
    at provider.MapleDataProviderFactory.getDataProvider(MapleDataProviderFa
    ctory
    .java:63)
            
    at server.life.MapleLifeFactory.<clinit>(MapleLifeFactory.java:51)
            
    at server.Start.run_startup_configurations(Start.java:121)
            
    at server.Start.start(Start.java:178)
            
    at server.Start.main(Start.java:186)


    Jan 272014 6:33:08 PM provider.pkgnx.util.SeekableLittleEndianAccessor getUTFS
    tring
    SEVERE
    Failed to load UTF String in buffer.
    java.nio.charset.MalformedInputExceptionInput length 1
            at java
    .nio.charset.CoderResult.throwException(Unknown Source)
            
    at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:277)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:265)
            
    at provider.pkgnx.format.NXTables.<init>(NXTables.java:65)
            
    at provider.pkgnx.NXFile.parse(NXFile.java:110)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:99)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:73)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:63)
            
    at provider.nx.NXDataProvider.<init>(NXDataProvider.java:19)
            
    at provider.MapleDataProviderFactory.getWZ(MapleDataProviderFactory.java
    :20)
            
    at provider.MapleDataProviderFactory.getDataProvider(MapleDataProviderFa
    ctory
    .java:63)
            
    at server.life.MapleLifeFactory.<clinit>(MapleLifeFactory.java:51)
            
    at server.Start.run_startup_configurations(Start.java:121)
            
    at server.Start.start(Start.java:178)
            
    at server.Start.main(Start.java:186)


    Jan 272014 6:33:08 PM provider.pkgnx.util.SeekableLittleEndianAccessor getUTFS
    tring
    SEVERE
    Failed to load UTF String in buffer.
    java.nio.charset.MalformedInputExceptionInput length 1
            at java
    .nio.charset.CoderResult.throwException(Unknown Source)
            
    at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:277)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:265)
            
    at provider.pkgnx.format.NXTables.<init>(NXTables.java:65)
            
    at provider.pkgnx.NXFile.parse(NXFile.java:110)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:99)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:73)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:63)
            
    at provider.nx.NXDataProvider.<init>(NXDataProvider.java:19)
            
    at provider.MapleDataProviderFactory.getWZ(MapleDataProviderFactory.java
    :20)
            
    at provider.MapleDataProviderFactory.getDataProvider(MapleDataProviderFa
    ctory
    .java:63)
            
    at server.life.MapleLifeFactory.<clinit>(MapleLifeFactory.java:51)
            
    at server.Start.run_startup_configurations(Start.java:121)
            
    at server.Start.start(Start.java:178)
            
    at server.Start.main(Start.java:186)


    Jan 272014 6:33:08 PM provider.pkgnx.util.SeekableLittleEndianAccessor getUTFS
    tring
    SEVERE
    Failed to load UTF String in buffer.
    java.nio.charset.MalformedInputExceptionInput length 1
            at java
    .nio.charset.CoderResult.throwException(Unknown Source)
            
    at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:277)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:265)
            
    at provider.pkgnx.format.NXTables.<init>(NXTables.java:65)
            
    at provider.pkgnx.NXFile.parse(NXFile.java:110)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:99)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:73)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:63)
            
    at provider.nx.NXDataProvider.<init>(NXDataProvider.java:19)
            
    at provider.MapleDataProviderFactory.getWZ(MapleDataProviderFactory.java
    :20)
            
    at provider.MapleDataProviderFactory.getDataProvider(MapleDataProviderFa
    ctory
    .java:63)
            
    at server.life.MapleLifeFactory.<clinit>(MapleLifeFactory.java:51)
            
    at server.Start.run_startup_configurations(Start.java:121)
            
    at server.Start.start(Start.java:178)
            
    at server.Start.main(Start.java:186)


    Jan 272014 6:33:08 PM provider.pkgnx.util.SeekableLittleEndianAccessor getUTFS
    tring
    SEVERE
    Failed to load UTF String in buffer.
    java.nio.charset.MalformedInputExceptionInput length 1
            at java
    .nio.charset.CoderResult.throwException(Unknown Source)
            
    at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:277)
            
    at provider.pkgnx.util.SeekableLittleEndianAccessor.getUTFString(Seekabl
    eLittleEndianAccessor
    .java:265)
            
    at provider.pkgnx.format.NXTables.<init>(NXTables.java:65)
            
    at provider.pkgnx.NXFile.parse(NXFile.java:110)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:99)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:73)
            
    at provider.pkgnx.NXFile.<init>(NXFile.java:63)
            
    at provider.nx.NXDataProvider.<init>(NXDataProvider.java:19)
            
    at provider.MapleDataProviderFactory.getWZ(MapleDataProviderFactory.java
    :20)
            
    at provider.MapleDataProviderFactory.getDataProvider(MapleDataProviderFa
    ctory
    .java:63)
            
    at server.life.MapleLifeFactory.<clinit>(MapleLifeFactory.java:51)
            
    at server.Start.run_startup_configurations(Start.java:121)
            
    at server.Start.start(Start.java:178)
            
    at server.Start.main(Start.java:186)


    Login Server failed java.lang.NullPointerException
    Press any key to 
    continue . . . 
    I've added the usage of NX files for everything that to the instances that use WZ in start.java
    Thanks for the reading .

    Also here is my getUTFString() in SeekableLittleEndianAccessor:
    PHP Code:
        public String getUTFString(int length) {        try {
                
    byte[] data getBytes(length);
                return 
    utfDecoder.decode(ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN)).toString();
            } catch (
    CharacterCodingException e) {
                
    logger.error("Failed to load UTF String in buffer."e);
            }
            return 
    null;
        } 


  2. #2
    PeterRabbit retep998 is offline
    MemberRank
    Apr 2008 Join Date
    VanaLocation
    707Posts

    Re: Implementing PKGNX..

    Clearly there is an invalid utf-8 string in the NX file, which leads me to ask how you obtained the NX files.
    To be more helpful, can you print out the raw bytes in hex format when that error occurs?

    Your code is fine, its just the NX file itself which is slightly broken.

  3. #3
    Member JessVanity is offline
    MemberRank
    Jan 2014 Join Date
    61Posts

    Re: Implementing PKGNX..

    Well It was v145 converted files that a friend gave me. I'm not sure if anything of this version is released :O
    Also where do you want to me to inprint the the bytes?

  4. #4
    PeterRabbit retep998 is offline
    MemberRank
    Apr 2008 Join Date
    VanaLocation
    707Posts

    Re: Implementing PKGNX..

    Just print it out right in that catch thing, so when the error occurs it prints out the bytes.

  5. #5
    Member JessVanity is offline
    MemberRank
    Jan 2014 Join Date
    61Posts

    Re: Implementing PKGNX..

    I'm having trouble printing out bytes, since the function getUTF is in string.

    - - - Updated - - -

    I also tried to print toString() which didnt give any bytes.

  6. #6
    PeterRabbit retep998 is offline
    MemberRank
    Apr 2008 Join Date
    VanaLocation
    707Posts

    Re: Implementing PKGNX..

    I just added special code to NoLifeWzToNx to detect ansi strings which are not utf-8 compatible and automatically convert them to proper utf-8, which should fix your issue.
    You can convert the WZ files yourself using NoLifeWzToNx (prebuilt binary here: https://dl.dropboxusercontent.com/u/...NoLifeStory.7z)
    Or you can use my freshly converted GMS v145 NX files: https://mega.co.nz/#!pNtlXIqQ!JOJX_G...JQv13c7UHaQ540

  7. #7
    Member JessVanity is offline
    MemberRank
    Jan 2014 Join Date
    61Posts

    Re: Implementing PKGNX..

    Thanks, your version seems to be avoiding the previous error, but once I changed codes like these:
    PHP Code:
     final MapleDataProvider prov MapleDataProviderFactory.getDataProvider(new File(WZpath "/Etc.wz")); 
    From .wz to .nx, I get:
    PHP Code:
    Login Server failedjava.lang.NullPointerExpection 
    My start server reaches until here before it throws the error:
    PHP Code:
            MapleLifeFactory.loadQuestCounts();       
           
    MapleQuest.initQuests(); 
           
    MapleItemInformationProvider.getInstance().runEtc(); 
           
    MapleMonsterInformationProvider.getInstance().load(); 
    The only thing that was edited in those files should be changing the .wz to nx.



Advertisement