0
Commit Graph

95 Commits

Author SHA1 Message Date
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
Nicolas F
b5ecf8a7f4 [genPOI] Work around JSON signs
lol Mojang
2015-03-07 18:16:32 +01:00
Jamie Bliss
3cd2afb0c4 genPOI: don't ignore invalid polyline point
There is no point in ignoring an invalid point, because without an error
message the user might wonder, why it's poyline doesn't look the way it
should.
2015-02-23 21:39:03 +01:00
Jamie Bliss
7229fcc3df genPOI: use more pythonic ways ...
One should use isinstance instead of `type(A) ==` because of
inheritance.
There should be an exception if a list of `elif`s don't match.
Make Polyline not only accept tuples, but any iterable.
2015-02-23 21:39:03 +01:00
Jamie Bliss
b08e34b064 genPOI: add icon and createInfoWindow support for filters
The defaults for "icon" and "createInfoWindow" are read from the POI,
but can be overridden by a filter function returning an appripriate
dict.
2015-02-23 21:19:17 +01:00
MasterofJOKers
4b9d0a5c87 Merge branch 'master' into my_genpoi
Conflicts:
	overviewer_core/aux_files/genPOI.py
2015-02-08 14:19:21 +01:00
Gizmokid2005
77c4d24660 Skip missing dimensions in genPOI
This fixes overviewer/Minecraft-Overviewer #1202 for genPOI renders.
2015-02-05 13:54:01 -05:00
Koza
f1af25799e Fixed rendering regions. genPOI.py: add new line to baseMakers.js; views.js: add polygons, with all the features that Google provides, polylines work fine; regions.js: example of usage 2014-12-13 17:17:11 +01:00
MasterofJOKers
9cbeffc721 Merge branch 'master' into my_genpoi 2014-10-30 12:47:55 +01:00
MasterofJOKers
9d1eb35643 Merge branch 'master' into my_genpoi
This just updates the code to the current master, so it can be merged
easily.

Conflicts:
	overviewer_core/aux_files/genPOI.py
2014-10-28 22:15:58 +01:00
Nicolas F
dfe6f08ee9 genPOI: Resolve UUIDs for player spawns too 2014-10-24 13:57:06 +02:00
Andrew Chin
322922b8e6 Implement a UUID lookup cache, to avoid hitting the mojang server so much
The cache is a gzip'd JSON file.  Soon we will have a small script to
help manage the cache

See #1090 and #1117
2014-08-19 22:08:15 -04:00
Andrew Chin
59d277a131 Change ctime to localtime.
See discussion in #1082
2014-08-19 21:28:25 -04:00