Updated to include the executable

This commit is contained in:
Kadigan KS/b/ 2018-12-31 14:53:05 +01:00
parent 0df481e70d
commit 7ed1daaa15
6 changed files with 45 additions and 19 deletions

View File

@ -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. ;]
### Required packages
- [fs]
- [http]
- [url]
- [nconf]

View File

@ -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.");

View File

@ -0,0 +1,4 @@
{
"localPort": 10000,
"serverGridFolder": "d:/STEAM/steamapps/common/ATLAS Dedicated Server/ShooterGame/ServerGrid"
}

View File

@ -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/ <kadigan.ksb@gmail.com>",
"license": "GPL-3.0",
"dependencies": {
"fs": "0.0.1-security",
"http": "0.0.0",
"nconf": "^0.10.0",
"url": "^0.11.0"
}
}