|
|
@ -26,8 +26,7 @@ public enum MapLoader { |
|
|
|
long timeToLoad = System.currentTimeMillis(); |
|
|
|
long timeToLoad = System.currentTimeMillis(); |
|
|
|
long bytesRead = 0; |
|
|
|
long bytesRead = 0; |
|
|
|
long realmsWritten = 0; |
|
|
|
long realmsWritten = 0; |
|
|
|
|
|
|
|
int realmUUID; |
|
|
|
Integer realmUUID = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load image from disk
|
|
|
|
// Load image from disk
|
|
|
|
|
|
|
|
|
|
|
@ -54,20 +53,14 @@ public enum MapLoader { |
|
|
|
try { |
|
|
|
try { |
|
|
|
int rgb = image.getRGB(j, i); |
|
|
|
int rgb = image.getRGB(j, i); |
|
|
|
realmUUID = RealmMap.getRealmIDByRGB(rgb); |
|
|
|
realmUUID = RealmMap.getRealmIDByRGB(rgb); |
|
|
|
|
|
|
|
|
|
|
|
if (realmUUID == null) { |
|
|
|
|
|
|
|
Logger.error("Corrupted png: unknown color " + rgb); |
|
|
|
|
|
|
|
WorldServer.shutdown(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
realmMap[j][i] = realmUUID.intValue(); |
|
|
|
realmMap[j][i] = realmUUID; |
|
|
|
bytesRead++; |
|
|
|
bytesRead++; |
|
|
|
|
|
|
|
|
|
|
|
if (realmUUID.intValue() != 0) |
|
|
|
if (realmUUID != 0) |
|
|
|
realmsWritten++; |
|
|
|
realmsWritten++; |
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
}catch (Exception e){ |
|
|
|
// Logger.error("REALMEDIT ERROR", e.getMessage());
|
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -76,9 +69,7 @@ public enum MapLoader { |
|
|
|
} |
|
|
|
} |
|
|
|
timeToLoad = System.currentTimeMillis() - timeToLoad; |
|
|
|
timeToLoad = System.currentTimeMillis() - timeToLoad; |
|
|
|
|
|
|
|
|
|
|
|
Logger.info( bytesRead + " pixels processed in " + timeToLoad / 1000 + " seconds"); |
|
|
|
Logger.info( bytesRead + "Realm imageMNap pixels processed in " + timeToLoad / 1000 + " seconds"); |
|
|
|
Logger.info("Realm pixels written : " + realmsWritten); |
|
|
|
|
|
|
|
image = null; |
|
|
|
|
|
|
|
return realmMap; |
|
|
|
return realmMap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|