added configvariable bindaddress (thanks FrozenCow)

This commit is contained in:
flames 2011-01-06 04:55:21 +01:00 committed by FrozenCow
parent 8162817041
commit b4fca31cd5
2 changed files with 5 additions and 1 deletions

View File

@ -90,6 +90,9 @@ public class MapManager extends Thread {
/* port to run web server on */
public int serverport = 8123;
/* bind web server to ip-address */
public String bindaddress = "0.0.0.0";
/* time to pause between rendering tiles (ms) */
public int renderWait = 500;
@ -125,6 +128,7 @@ public class MapManager extends Thread {
colorsetpath = "colors.txt";
signspath = "signs.txt";
serverport = 8123;
bindaddress = "0.0.0.0";
tileStore = new HashMap<Long, MapTile>();
staleTiles = new LinkedList<MapTile>();

View File

@ -20,7 +20,7 @@ public class WebServer extends Thread {
public WebServer(int port, MapManager mgr) throws IOException
{
this.mgr = mgr;
sock = new ServerSocket(port, 5, InetAddress.getByName("127.0.0.1"));
sock = new ServerSocket(port, 5, mgr.bindaddress.equals("0.0.0.0") ? null : InetAddress.getByName(mgr.bindaddress));
running = true;
start();
log.info("map WebServer started on port " + port);