Hi,

I apologise in advance for the length of this post. I don't usually ask for help, but I'm at a loose end.

I left the Rune-Server community many years ago and all of a sudden, I thought it would be a good idea to code an RSPS. (Lots have changed )

I decided to start with the client and decided I would start from fresh, so I download MiTB Non-Renamed 317 client from [Only registered and activated users can see links. ]. Edit: I should have mentioned I'm using the 317 cache from [Only registered and activated users can see links. ].

I then followed [Only registered and activated users can see links. ] tutorial and downloaded the 474 data from [Only registered and activated users can see links. ].

I copied the item models into 'index1' within the cache and ran the client. The models were repacked successfully.

I commented out 'repackCacheIndex(1);' within the 'startup()' method and compiled.

I then ran Tom's Cache Suite, replaced 'obj.dat' and 'obj.idx', repacked the archive and rebuilt the cache.

I attempted to run the client and it got stuck at 'Loading Models - 86%'.

I backed up 'OnDemandFetcher.java' and followed [Only registered and activated users can see links. ].

Compiled and ran the client and it got stuck at 'Loading Models - 66%'.

I then found [Only registered and activated users can see links. ] thread which was the same problem as I was having. So I followed the suggestion by Streax.

Compiled and ran but the client still got stuck at 'Loading Models - 66%'.

I then reverted back to the backed up 'OnDemandFetcher.java'.

I followed Natsu's [Only registered and activated users can see links. ] tutorial.

Compiled and ran the client. WOAH! No errors!

I logged into the Server and got the following error:

Code:
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: 13652.
So I extended the total items in ItemDef.java.

Compiled and ran the client. Then when I logged in I got this error:

Code:
Exception in thread "Thread-3" java.lang.NullPointerException
        at OnDemandFetcher.getVersionCount(OnDemandFetcher.java:180)
        at client.method22(client.java:606)
        at client.method54(client.java:2498)
        at client.loadingStages(client.java:2448)
        at client.mainGameProcessor(client.java:2890)
        at client.processGameLoop(client.java:1965)
        at RSApplet.run(RSApplet.java:109)
        at client.run(client.java:4317)
        at java.lang.Thread.run(Unknown Source)
So I went to Line 606 in 'client.java' and found the following:

Code:
        if(lowMem && signlink.cache_dat != null)
        {
            int j = onDemandFetcher.getVersionCount(0); //This is Line 606
            for(int i1 = 0; i1 < j; i1++)
            {
                int l1 = onDemandFetcher.getModelIndex(i1);
                if((l1 & 0x79) == 0)
                    Model.method461(i1);
            }

        }
I thought I could bypass this by running the client in highmem.

SUCCESS! I logged into the Server and the models had loaded successfully! HOWEVER..

There's no Animations loading what-so-ever? When I walk, I'm just a plank.

I looked back through the tutorials and noticed we commented out the following:

Code:
            /*drawLoadingText(65, "Requesting animations");
            int k = onDemandFetcher.getVersionCount(1);
            for(int i1 = 0; i1 < k; i1++)
                onDemandFetcher.method558(1, i1);

            while(onDemandFetcher.getNodeCount() > 0)
            {
                int j1 = k - onDemandFetcher.getNodeCount();
                if(j1 > 0)
                    drawLoadingText(65, "Loading animations - " + (j1 * 100) / k + "%");
                processOnDemandQueue();
                try
                {
                    Thread.sleep(100L);
                }
                catch(Exception _ex) { }
                if(onDemandFetcher.anInt1349 > 3)
                {
                    loadError();
                    return;
                }
            }
            drawLoadingText(70, "Requesting models");
            k = onDemandFetcher.getVersionCount(0);
            for(int k1 = 0; k1 < k; k1++)
            {
                int l1 = onDemandFetcher.getModelIndex(k1);
                if((l1 & 1) != 0)
                    onDemandFetcher.method558(0, k1);
            }

            k = onDemandFetcher.getNodeCount();
            while(onDemandFetcher.getNodeCount() > 0)
            {
                int i2 = k - onDemandFetcher.getNodeCount();
                if(i2 > 0)
                    drawLoadingText(70, "Loading models - " + (i2 * 100) / k + "%");
                processOnDemandQueue();
                try
                {
                    Thread.sleep(100L);
                }
                catch(Exception _ex) { }
            }
            if(decompressors[0] != null)
            {
                drawLoadingText(75, "Requesting maps");
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
                onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
                onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
                k = onDemandFetcher.getNodeCount();
                while(onDemandFetcher.getNodeCount() > 0)
                {
                    int j2 = k - onDemandFetcher.getNodeCount();
                    if(j2 > 0)
                        drawLoadingText(75, "Loading maps - " + (j2 * 100) / k + "%");
                    processOnDemandQueue();
                    try
                    {
                        Thread.sleep(100L);
                    }
                    catch(Exception _ex) { }
                }
            }
            k = onDemandFetcher.getVersionCount(0);
            for(int k2 = 0; k2 < k; k2++)
            {
                int l2 = onDemandFetcher.getModelIndex(k2);
                byte byte0 = 0;
                if((l2 & 8) != 0)
                    byte0 = 10;
                else
                if((l2 & 0x20) != 0)
                    byte0 = 9;
                else
                if((l2 & 0x10) != 0)
                    byte0 = 8;
                else
                if((l2 & 0x40) != 0)
                    byte0 = 7;
                else
                if((l2 & 0x80) != 0)
                    byte0 = 6;
                else
                if((l2 & 2) != 0)
                    byte0 = 5;
                else
                if((l2 & 4) != 0)
                    byte0 = 4;
                if((l2 & 1) != 0)
                    byte0 = 3;
                if(byte0 != 0)
                    onDemandFetcher.method563(byte0, 0, k2);
            }

            onDemandFetcher.method554(isMembers);
            if(!lowMem)
            {
                int l = onDemandFetcher.getVersionCount(2);
                for(int i3 = 1; i3 < l; i3++)
                    if(onDemandFetcher.method569(i3))
                        onDemandFetcher.method563((byte)1, 2, i3);

            }*/
So, I uncommented it out, compiled and ran the client but I got the black error screen with yellow text.

In the console I got the following error:

Code:
java.lang.NullPointerException
        at OnDemandFetcher.getVersionCount(OnDemandFetcher.java:180)
        at client.startUp(client.java:6765)
        at RSApplet.run(RSApplet.java:41)
        at client.run(client.java:4317)
        at java.lang.Thread.run(Unknown Source)
Error: loaderror Requesting animations 65
Should I have uncommented that section out? If I shouldn't have, how do I get the animations to load?

Any help would be much appreciated.

Thanks,
Luke