idk changes so I can show OLEGSHA
-changed number of index bytes from 4 to 3 -exposed some variables for help with debugger
This commit is contained in:
parent
254faca0a5
commit
8bc23acb61
@ -122,12 +122,17 @@ public class TestWorldDiskIO {
|
|||||||
regionSize = new Vec3i(16);
|
regionSize = new Vec3i(16);
|
||||||
chunksPerRegion = 16 * 16 * 16;
|
chunksPerRegion = 16 * 16 * 16;
|
||||||
currentFormat = 65536;
|
currentFormat = 65536;
|
||||||
offsetBytes = 4;
|
offsetBytes = 3;
|
||||||
extension = ".progressia_region";
|
extension = ".progressia_region";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void expand(int sectors)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static void saveChunk(ChunkData chunk, Server server) {
|
public static void saveChunk(ChunkData chunk, Server server) {
|
||||||
if (!ENABLE)
|
if (!ENABLE)
|
||||||
return;
|
return;
|
||||||
@ -219,6 +224,7 @@ public class TestWorldDiskIO {
|
|||||||
//LOG.debug(output.read());
|
//LOG.debug(output.read());
|
||||||
if (output.read()<0)
|
if (output.read()<0)
|
||||||
{
|
{
|
||||||
|
LOG.info("Making header");
|
||||||
output.writeChars("\0".repeat((offsetBytes+1)*chunksPerRegion));
|
output.writeChars("\0".repeat((offsetBytes+1)*chunksPerRegion));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,17 +233,19 @@ public class TestWorldDiskIO {
|
|||||||
int fullOffset = (offsetBytes+1)*(chunksPerRegion);
|
int fullOffset = (offsetBytes+1)*(chunksPerRegion);
|
||||||
output.seek(shortOffset);
|
output.seek(shortOffset);
|
||||||
int offset = output.readInt();
|
int offset = output.readInt();
|
||||||
int sectorLength = output.read();
|
int sectorLength = offset&255;
|
||||||
|
offset = offset >> 8;
|
||||||
if (sectorLength == 0)
|
if (sectorLength == 0)
|
||||||
{
|
{
|
||||||
offset = (int) (output.length()-fullOffset)/sectorSize;
|
int outputLen = (int) output.length();
|
||||||
|
offset = (int) (outputLen-fullOffset)/sectorSize;
|
||||||
output.seek(shortOffset);
|
output.seek(shortOffset);
|
||||||
output.writeInt(offset);
|
output.writeInt(offset<<8);
|
||||||
//output.write(200);
|
//output.write(200);
|
||||||
}
|
}
|
||||||
output.seek(fullOffset+sectorSize*offset);
|
output.seek(fullOffset+sectorSize*offset);
|
||||||
|
|
||||||
int bytestoWrite = output.readInt();
|
//int bytestoWrite = output.readInt();
|
||||||
//output.mark(sectorSize*sectorLength);
|
//output.mark(sectorSize*sectorLength);
|
||||||
|
|
||||||
DataOutputStream trueOutput = new DataOutputStream(Channels.newOutputStream(output.getChannel()));
|
DataOutputStream trueOutput = new DataOutputStream(Channels.newOutputStream(output.getChannel()));
|
||||||
@ -252,6 +260,7 @@ public class TestWorldDiskIO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
output.seek(shortOffset+offsetBytes);
|
output.seek(shortOffset+offsetBytes);
|
||||||
|
LOG.info(countOutput.getCount());
|
||||||
output.write((int) countOutput.getCount()/sectorSize);
|
output.write((int) countOutput.getCount()/sectorSize);
|
||||||
|
|
||||||
countOutput.close();
|
countOutput.close();
|
||||||
|
Reference in New Issue
Block a user