Hello everyone im newer to mopar, im pretty active on rune-server. but ive ran into an issue on my server. well when i first started the project the original coder had added customs that were not fully finished and spawning these items would force crash the client. well i ended up just deleting all items that crashed it. well now im further along in my process i have added the models (which i used galkons cache packing tutorial on, it stated succesfully packed the items) and ints into itemdef. now when i attempt to spawn them i get my client crash still. as well as npcs are messed up i was just curious if someone a bit more advanced could take a look and just tell me what im missing.
Item issues
I would assume when your client crashes, it prints some form of a stack trace.
Do you happen to have a copy of that?
Also: Try loading the models without using galkons index repacking. Load em using the /raw/ or /models/ folder in your cache (Preloading).
If it works via preloading, then your cache is corrupt and the models you packed in didn’t actually get packed.
[quote=“sk8rdude461, post:2, topic:554199”]I would assume when your client crashes, it prints some form of a stack trace.
Do you happen to have a copy of that?
Also: Try loading the models without using galkons index repacking. Load em using the /raw/ or /models/ folder in your cache (Preloading).
If it works via preloading, then your cache is corrupt and the models you packed in didn’t actually get packed.[/quote]
yes it does print an error code, and it has no raw or models folder so i just wanted to follow the old method of galkons. the error code is this
[spoiler]Exception in thread “Thread-3” java.lang.RuntimeException: error unzipping
at OnDemandFetcher.getNextNode(OnDemandFetcher.java:390)
at client.processOnDemandQueue(client.java:3464)
at client.processGameLoop(client.java:3051)
at RSApplet.run(RSApplet.java:183)
at client.run(client.java:5350)
at java.lang.Thread.run(Unknown Source)[/spoiler]
[quote=“jacobey101, post:3, topic:554199”][quote author=sk8rdude461 link=topic=673123.msg4501302#msg4501302 date=1451002023]
I would assume when your client crashes, it prints some form of a stack trace.
Do you happen to have a copy of that?
Also: Try loading the models without using galkons index repacking. Load em using the /raw/ or /models/ folder in your cache (Preloading).
If it works via preloading, then your cache is corrupt and the models you packed in didn’t actually get packed.
[/quote]
yes it does print an error code, and it has no raw or models folder so i just wanted to follow the old method of galkons. the error code is this
[spoiler]Exception in thread “Thread-3” java.lang.RuntimeException: error unzipping
at OnDemandFetcher.getNextNode(OnDemandFetcher.java:390)
at client.processOnDemandQueue(client.java:3464)
at client.processGameLoop(client.java:3051)
at RSApplet.run(RSApplet.java:183)
at client.run(client.java:5350)
at java.lang.Thread.run(Unknown Source)[/spoiler][/quote]
The error seems related to it trying to load the models.
Look in the client class to see if there is a preloadModel method, or something similar.
You can look for “/Raw/”, “/models/” too (no quotes).
[quote=“sk8rdude461, post:4, topic:554199”][quote author=jacobey101 link=topic=673123.msg4501313#msg4501313 date=1451013778]
yes it does print an error code, and it has no raw or models folder so i just wanted to follow the old method of galkons. the error code is this
[spoiler]Exception in thread “Thread-3” java.lang.RuntimeException: error unzipping
at OnDemandFetcher.getNextNode(OnDemandFetcher.java:390)
at client.processOnDemandQueue(client.java:3464)
at client.processGameLoop(client.java:3051)
at RSApplet.run(RSApplet.java:183)
at client.run(client.java:5350)
at java.lang.Thread.run(Unknown Source)[/spoiler]
[/quote]
The error seems related to it trying to load the models.
Look in the client class to see if there is a preloadModel method, or something similar.
You can look for “/Raw/”, “/models/” too (no quotes).[/quote]
[spoiler] public void cachePackModels() {
for (int ModelIndex = 0; ModelIndex <= 100000; ModelIndex++) {
byte[] abyte0 = getModelsToPack(ModelIndex);
if (abyte0 != null && abyte0.length > 0) {
decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
System.out.println(“Model ID: " + ModelIndex + " has been added to the cache”);
}
}
}
public byte[] getModelsToPack(int index) {
try {
File model = new File("Models/" + index + ".gz");
byte[] aByte = new byte[(int) model.length()];
FileInputStream Fis = new FileInputStream(model);
Fis.read(aByte);
Fis.close();
return aByte;
} catch (Exception e) {
return null;
}
}
[/spoiler]
id like to say thank you for responding, this is what i have found within client.java. i do appreciate your help and time
[spoiler]public byte[] getModel2(int Index) {
try {
File Model = new File(signlink.findcachedir() + “/Raw/”+Index+".dat");
byte[] aByte = new byte[(int)Model.length()];
FileInputStream fis = new FileInputStream(Model);
fis.read(aByte);
pushMessage(“aByte = [”+aByte+"]!", 0, “”);
fis.close();
return aByte;
}
catch(Exception e)
{return null;}
}[/spoiler]
[spoiler] public byte[] getModel(int Index) {
try {
File Model = new File(signlink.findcachedir() + “/model/”+Index+".gz");
byte[] aByte = new byte[(int)Model.length()];
FileInputStream fis = new FileInputStream(Model);
fis.read(aByte);
pushMessage(“aByte = [”+aByte+"]!", 0, “”);
fis.close();
return aByte;
}
catch(Exception e)
{return null;}
}[/spoiler]
Those look like they’re supposed to pack the model into the cache, much like using galkons method.
I was looking for something a bit more like this:
public void preloadModels() {
File file = new File(signlink.findcachedir() + "Raw/");
File[] fileArray = file.listFiles();
for (int y = 0; y < fileArray.length; y++) {
String s = fileArray[y].getName();
byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(s)));
}
}
And then this goes into the startUp() method (I’d place it around “Unpacking Models” if you have that in the startup)
preloadModels();
Don’t forget the models go into /YourCacheFolder/Raw/ and need to be .dat files.
[quote=“sk8rdude461, post:6, topic:554199”]Those look like they’re supposed to pack the model into the cache, much like using galkons method.
I was looking for something a bit more like this:
public void preloadModels() {
File file = new File(signlink.findcachedir() + "Raw/");
File[] fileArray = file.listFiles();
for (int y = 0; y < fileArray.length; y++) {
String s = fileArray[y].getName();
byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(s)));
}
}
And then this goes into the startUp() method (I’d place it around “Unpacking Models” if you have that in the startup)
preloadModels();
Don’t forget the models go into /YourCacheFolder/Raw/ and need to be .dat files.[/quote]
Hey id like to thank you one last time and so you suggest adding those in. and add the preload models in start up and just add the raw folder with the models inside the cache? as well as should i create a command in client side, to like say ::addmodel ****??
[quote=“jacobey101, post:7, topic:554199”][quote author=sk8rdude461 link=topic=673123.msg4501347#msg4501347 date=1451070163]
Those look like they’re supposed to pack the model into the cache, much like using galkons method.
I was looking for something a bit more like this:
public void preloadModels() {
File file = new File(signlink.findcachedir() + "Raw/");
File[] fileArray = file.listFiles();
for (int y = 0; y < fileArray.length; y++) {
String s = fileArray[y].getName();
byte[] buffer = ReadFile(signlink.findcachedir() + "Raw/" + s);
Model.method460(buffer, Integer.parseInt(getFileNameWithoutExtension(s)));
}
}
And then this goes into the startUp() method (I’d place it around “Unpacking Models” if you have that in the startup)
preloadModels();
Don’t forget the models go into /YourCacheFolder/Raw/ and need to be .dat files.
[/quote]
Hey id like to thank you one last time and so you suggest adding those in. and add the preload models in start up and just add the raw folder with the models inside the cache? as well as should i create a command in client side, to like say ::addmodel ****??[/quote]
Correct, you should add them as a test. The /Raw/ folder will have all your models in .dat format, and does indeed go in your cache.
You don’t need to create a command, as the models are loaded in the startUp method, when you call preloadModels().
[quote=“sk8rdude461, post:8, topic:554199”][quote author=jacobey101 link=topic=673123.msg4501370#msg4501370 date=1451089072]
Hey id like to thank you one last time and so you suggest adding those in. and add the preload models in start up and just add the raw folder with the models inside the cache? as well as should i create a command in client side, to like say ::addmodel ****??
[/quote]
Correct, you should add them as a test. The /Raw/ folder will have all your models in .dat format, and does indeed go in your cache.
You don’t need to create a command, as the models are loaded in the startUp method, when you call preloadModels().[/quote]
Worked like a charm i am very thankful, i couldnt get any help from rune-server so this was sort of a last resort type thing. Thanks Sk8rdude461 you are a life saver!