mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-01-19 08:36:27 +01:00
remember cached locations & stuff
This commit is contained in:
parent
7724dbea14
commit
0733de713a
Binary file not shown.
@ -31,6 +31,10 @@ public class WindowsHabboClient extends HabboClient {
|
|||||||
private static final int PRODUCTIONID = 4000;
|
private static final int PRODUCTIONID = 4000;
|
||||||
private String production = "";
|
private String production = "";
|
||||||
|
|
||||||
|
private String getOffsetsCacheKey() {
|
||||||
|
return production + "-RC4Offsets";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<byte[]> getRC4cached() {
|
public List<byte[]> getRC4cached() {
|
||||||
List<byte[]> result = new ArrayList<>();
|
List<byte[]> result = new ArrayList<>();
|
||||||
@ -50,7 +54,7 @@ public class WindowsHabboClient extends HabboClient {
|
|||||||
|
|
||||||
private ArrayList<String> readPossibleBytes(boolean useCache) throws IOException, URISyntaxException {
|
private ArrayList<String> readPossibleBytes(boolean useCache) throws IOException, URISyntaxException {
|
||||||
ProcessBuilder pb = null;
|
ProcessBuilder pb = null;
|
||||||
List<String> cachedOffsets = (List<String>) Cacher.get("RC4Offsets");
|
List<String> cachedOffsets = (List<String>) Cacher.get(getOffsetsCacheKey());
|
||||||
StringJoiner joiner = new StringJoiner(" ");
|
StringJoiner joiner = new StringJoiner(" ");
|
||||||
|
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
@ -75,19 +79,24 @@ public class WindowsHabboClient extends HabboClient {
|
|||||||
String line;
|
String line;
|
||||||
ArrayList<String> possibleData = new ArrayList<>();
|
ArrayList<String> possibleData = new ArrayList<>();
|
||||||
|
|
||||||
|
if (cachedOffsets == null) {
|
||||||
cachedOffsets = new ArrayList<>();
|
cachedOffsets = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while((line = reader.readLine()) != null) {
|
while((line = reader.readLine()) != null) {
|
||||||
if (line.length() > 1) {
|
if (line.length() > 1) {
|
||||||
if (!useCache && (count++ % 2 == 0)) {
|
if (!useCache && (count++ % 2 == 0)) {
|
||||||
|
if (!cachedOffsets.contains(line)) {
|
||||||
cachedOffsets.add(line);
|
cachedOffsets.add(line);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
possibleData.add(line);
|
possibleData.add(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Cacher.put("RC4Offsets", cachedOffsets);
|
Cacher.put(getOffsetsCacheKey(), cachedOffsets);
|
||||||
p.destroy();
|
p.destroy();
|
||||||
return possibleData;
|
return possibleData;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user