From e242e72b2d9a09b22abc1f9769235a00e84f4f94 Mon Sep 17 00:00:00 2001 From: Jaida Wu Date: Thu, 21 Apr 2022 21:41:30 +0800 Subject: [PATCH] Drop independent log server Signed-off-by: Jaida Wu --- src/main/java/emu/grasscutter/Config.java | 3 --- .../server/dispatch/DispatchServer.java | 18 ++++++------------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/emu/grasscutter/Config.java b/src/main/java/emu/grasscutter/Config.java index 4d4cf4a38..65ada3969 100644 --- a/src/main/java/emu/grasscutter/Config.java +++ b/src/main/java/emu/grasscutter/Config.java @@ -13,9 +13,6 @@ public final class Config { public String GameServerPublicIp = ""; public int GameServerPort = 22102; - public int OverseaLogPort = 8888; - public int UploadLogPort = 80; - public String DatabaseUrl = "mongodb://localhost:27017"; public String DatabaseCollection = "grasscutter"; diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index 6b4336858..e59f9d251 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -405,25 +405,18 @@ public final class DispatchServer { "/perf/config/verify", new DispatchHttpJsonHandler("{\"code\":0}") ); - // Start server - server.start(); - Grasscutter.getLogger().info("Dispatch server started on port " + getAddress().getPort()); // Logging servers - HttpServer overseaLogServer = HttpServer.create(new InetSocketAddress(Grasscutter.getConfig().DispatchServerIp, Grasscutter.getConfig().OverseaLogPort), 0); - overseaLogServer.createContext( // overseauspider.yuanshen.com + server.createContext( // overseauspider.yuanshen.com "/log", new DispatchHttpJsonHandler("{\"code\":0}") ); - overseaLogServer.start(); - Grasscutter.getLogger().info("Log server (overseauspider) started on port " + 8888); - HttpServer uploadLogServer = HttpServer.create(new InetSocketAddress(Grasscutter.getConfig().DispatchServerIp, Grasscutter.getConfig().UploadLogPort), 0); - uploadLogServer.createContext( // log-upload-os.mihoyo.com + server.createContext( // log-upload-os.mihoyo.com "/crash/dataUpload", new DispatchHttpJsonHandler("{\"code\":0}") ); - uploadLogServer.createContext("/gacha", t -> { + server.createContext("/gacha", t -> { //Create a response form the request query parameters String response = "Gacha"; //Set the response header status and length @@ -434,8 +427,9 @@ public final class DispatchServer { os.write(response.getBytes()); os.close(); }); - uploadLogServer.start(); - Grasscutter.getLogger().info("Log server (log-upload-os) started on port " + Grasscutter.getConfig().UploadLogPort); + // Start server + server.start(); + Grasscutter.getLogger().info("Dispatch server started on port " + getAddress().getPort()); } private Map parseQueryString(String qs) {