mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-23 16:11:33 +01:00
Renamed WebServer to HttpServer and WebServerRequest to HttpServerConnection.
This commit is contained in:
parent
2a79aea7bb
commit
debf5bcc57
@ -17,7 +17,7 @@ import org.bukkit.plugin.PluginLoader;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
import org.dynmap.debug.BukkitPlayerDebugger;
|
||||
import org.dynmap.web.WebServer;
|
||||
import org.dynmap.web.HttpServer;
|
||||
import org.dynmap.web.handlers.ClientConfigurationHandler;
|
||||
import org.dynmap.web.handlers.ClientUpdateHandler;
|
||||
import org.dynmap.web.handlers.FilesystemHandler;
|
||||
@ -26,7 +26,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
|
||||
private WebServer webServer = null;
|
||||
private HttpServer webServer = null;
|
||||
private MapManager mapManager = null;
|
||||
private PlayerList playerList;
|
||||
|
||||
@ -47,7 +47,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
return mapManager;
|
||||
}
|
||||
|
||||
public WebServer getWebServer() {
|
||||
public HttpServer getWebServer() {
|
||||
return webServer;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
}
|
||||
int port = configuration.getInt("webserver-port", 8123);
|
||||
|
||||
webServer = new WebServer(bindAddress, port);
|
||||
webServer = new HttpServer(bindAddress, port);
|
||||
webServer.handlers.put("/", new FilesystemHandler(mapManager.webDirectory));
|
||||
webServer.handlers.put("/tiles/", new FilesystemHandler(mapManager.tileDirectory));
|
||||
webServer.handlers.put("/up/", new ClientUpdateHandler(mapManager, playerList, getWorld()));
|
||||
|
@ -14,7 +14,7 @@ public class HttpResponse {
|
||||
private OutputStream body;
|
||||
public OutputStream getBody() throws IOException {
|
||||
if (body != null) {
|
||||
WebServerRequest.writeResponseHeader(body, this);
|
||||
HttpServerConnection.writeResponseHeader(body, this);
|
||||
OutputStream b = body;
|
||||
body = null;
|
||||
return b;
|
||||
|
@ -10,7 +10,7 @@ import java.util.TreeMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class WebServer extends Thread {
|
||||
public class HttpServer extends Thread {
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
|
||||
private ServerSocket sock = null;
|
||||
@ -21,7 +21,7 @@ public class WebServer extends Thread {
|
||||
|
||||
public SortedMap<String, HttpHandler> handlers = new TreeMap<String, HttpHandler>(Collections.reverseOrder());
|
||||
|
||||
public WebServer(InetAddress bindAddress, int port) {
|
||||
public HttpServer(InetAddress bindAddress, int port) {
|
||||
this.bindAddress = bindAddress;
|
||||
this.port = port;
|
||||
}
|
||||
@ -38,7 +38,7 @@ public class WebServer extends Thread {
|
||||
while (running) {
|
||||
try {
|
||||
Socket socket = sock.accept();
|
||||
WebServerRequest requestThread = new WebServerRequest(socket, this);
|
||||
HttpServerConnection requestThread = new HttpServerConnection(socket, this);
|
||||
requestThread.start();
|
||||
} catch (IOException e) {
|
||||
log.info("map WebServer.run() stops with IOException");
|
@ -13,13 +13,13 @@ import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class WebServerRequest extends Thread {
|
||||
public class HttpServerConnection extends Thread {
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
|
||||
private Socket socket;
|
||||
private WebServer server;
|
||||
private HttpServer server;
|
||||
|
||||
public WebServerRequest(Socket socket, WebServer server) {
|
||||
public HttpServerConnection(Socket socket, HttpServer server) {
|
||||
this.socket = socket;
|
||||
this.server = server;
|
||||
}
|
Loading…
Reference in New Issue
Block a user