Originally Posted by
Mark_
source/data/cache/index#
source Are you sure you are in the client cache. [source/data] gives me the feeling you are in server
Yea, i'm using PI / Project insanity.
I was told that Project insanity has cache inside the source, which is fked up but when i think about it makes sence that i should try to do this inside my client instead.
When i look inside my client folder, there are no other than sprites to be found.
My main_file_cache.dat# files are only to be found inside my source/data/cache.
https://imgshare.io/image/pWmTRu
Edit: I found this post about server sided cache loading, https://www.rune-server.ee/runescape...e-loading.html
I should reverse & make it load from client side right?
This post here should work for me i think; https://www.rune-server.ee/runescape...directory.html
Heres my method
Code:
public static String findcachedir() {
String[] possibleFolders = {
"C:/", "D:", "E:",
"/tmp/", "/"
};
String subfolder = "CleanPICache/";
for(String folder : possibleFolders)
if(new File(folder).exists()) {
if(new File(folder + subfolder).exists()
|| new File(folder + subfolder).mkdirs())
return folder + subfolder;
}
return null;
}
Not sure what subfolder "CleanPICache is.. do i have 2 caches?I found CleanPICache inside "C:" drive.
I've tried to simply just move my cache over to the client part without doing anything with any code.
It gave me this error in eclipse: [09.06.2021, 00:00]: Launching fileserver..
[09.06.2021, 00:00]: java.lang.Exception: No index file(s) present
[09.06.2021, 00:00]: at RS2.jagcached.net.IndexedFileSystem.detectLayout(I ndexedFileSystem.java:83)
[09.06.2021, 00:00]: at RS2.jagcached.net.IndexedFileSystem.<init>(Indexed FileSystem.java:52)
[09.06.2021, 00:00]: at RS2.jagcached.dispatch.RequestWorkerPool.start(Req uestWorkerPool.java:57)
[09.06.2021, 00:00]: at RS2.fileserver.impl.FileServer.start(FileServer.ja va:56)
[09.06.2021, 00:00]: at RS2.GameEngine.main(GameEngine.java:139)
[09.06.2021, 00:00]: Took 197 milliseconds to launch.
(IndexedFileSystem.java:83)
Code:
private void detectLayout(File base) throws Exception {
int indexCount = 0;
for (int index = 0; index < indices.length; index++) {
File f = new File(base.getAbsolutePath() + "/main_file_cache.idx"
+ index);
if (f.exists() && !f.isDirectory()) {
indexCount++;
indices[index] = new RandomAccessFile(f, readOnly ? "r" : "rw");
}
}
if (indexCount <= 0) {
throw new Exception("No index file(s) present");
}
File oldEngineData = new File(base.getAbsolutePath()
+ "/main_file_cache.dat");
File newEngineData = new File(base.getAbsolutePath()
+ "/main_file_cache.dat2");
if (oldEngineData.exists() && !oldEngineData.isDirectory()) {
data = new RandomAccessFile(oldEngineData, readOnly ? "r" : "rw");
} else if (newEngineData.exists() && !oldEngineData.isDirectory()) {
data = new RandomAccessFile(newEngineData, readOnly ? "r" : "rw");
} else {
throw new Exception("No data file present");
}
}
(IndexedFileSystem.java:52)
Code:
public IndexedFileSystem(File base, boolean readOnly) throws Exception {
this.readOnly = readOnly;
detectLayout(base);
}
(RequestWorkerPool.java:57)
Code:
public void stop() {
for (RequestWorker<?> worker : workers) {
worker.stop();
}
(FileServer.java:56)
Code:
public void start() throws Exception {
pool.start();
start("ondemand", new OnDemandPipelineFactory(handler, timer),
NetworkConstants.SERVICE_PORT);
}
(GameEngine.java:139)
Code:
public static void main(java.lang.String args[])
throws NullPointerException, IOException {
long startTime = System.currentTimeMillis();
System.setOut(new Logger(System.out));
System.setErr(new Logger(System.err));
System.out.println("Launching fileserver..");
try {
new FileServer().start();
new RS2.fileserver.FileServer().bind();
} catch (Exception e) {
e.printStackTrace();
}
bind();
playerManager = PlayerManager.getSingleton();
playerManager.setupRegionPlayers();
stillGraphicsManager = new StillGraphicsManager();
/**
* Successfully loaded the server.
*/
long endTime = System.currentTimeMillis();
long elapsed = endTime - startTime;
System.out.println("Took " + elapsed + " milliseconds to launch.");
/**
* Main server tick.
*/
scheduler.schedule(new Task() {
@Override
protected void execute() {
itemHandler.process();
playerHandler.process();
npcHandler.process();
shopHandler.process();
objectManager.process();
}
});
}
I'm gonna try to break out the methodes & see if i can solve this, but i do appreciate if somebody has a suggestion to fix this