Fix --securerandom to not be mad at not having a seed
This commit is contained in:
5
Main.py
5
Main.py
@@ -5,6 +5,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import RaceRandom as random
|
import RaceRandom as random
|
||||||
|
import string
|
||||||
import time
|
import time
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ def main(args, seed=None, fish=None):
|
|||||||
random.seed(world.seed)
|
random.seed(world.seed)
|
||||||
|
|
||||||
if args.securerandom:
|
if args.securerandom:
|
||||||
world.seed = None
|
world.seed = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(9))
|
||||||
|
|
||||||
world.remote_items = args.remote_items.copy()
|
world.remote_items = args.remote_items.copy()
|
||||||
world.mapshuffle = args.mapshuffle.copy()
|
world.mapshuffle = args.mapshuffle.copy()
|
||||||
@@ -368,7 +369,7 @@ def main(args, seed=None, fish=None):
|
|||||||
logger.info(world.fish.translate("cli","cli","made.playthrough") % (YES if (args.calc_playthrough) else NO))
|
logger.info(world.fish.translate("cli","cli","made.playthrough") % (YES if (args.calc_playthrough) else NO))
|
||||||
logger.info(world.fish.translate("cli","cli","made.spoiler") % (YES if (not args.jsonout and args.create_spoiler) else NO))
|
logger.info(world.fish.translate("cli","cli","made.spoiler") % (YES if (not args.jsonout and args.create_spoiler) else NO))
|
||||||
logger.info(world.fish.translate("cli","cli","used.enemizer") % (YES if enemized else NO))
|
logger.info(world.fish.translate("cli","cli","used.enemizer") % (YES if enemized else NO))
|
||||||
logger.info(world.fish.translate("cli","cli","seed") + ": %d", world.seed)
|
logger.info(world.fish.translate("cli","cli","seed") + ": %s", world.seed)
|
||||||
logger.info(world.fish.translate("cli","cli","total.time"), time.perf_counter() - start)
|
logger.info(world.fish.translate("cli","cli","total.time"), time.perf_counter() - start)
|
||||||
|
|
||||||
# print_wiki_doors_by_room(dungeon_regions,world,1)
|
# print_wiki_doors_by_room(dungeon_regions,world,1)
|
||||||
|
|||||||
3
Rom.py
3
Rom.py
@@ -1661,8 +1661,9 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
|
|||||||
# set rom name
|
# set rom name
|
||||||
# 21 bytes
|
# 21 bytes
|
||||||
from Main import __version__
|
from Main import __version__
|
||||||
|
seedstring = f'{world.seed:09}' if isinstance(world.seed, int) else world.seed
|
||||||
# todo: change to DR when Enemizer is okay with DR
|
# todo: change to DR when Enemizer is okay with DR
|
||||||
rom.name = bytearray(f'ER{__version__.split("-")[0].replace(".","")[0:3]}_{team+1}_{player}_{world.seed:09}\0', 'utf8')[:21]
|
rom.name = bytearray(f'ER{__version__.split("-")[0].replace(".","")[0:3]}_{team+1}_{player}_{seedstring}\0', 'utf8')[:21]
|
||||||
rom.name.extend([0] * (21 - len(rom.name)))
|
rom.name.extend([0] * (21 - len(rom.name)))
|
||||||
rom.write_bytes(0x7FC0, rom.name)
|
rom.write_bytes(0x7FC0, rom.name)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"cli": {
|
"cli": {
|
||||||
"app.title": "ALttP Tür Randomisier Version %s - Nummer: %d, Code: %s",
|
"app.title": "ALttP Tür Randomisier Version %s - Nummer: %s, Code: %s",
|
||||||
"shuffling.world": "Welt wird durchmischt.",
|
"shuffling.world": "Welt wird durchmischt.",
|
||||||
"generating.itempool": "Generier Gegenstandsbasis.",
|
"generating.itempool": "Generier Gegenstandsbasis.",
|
||||||
"calc.access.rules": "Berechne Zugriffsregeln.",
|
"calc.access.rules": "Berechne Zugriffsregeln.",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"cli": {
|
"cli": {
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
"app.title": "ALttP Door Randomizer Version %s - Seed: %d, Code: %s",
|
"app.title": "ALttP Door Randomizer Version %s - Seed: %s, Code: %s",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"seed": "Seed",
|
"seed": "Seed",
|
||||||
"player": "Player",
|
"player": "Player",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"cli": {
|
"cli": {
|
||||||
"app.title": "ALttP Puerta Aleatorizador Versión %s - Número: %d, Código: %s",
|
"app.title": "ALttP Puerta Aleatorizador Versión %s - Número: %s, Código: %s",
|
||||||
"player": "Jugador",
|
"player": "Jugador",
|
||||||
"shuffling.world": "Barajando el Mundo",
|
"shuffling.world": "Barajando el Mundo",
|
||||||
"shuffling.dungeons": "Barajando Mazmorras",
|
"shuffling.dungeons": "Barajando Mazmorras",
|
||||||
|
|||||||
Reference in New Issue
Block a user