# If --all was specified, populate the delete list will all known dungeons. # Otherwise just validate the -d options. to_delete = [] if args.all == True: for d in dungeons: to_delete.append((d[0], d[1])) else: for d in args.dungeons: if (d[0], d[1]) not in existing: sys.exit('Unable to locate dungeon at %d %d.'%(d[0], d[1])) to_delete.append(d) # Build a list of chunks to delete from the dungeon info. chunks = [] # We need to update the caches for the chunks we are affecting dcache, dmtime = loadDungeonCache(cache_path) ms = mapstore.new(cfg.mapstore) for d in to_delete: p = [d[0]/16, d[1]/16] print 'Deleting dungeon at %d %d...'%(d[0], d[1]) dkey = '%s,%s' % (d[0],d[1]) ms.delete_maps(dkey) if dkey in dcache: del dcache[dkey] else: print 'WARN: Dungeon not in dungeon cache! '+dkey xsize = 0 zsize = 0 for e in dungeons: if e[0] == d[0] and e[1] == d[1]: xsize = e[2] zsize = e[3]
# If --all was specified, populate the delete list will all known dungeons. # Otherwise just validate the -d options. to_delete = [] if args.all is True: for d in dungeons: to_delete.append((d[0], d[1])) else: for d in args.dungeons: if (d[0], d[1]) not in existing: sys.exit('Unable to locate dungeon at %d %d.' % (d[0], d[1])) to_delete.append(d) # Build a list of chunks to delete from the dungeon info. chunks = [] # We need to update the caches for the chunks we are affecting dcache, dmtime = utils.loadDungeonCache(cache_path) ms = mapstore.new(cfg.mapstore, cfg.dir_paintings) for d in to_delete: p = [d[0]/16, d[1]/16] print 'Deleting dungeon at %d %d...' % (d[0], d[1]) dkey = '%s,%s' % (d[0], d[1]) ms.delete_maps(dkey) if dkey in dcache: del dcache[dkey] else: print 'WARN: Dungeon not in dungeon cache! '+dkey xsize = 0 zsize = 0 for e in dungeons: if e[0] == d[0] and e[1] == d[1]: xsize = e[2] zsize = e[3]