0

genpoi: query fs caps before using FileReplacer

Probably fixes #1271
This commit is contained in:
Nicolas F
2017-03-17 14:57:22 +01:00
parent 94d6772266
commit cd0eb2d5c4

View File

@@ -34,7 +34,7 @@ from optparse import OptionParser
from overviewer_core import logger
from overviewer_core import nbt
from overviewer_core import configParser, world
from overviewer_core.files import FileReplacer
from overviewer_core.files import FileReplacer, get_fs_caps
UUID_LOOKUP_URL = 'https://sessionserver.mojang.com/session/minecraft/profile/'
@@ -236,8 +236,9 @@ class PlayerDict(dict):
@classmethod
def save_cache(cls, outputdir):
cache_file = os.path.join(outputdir, "uuidcache.dat")
caps = get_fs_caps(outputdir)
with FileReplacer(cache_file) as cache_file_name:
with FileReplacer(cache_file, caps) as cache_file_name:
with closing(gzip.GzipFile(cache_file_name, "wb")) as gz:
json.dump(cls.uuid_cache, gz)
logging.info("Wrote UUID cache with %d entries",