Add CSPRNG option: --securerandom
This commit is contained in:
8
Main.py
8
Main.py
@@ -4,7 +4,7 @@ from itertools import zip_longest
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import RaceRandom as random
|
||||
import time
|
||||
|
||||
from BaseClasses import World, CollectionState, Item, Region, Location, Shop
|
||||
@@ -23,6 +23,9 @@ __version__ = '0.6.3-pre'
|
||||
def main(args, seed=None):
|
||||
start = time.perf_counter()
|
||||
|
||||
if args.securerandom:
|
||||
random.use_secure()
|
||||
|
||||
# initialize the world
|
||||
world = World(args.multi, args.shuffle, args.logic, args.mode, args.swords, args.difficulty, args.item_functionality, args.timer, args.progressive, args.goal, args.algorithm, not args.nodungeonitems, args.accessibility, args.shuffleganon, args.quickswap, args.fastmenu, args.disablemusic, args.keysanity, args.retro, args.custom, args.customitemarray, args.shufflebosses, args.hints)
|
||||
logger = logging.getLogger('')
|
||||
@@ -33,6 +36,9 @@ def main(args, seed=None):
|
||||
world.seed = int(seed)
|
||||
random.seed(world.seed)
|
||||
|
||||
if args.securerandom:
|
||||
world.seed = None
|
||||
|
||||
world.crystals_needed_for_ganon = random.randint(0, 7) if args.crystals_ganon == 'random' else int(args.crystals_ganon)
|
||||
world.crystals_needed_for_gt = random.randint(0, 7) if args.crystals_gt == 'random' else int(args.crystals_gt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user