0
Commit Graph

107 Commits

Author SHA1 Message Date
Nicolas F
3084d57bb3 genPOI: don't panic on empty player dat files
Closes #1876.
2021-06-04 14:03:33 +02:00
Nicolas F
498c844136 Merge PR #1845 from Esvandiary
GenPOI: adds explicit pool close/join in handleEntities to fix possible hang (issue #1817)
2021-06-04 13:59:41 +02:00
clonetwin26
c4a80598ef Update genPOI.py
Catch KeyErrors since nether maps don't necessarily have well formed player.dat
2020-11-26 20:54:29 -05:00
Andy Martin
aac8d11162 Adds explicit pool close/join in handleEntities to fix possible hang (#1817) 2020-08-31 22:00:58 +01:00
Jens
d7f6f3ebd5 Make icons in legend OptIn
Make them OptIn
Add option to docs
2020-07-11 14:03:18 +02:00
Nicolas F
a04ca9ca81 genPOI: fix dumb dimension handling mistake
lol
2020-06-25 19:10:29 +02:00
Nicolas F
0143ad63a6 genPOI: code style fixes
E129 can suck me off. Get a better syntax, Python.
2020-06-25 18:36:00 +02:00
Nicolas F
2b550fdf66 genPOI: fix handling of new dimension format
Fixes #1778.
2020-06-25 18:17:21 +02:00
Cliff Meyers
512d6e7583 use logging.debug for detailed reporting of entities found during genPOI 2020-04-15 07:52:34 -04:00
Cliff Meyers
0a1560431a fix a bug where multiple renders of the same world led to repeat genPOI scans
the code that calls handleEntities in genPOI was building a list
of all filter funcs in the config, then used itertools.groupby to walk over
each region set, calling handleEntities and passing filters funcs for the rset.

this works fine when all of the renders point at a different world,
since rsets are sorted via __lt__ using the regiondir. when an rset appears in
the config multiple times, groupby can't sort the rsets reliably,
so a single rset is passed multiple times to handleEntities with only some
of the applicable filters. for a config with just two renders of the same world,
handleEntities would frequently be called 5-7 times instead of just 2.

this change eliminates group by, and just iterates over all the rsets, each
time plucking the list of applicable filters based on rset associated with
each filter (simple equality).
2020-04-15 07:34:54 -04:00
Cliff Meyers
80e45c4d66 genPOI: apply consistent sorting to markers.js and markersDB.js
use json.dumps(sort_keys=True) to apply a consistent sorting to the output JS files.
improves the readability of diffs and making config testing easier
2020-04-05 08:29:17 -04:00
Nicolas F
1d8279243d genPOI: polyline text improvements
Don't require text for polylines/polygons, and support hovertext
by utilising leaflet's tooltips.
2020-02-13 18:35:20 +01:00
Nicolas F
2c92b4acf9 Merge PR 1649 from deltaidea 2020-02-13 17:40:35 +01:00
Nicolas F
9800c58c14 genpoi: add -p/--processes option for parity
People could always set this through the config file, but somehow
not the command line. This commit fixes this oddity by adding the
option to the genPOI script's argument parser.
2019-12-27 15:32:10 +01:00
Nikita Litvin
a3b9493c57 genPOI: support polylines and filled-in polygons
Add support for polyline POIs just like in the good ol'
Google Maps days. See #883.

The format after this commit is:
{ id, x, y, z, text, color, polyline/polygon: [{ x, y, z }, ...] }

Optional properties:
- common ones like "icon" and "hovertext"
- "strokeColor" (string),
- "fill" (boolean)
- "weight" (integer)

Docs not included.

Largely based on PR #1536 by @jsmienk.
Closes #1456, closes #1536, closes #1643.
2019-12-24 01:23:00 +03:00
Nicolas F
76bbabb7de fix various logging.warn calls
Those are deprecated in favour of logging.warning now.
2019-12-11 18:42:35 +01:00
Nicolas F
79a5668bd2 genPOI: handle more uuidcache.dat corruption
Apparently the gzip stream can be malformed in a way where it
does read it, but then throws an EOFError when it abruptly ends.

Catch this so we don't error out.
2019-10-26 02:41:56 +02:00
Nicolas F
c13d3aae3c rename configParser to config_parser
CamelCase does not bode well in Python land, so it's best we rename
these ill-named files before the Guidoists get us and throw us into
a damp dungeon.
2019-07-24 09:18:02 +02:00
Nicolas F
033d75b08e genPOI: respect crop option
Use CroppedRegionSets to generate markers, which should only affect
handleEntities. I have not yet checked whether this generates
dupicate players and manualpois for maps with multiple crop zones,
but that's a fire to put out for another day.

Fixes #1574.
2019-07-12 16:04:28 +02:00
Nicolas F
7d1a04b0fe genPOI: hopefully fix binary string nonsense
Somebody reported that genPOI was throwing an exception in two
different places related to trying to read bytes as a string.

I personally could not reproduce (possibly needs some special player
names or something?) but I think this change should fix it either way.
2019-06-28 13:24:48 +02:00
Nicolas F
dc7d1cd208 genPOI: replace optparse with argparse
Maybe one day we'll use actual subparsers but today is not that day.
2019-03-22 17:10:52 +01:00
Nicolas F
11aa232141 genPOI: port to Python 3
There's some stuff left to do, like properly do the functools.partial
stuff, and check that the uuidcache is actually working. But hey,
player markers work at least, and so does --skip-scan.

Still needs a port to argparse though.
2019-03-18 19:45:22 +01:00
Nicolas F
c9b506a58c genPOI: fix code style
One code style error can't really be fixed because despite
has_key being deprecated, "in" doesn't work on "super" for objects
that derive from dict, at least not in Python 2.7. Thanks Guido.

Also, I don't know which one of you it is that keeps putting semicolons
at the end of your statements but you seriously need to stop.
2019-03-10 18:05:32 +01:00
Nicolas F
e1728b9e59 genpoi: Also fix missing nbt keys if processes > 1
oopsie
2018-11-26 14:40:52 +01:00
Nicolas F
38bc400b2f genPOI: catch ChunkDoesntExist when processes > 1
Fixes #1480.

No clue how this wasn't an issue before but is an issue now in 1.13,
maybe Minecraft writes more placeholder chunks these days.
2018-11-26 13:03:44 +01:00
Nicolas F
cf53208989 genpoi: fix uncaught KeyErrors on some MC data
Apparently TileEntities can just not even exist now, and the same
goes for the player Dimension key. For the latter, I'm not sure
whether the fallback is correct, but it's a guess I suppose.

Hopefully addresses #1480.
2018-11-18 09:29:48 +01:00
gmcnew
7236aefc94 Misc fixes 2018-08-07 22:52:32 +00:00
3decibels
e5b90fd512 Added expiration of uuidcache entries
Entries in the uuidcache will now be considered expired if they were
retrieved before the mtime of the player dat file. This follows the
recommendation made in issue #1279.
2017-06-05 18:29:43 +00:00
Nicolas F
cd0eb2d5c4 genpoi: query fs caps before using FileReplacer
Probably fixes #1271
2017-03-17 14:57:22 +01:00
Nicolas F
c49990f18b genPOI: expose uuid value for filter functions
Fixes #1345.
2016-12-06 15:28:53 +01:00
Nicolas F
54b93754c7 genPOI/docs: Handle new sign id values
Minecraft now uses minecraft:sign as its id for signs, but also uses
Sign for older versions or chunks that have not yet been updated.

Change the genPOI sign wrangling code and the documentation to reflect
this change.

Fixes #1340.
2016-12-06 15:17:39 +01:00
Nicolas F
c7d86eca76 Change shebang to python2 instead of python 2016-12-06 15:01:20 +01:00
Nicolas F
4287fc5f0b Add -q alias for --quiet to genPOI
This brings it in line with the syntax of the main overviewer.py
script.
2016-06-30 09:04:49 +02:00
Aaron Griffith
11c10972e2 Merge remote-tracking branch 'kevinwchang/filter-id' 2016-06-10 20:31:28 -04:00
Nicolas F
4e77ba8d13 genpoi: Fix GzipFile closing on python 2.6
Fixes #1275
2016-02-13 14:41:09 +01:00
Nicolas F
9fc050cf67 genPOI: Use "with" statement to close gzip files
Previously, the files were not closed after reading or writing;
by using a "with" statement, the file handles will be closed as
soon as they go out of scope.

Possible fix for #1271.
2016-01-30 14:17:16 +01:00
Andrew Chin
2e34507568 Use FileReplacer to manage the uuid cache file 2016-02-01 09:32:35 -05:00
Andrew Chin
270741eb8f genpoi UUID improvements
* When reading the cache, catch some errors on load, instead of crashing
* When writing to cache, write to tmp file, then move it into place.
  This should be more robust if a ctrl+c is recieved while writing the
  cache

Addresses #1266
2015-12-27 14:59:03 -05:00
Kevin Chang
eabda0750c create filter identifiers from render name instead of region set
This allows for separate sets of markers when multiple renders share the same region set (dimension).
2015-12-04 01:48:04 -08:00
Andrew Chin
0ba0c60ed2 Catch TypeErrors as well when loading player dat files 2015-10-06 17:38:49 -04:00
Andrew Chin
afc1c4f924 Don't call save_cache if running with --skip-players 2015-08-14 08:47:52 -04:00
Mark Fickett
f839068f27 Convert filter generator to list before passing to handleEntities to fix repeated iteration. Fixes #1220 . 2015-03-18 23:33:54 -04:00
Aaron Griffith
4a9d808bb2 Merge pull request #1219 from MasterofJOKers/player_poi_fix
[genPOI] Fix generation of multiple players
2015-03-12 13:00:24 -04:00
Aaron Griffith
0c7441f93d equality != assignment... 2015-03-12 12:25:41 -04:00
Aaron Griffith
88de7b1567 get genpoi multiprocessing working on windows 2015-03-12 12:21:39 -04:00
MasterofJOKers
803d8d7933 [genPOI] sort list of imports
Easier to see if an import is already there.
2015-03-12 15:56:48 +01:00
MasterofJOKers
adcf105778 [genPOI] fix generation of multiple players
The same problem as in bd8f3577 is also present for players. The filters
were given as iterator, but iterated through once per player.
2015-03-12 15:54:48 +01:00
MasterofJOKers
5764183e00 [genPOI] remove unnecessary second import of json 2015-03-09 09:37:10 +01:00
MasterofJOKers
bd8f357787 [genPOI] pass filters as list to handleManualPOI
It was accidently passed as an iterator, so it was only iterable once,
which lead to only the first manual poi being displayed.
2015-03-09 09:34:44 +01:00
Nicolas F
b35f848855 [genPOI] Work around utter plebbery 2015-03-08 17:03:43 +01:00