Skip to content

Commit

Permalink
update relayserver so if cwd is passed in we can figure out the gameI…
Browse files Browse the repository at this point in the history
…d from package.json
  • Loading branch information
greggman committed Sep 9, 2014
1 parent 835c5a5 commit 36e3d50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/relayserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,14 @@ var RelayServer = function(servers, options) {
if (path.basename(cwd) == "bin") {
cwd = path.dirname(cwd);
}
gameId = gameInfo.makeRuntimeGameId(gameId, cwd);
try {
var runtimeInfo = gameInfo.readGameInfo(path.join(cwd));
if (runtimeInfo) {
gameId = runtimeInfo.info.happyFunTimes.gameId;
}
} catch (e) {
gameId = gameInfo.makeRuntimeGameId(gameId, cwd);
}
}
debug("starting game: " + gameId);
eventEmitter.emit('gameStarted', {gameId: gameId});
Expand Down

0 comments on commit 36e3d50

Please sign in to comment.