diff --git a/CurrentSaves/DeleteMe b/CurrentSaves/DeleteMe deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 212e667..60166f5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ 3. Create a folder called `bizhawk-crowd-shuffler` where the BizHawk is installed in from **step 1** and unzip the release file from **step 2** inside of the newly created folder. -4. Open the `bizhawk-crowd-shuffler` folder and copy any roms that you want shuffled into the `CurrentRoms` folder +4. Open the `bizhawk-crowd-shuffler` folder and copy any roms that you want shuffled into the `sessions/default/urrentRoms` folder 5. Edit the `Start.bat` to fill in the `CHANNEL` with your Twitch channel name. diff --git a/bizhawk-crowd-shuffler.lua b/bizhawk-crowd-shuffler.lua index 1693fe9..b3cd70a 100644 --- a/bizhawk-crowd-shuffler.lua +++ b/bizhawk-crowd-shuffler.lua @@ -1,7 +1,9 @@ local config = {} -config.gamePath = ".\\CurrentROMs\\" -config.savePath = ".\\CurrentSaves\\" +config.sessionPath = os.getenv("session") and os.getenv("session") or 'default' + +config.gamePath = ".\\sessions\\" .. config.sessionPath .. "\\CurrentROMs\\" +config.savePath = ".\\sessions\\" .. config.sessionPath .. "\\CurrentSaves\\" local frame = 0 diff --git a/CurrentRoms/DeleteMe b/sessions/default/CurrentSaves/DeleteMe similarity index 100% rename from CurrentRoms/DeleteMe rename to sessions/default/CurrentSaves/DeleteMe diff --git a/src/config.js b/src/config.js index 00a47e1..b00d7f8 100644 --- a/src/config.js +++ b/src/config.js @@ -7,6 +7,7 @@ const getEnvironmentConfig = () => { port: process.env.PORT, host: process.env.HOST, channel: process.env.CHANNEL, + session: process.env.session, bizhawkPath: process.env.BIZHAWK_PATH, twitchToken: process.env.TWITCH_TOKEN }; @@ -38,6 +39,7 @@ const getDefaultConfig = () => { "redemptionName": "^swap$", "redepmtionRandomText": "^rng$", "randomOnly": false, + "session": "default", "timer": { "min": 5000, "max": 60000 diff --git a/src/index.js b/src/index.js index c22dadd..740ea74 100644 --- a/src/index.js +++ b/src/index.js @@ -27,6 +27,11 @@ const startBizhawk = (port, host) => { // TODO const isWin = process.platform === "win32"; if(isWin) { + + if(!process.env.session) { + process.env.session = config.session; + } + open('Start_BizHawk_Listen_To_Crowd_Shuffler.bat'); logger.info(chalk.green("Bizhawk started")); } else { diff --git a/src/swap.js b/src/swap.js index b217f65..b91ffc9 100644 --- a/src/swap.js +++ b/src/swap.js @@ -13,7 +13,7 @@ class RomShuffler { } async fetchCurrentRoms() { - let roms = await fs.readdir("CurrentRoms"); + let roms = await fs.readdir(`./sessions/${config.session}/CurrentRoms`); return roms; }