diff --git a/node.js simple HTTP server for MapImg and CellImg_/README.md b/node.js simple HTTP server for MapImg and CellImg_/README.md index 154d0ec..ecc8cdd 100644 --- a/node.js simple HTTP server for MapImg and CellImg_/README.md +++ b/node.js simple HTTP server for MapImg and CellImg_/README.md @@ -2,15 +2,22 @@ The atlas.js node.js server is intended to do one thing - serve your `MapImg`, `CellImg_` and `/n/n/n.png` files over HTTP. It is written for this single purpose, and will serve no other files. -This server obviously requires you have **node.js** installed on your system. You will also require the `node_modules` included here in a .zip file for your convenience. +An executable version (Windows x64 exe) has been provided for your convenience as `atlas-simple-http-server.zip`. ### Configuration -Please remember to edit `ServerWWWPort` and `ATLAS_ServerGrid_Folder` to your liking, and remember to *port-forward* the chosen port to your public IP. +Please remember to edit `localPort` and `serverGridFolder` to your liking, and remember to *port-forward* the chosen port to your public IP. ### Running -Run the server via `node atlas.js` +Run the server either via `node atlas.js` or by launching `atlas-simple-http-server.exe`. ### Debugging -`atlas.js` outputs full headers received and the raw request. Use these to debug what the Game server is trying to do and failing. +The simple HTTP server outputs full headers received and the raw request. Use these to debug what the Game server is trying (and failing) to do. -If you're getting repeated requests for the same file, **make sure your `SeamlessDataPort` is port-fordwarded and included in your starter cmd**. Once that is done, the server should stop making a fool of itself. ;] \ No newline at end of file +If you're getting repeated requests for the same file, **make sure your `SeamlessDataPort` is port-fordwarded and included in your starter cmd**. Once that is done, the server should stop making a fool of itself. ;] + +### Required packages + +- [fs] +- [http] +- [url] +- [nconf] diff --git a/node.js simple HTTP server for MapImg and CellImg_/atlas-simple-http-server.zip b/node.js simple HTTP server for MapImg and CellImg_/atlas-simple-http-server.zip new file mode 100644 index 0000000..e89047c Binary files /dev/null and b/node.js simple HTTP server for MapImg and CellImg_/atlas-simple-http-server.zip differ diff --git a/node.js simple HTTP server for MapImg and CellImg_/atlas.js b/node.js simple HTTP server for MapImg and CellImg_/atlas.js index 69c503d..bc4063b 100644 --- a/node.js simple HTTP server for MapImg and CellImg_/atlas.js +++ b/node.js simple HTTP server for MapImg and CellImg_/atlas.js @@ -1,20 +1,18 @@ -/* --------------------------------- - * ATLAS local HTTP server for serving map-related images - * - * Version: 1.0 - * Last change: 2018-12-29 - * Author: Kad, kadigan.ksb@gmail.com - * License: GPL v3.0 - */ - // CONFIG: +var nconf = require('nconf'); +nconf.argv().env(); +nconf.file({ file: 'config.json' }); -// on what port should the server be listening to? (you will need to forward this port, it's TCP) -// NOTE: you only need ONE map server for your entire ATLAS World -var ServerWWWPort = 10000; +// default config values: +nconf.defaults({ + "serverGridFolder": "./ServerGrid", + "localport": 10000 +}); + +var ServerWWWPort = nconf.get('localport'); // where do you keep the images on disk? (note: replace all \ with / or it won't work!) -var ATLAS_ServerGrid_Folder = 'd:/STEAM/steamapps/common/ATLAS Dedicated Server/ShooterGame/ServerGrid'; +var ATLAS_ServerGrid_Folder = nconf.get('serverGridFolder'); // ===================================================================================================== // import requirements @@ -88,7 +86,7 @@ var server = http.createServer (function handler (request, response) { var fileData = fs.readFileSync(ATLAS_ServerGrid_Folder + 'CellImg_' + CellImg.join('-') + '.png'); response.writeHead(200, new defaultResponse('image/jpg', fileData.length)); response.write(fileData); - response.end(); + response.end();D return; } console.log(" ERROR: CellImg_" + CellImg.join('-') + ".jpg not found in " + ATLAS_ServerGrid_Folder + ", cannot serve. Aborting."); diff --git a/node.js simple HTTP server for MapImg and CellImg_/config.json b/node.js simple HTTP server for MapImg and CellImg_/config.json new file mode 100644 index 0000000..44c6ac3 --- /dev/null +++ b/node.js simple HTTP server for MapImg and CellImg_/config.json @@ -0,0 +1,4 @@ +{ + "localPort": 10000, + "serverGridFolder": "d:/STEAM/steamapps/common/ATLAS Dedicated Server/ShooterGame/ServerGrid" +} \ No newline at end of file diff --git a/node.js simple HTTP server for MapImg and CellImg_/node_modules.zip b/node.js simple HTTP server for MapImg and CellImg_/node_modules.zip deleted file mode 100644 index 9ac45df..0000000 Binary files a/node.js simple HTTP server for MapImg and CellImg_/node_modules.zip and /dev/null differ diff --git a/node.js simple HTTP server for MapImg and CellImg_/package.json b/node.js simple HTTP server for MapImg and CellImg_/package.json new file mode 100644 index 0000000..5b0f71b --- /dev/null +++ b/node.js simple HTTP server for MapImg and CellImg_/package.json @@ -0,0 +1,17 @@ +{ + "name": "atlas-http-server", + "version": "1.0.0", + "description": "ATLAS HTTP server for your ATLAS MMO dedicated server - when you just can't get the maps to show no matter what", + "main": "atlas.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Kadigan ks/b/ ", + "license": "GPL-3.0", + "dependencies": { + "fs": "0.0.1-security", + "http": "0.0.0", + "nconf": "^0.10.0", + "url": "^0.11.0" + } +}