diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index b7967d2d..454990d4 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -1554,6 +1554,23 @@ function getBusinessFromParams(params) { // --------------------------------------------------------------------------- +function getGameLocationFromParams(params) { + if(isNaN(params)) { + for(let i in getGameData().locations) { + if(toLowerCase(getGameData().locations[i][0]).indexOf(toLowerCase(params)) != -1) { + return i; + } + } + } else { + if(typeof getGameData().locations[params] != "undefined") { + return toInteger(params); + } + } + return false; +} + +// --------------------------------------------------------------------------- + function getHouseFromParams(params) { if(isNaN(params)) { for(let i in getServerData().houses) { @@ -1919,4 +1936,12 @@ function generateRandomString(length) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; -} \ No newline at end of file +} + +// --------------------------------------------------------------------------- + +function getTimeDisplayUntilPlayerPayDay(client) { + return getTimeDifferenceDisplay(sdl.ticks-getPlayerData(client).payDayTickStart); +} + +// --------------------------------------------------------------------------- \ No newline at end of file