Move isOverlayOutdated to IndexDatabase
Instead of creating new callback and then simply setting boolean on RuneLite to dump it somewhere, expose this boolean from IndexDatabase and remove injection of RuneLite. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -32,8 +32,8 @@ import com.google.common.io.CharStreams;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import net.runelite.api.hooks.Callbacks;
|
||||
import net.runelite.api.mixins.Copy;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Replace;
|
||||
import net.runelite.api.mixins.Shadow;
|
||||
@@ -49,6 +49,16 @@ public abstract class RSIndexDataBaseMixin implements RSIndexDataBase
|
||||
@Shadow("clientInstance")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private boolean overlayOutdated;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public boolean isOverlayOutdated()
|
||||
{
|
||||
return overlayOutdated;
|
||||
}
|
||||
|
||||
@Copy("getConfigData")
|
||||
abstract byte[] rs$getConfigData(int archiveId, int fileId);
|
||||
|
||||
@@ -117,9 +127,7 @@ public abstract class RSIndexDataBaseMixin implements RSIndexDataBase
|
||||
|
||||
log.warn("Mismatch in overlaid cache archive hash for {}/{}: {} != {}",
|
||||
indexData.getIndex(), archiveId, replaceHash, rsHash);
|
||||
|
||||
Callbacks callbacks = client.getCallbacks();
|
||||
callbacks.overlayLoadFailed(this, archiveId, fileId);
|
||||
overlayOutdated = true;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user