550 Commits

Author SHA1 Message Date
David Vierra
12f1282103 accept -h and --help 2011-03-04 12:10:55 -10:00
David Vierra
834f5f0b9f mce accepts world names instead of world numbers, xxx scan through the saves folder for LevelName tags? 2011-03-04 12:05:32 -10:00
David Vierra
1112b8b6fa go back to not holding files open to avoid having too many files open...? 2011-02-27 10:01:29 -10:00
David Vierra
2a7ae26db3 don't try to pass None into decompressSectors 2011-02-27 01:10:44 -10:00
David Vierra
ede1a2ba4b added an automatic repair routine that detects misplaced and overlapping chunks 2011-02-27 01:03:47 -10:00
David Vierra
5ad16c7a87 on chunk load, alert the world that the chunk is also decompressed xxx this is very sloppy 2011-02-27 00:16:29 -10:00
David Vierra
9c0edc6e85 once again, region filenames have no base36 involved 2011-02-26 21:37:33 -10:00
David Vierra
643d9cfc39 delete empty region files on load 2011-02-26 20:21:24 -10:00
David Vierra
1bb6b6d7cf switch to holding region files open 2011-02-26 20:20:34 -10:00
David Vierra
e0ef5fbb75 this error message now offers a possible fix 2011-02-26 19:10:13 -10:00
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