Skip to content

Commit

Permalink
Use a sessions folder instead (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjpaz authored Jan 18, 2021
1 parent 0269757 commit 93534a5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
Empty file removed CurrentSaves/DeleteMe
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 4 additions & 2 deletions bizhawk-crowd-shuffler.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -38,6 +39,7 @@ const getDefaultConfig = () => {
"redemptionName": "^swap$",
"redepmtionRandomText": "^rng$",
"randomOnly": false,
"session": "default",
"timer": {
"min": 5000,
"max": 60000
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 93534a5

Please sign in to comment.