Map socket comm
This commit is contained in:
+14
-1
@@ -5,6 +5,18 @@ const uuid = require("uuid");
|
||||
const map_conf = require("../config/map.conf");
|
||||
const logger = require("./logger.util");
|
||||
|
||||
// Returns map filename or ""
|
||||
function getSelectedMap() {
|
||||
var selected_map_name = "";
|
||||
|
||||
// Check if a map has been selected to show it
|
||||
if (fs.existsSync(path.join(path.dirname(require.main.filename), map_conf.map_storage_path, "selected"))) {
|
||||
selected_map_name = fs.readFileSync(path.join(path.dirname(require.main.filename), map_conf.map_storage_path, "selected"), "utf-8");
|
||||
}
|
||||
|
||||
return(selected_map_name);
|
||||
}
|
||||
|
||||
// Creates new map
|
||||
async function addMap(filename, meta, throttle, motor) {
|
||||
var total = "";
|
||||
@@ -201,5 +213,6 @@ module.exports = {
|
||||
parseMapJson,
|
||||
mapExists,
|
||||
updateMap,
|
||||
addMap
|
||||
addMap,
|
||||
getSelectedMap
|
||||
};
|
||||
Reference in New Issue
Block a user