1190 Commits

Author SHA1 Message Date
David Vierra
0025c6b3df recompress chunks during getChunkSlices 2011-02-26 19:09:52 -10:00
David Vierra
9bdc185127 fix bad reference to self.file in setOffset, this contextmanager stuff may be a bad idea... 2011-02-26 19:09:18 -10:00
David Vierra
ae77c58187 delete empty region files after deleting chunks 2011-02-26 17:13:27 -10:00
David Vierra
d94ec4b3ba don't need to use decbase36 for region filenames 2011-02-26 17:12:47 -10:00
David Vierra
8b5ebab219 reset regionFiles to an empty dict instead of None, which is incorrect 2011-02-26 17:11:16 -10:00
David Vierra
f0c3e4affc correctly use context managers to close the file only when the RegionFile class is configured to open files on demand.
as it turns out, experimenting with this option vs earlier code showed no change in the number of open filehandles. python will close the file when it garbage-collects the file object so we don't ever have to close the file.  on windows, opening the file for writing doesn't give an exclusive lock so we don't determine if minecraft is holding onto the file
2011-02-26 17:06:17 -10:00
David Vierra
ff912c2235 compressedTag can be none - this means we are unloaded. 2011-02-26 16:55:04 -10:00
David Vierra
27ef9011a2 detect region files with overlapping chunks 2011-02-26 15:22:58 -10:00
David Vierra
f1aeedd64a synthesize a descriptive filename to read out of chunk files xxx rename property? 2011-02-26 15:21:44 -10:00
David Vierra
b323f6cc6e describe this ChunkMalformed error with more detail 2011-02-26 15:21:16 -10:00
David Vierra
b3ccdd5956 start using psyco where available 2011-02-23 09:39:08 -10:00
David Vierra
d961d96c79 add methods to close a file, now that the region files may be held open. they are not held open by default. 2011-02-23 09:38:40 -10:00
David Vierra
689bf41e1d close the GzipFile after reading from it 2011-02-23 09:37:45 -10:00
David Vierra
fd7388fcd0 fill out the new version and LevelName fields on creation 2011-02-23 09:35:53 -10:00
David Vierra
5ed31290c4 create regionDir when creating a level 2011-02-23 09:35:38 -10:00
David Vierra
c1c92d889b immediately preload regions on load 2011-02-23 09:35:28 -10:00
David Vierra
54ceb4c8f9 LastPlayed is actually a timestamp * 1000 2011-02-23 09:34:57 -10:00
David Vierra
b8c933fd66 use gzip.GzipFile instead of gzip.open because .open won't take a fileobj 2011-02-23 09:32:16 -10:00
David Vierra
549741e909 convenience function to load any world from the saves folder 2011-02-23 09:31:38 -10:00
David Vierra
8a52c977b5 catch more general errors in chunk.load and wrap them in ChunkMalformed 2011-02-23 09:31:18 -10:00
David Vierra
76787fb9ef catch general errors in regionFile.readChunk and wrap them in ChunkMalformed 2011-02-23 09:30:42 -10:00
David Vierra
2aef37d5dc don't throw an error when deleting a chunk whose region file is absent 2011-02-23 09:30:13 -10:00
David Vierra
3bb8e786a5 correctly fill out the free sector map while loading the region, additionally checking for bad offsets and logging a few statistics 2011-02-23 09:29:30 -10:00
David Vierra
2e8ed9fa9b chunk.compress checks for a compressed tag before throwing away uncompressed data 2011-02-23 08:47:05 -10:00
David Vierra
a95345231d add option to hold the file open or reopen it on every access 2011-02-22 13:45:42 -10:00
David Vierra
eff036576b fix zipped schematic imports 2011-02-22 13:45:21 -10:00
David Vierra
a3097b1072 clear region offsets when deleting chunks 2011-02-22 13:44:36 -10:00
David Vierra
283bd4ba9b fix zipped schematic imports 2011-02-22 13:44:16 -10:00
David Vierra
a7a79d8529 fix incorrect sector numbers when extending or reclaiming file space 2011-02-22 13:44:03 -10:00
David Vierra
3be251ce2a converted infdev level to use region files only 2011-02-22 12:38:20 -10:00
David Vierra
d22a2cc3a3 change several length values to unsigned ints 2011-02-22 12:17:13 -10:00
David Vierra
3d23f5b3d4 use a dtype with an explicit byte order when creating IntArrays 2011-02-22 03:37:34 -10:00
David Vierra
0cec37bd6b zipped schematics now read their dimensions from schematic.dat correctly 2011-02-21 04:54:44 -10:00
David Vierra
59cb2ce87d a few more changes for yMod - xxx the byte sex on TAG_Int_Array keeps changing 2011-02-21 04:54:07 -10:00
David Vierra
07b61c0b89 separate Height from ChunkHeight so that ymodded levels and zipped schematic levels can coexist 2011-02-21 04:52:07 -10:00
David Vierra
f45a9358cd removed cruft 2011-02-19 22:34:04 -10:00
David Vierra
07d958b657 print a notice when the size in the filename is too big for the amount of blocks 2011-02-19 21:45:24 -10:00
David Vierra
d0b1118221 remove calls to expandvars 2011-02-19 21:08:02 -10:00
David Vierra
600a1ed8f7 ignore errors while scanning for extra dimensions, specifically to skip a file named dim.txt 2011-02-19 21:06:53 -10:00
David Vierra
b2f8e82837 chunk.unload() will no longer try to save dirty chunks 2011-02-19 20:42:29 -10:00
David Vierra
0c3d9eeef9 added TAG_Int_Array introduced by ymod 2011-02-19 18:19:16 -10:00
David Vierra
f944725b00 use standard 4-space indent here 2011-02-19 18:18:57 -10:00
David Vierra
4e1ddc12df print more detail about invalid chunk format errors 2011-02-19 02:08:32 -10:00
David Vierra
729dec7bee get rid of hard-coded level heights 2011-02-19 01:54:29 -10:00
David Vierra
3f83f5c681 decode os.environ directly instead of using os.path.expandvars 2011-02-18 02:52:06 -10:00
David Vierra
c84b73d1ec infinite-to-infinite block copy now honors the blocksToCopy argument 2011-02-18 02:50:44 -10:00
David Vierra
5ac521957b loadWorld is clearer and doesn't set self.filename any more 2011-02-09 18:26:32 -10:00
David Vierra
97b51a5219 update regression checksum after changing block names (again) 2011-02-07 21:23:24 -10:00
David Vierra
823349a5ee log heightmap progress with logger so it appears during regression tests 2011-02-07 21:16:44 -10:00
David Vierra
4dbccca9dd add property chunkCount because allChunks is now exposed as an iterator 2011-02-07 18:58:22 -10:00