diff --git a/src/main/java/emu/grasscutter/game/Account.java b/src/main/java/emu/grasscutter/game/Account.java index 7ccaf7e7e..5b8523ec3 100644 --- a/src/main/java/emu/grasscutter/game/Account.java +++ b/src/main/java/emu/grasscutter/game/Account.java @@ -74,7 +74,11 @@ public class Account { } public String getEmail() { - return email; + if(email != null && !email.isEmpty()) { + return email; + } else { + return ""; + } } public void setEmail(String email) { diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchHttpJsonHandler.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchHttpJsonHandler.java index 31abc77ae..58d7207c5 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchHttpJsonHandler.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchHttpJsonHandler.java @@ -36,7 +36,7 @@ public final class DispatchHttpJsonHandler implements HttpContextHandler { public void handle(Request req, Response res) throws IOException { // Checking for ALL here isn't required as when ALL is enabled enableDevLogging() gets enabled if(Grasscutter.getConfig().DebugMode == ServerDebugMode.MISSING && Arrays.stream(missingRoutes).anyMatch(x -> x == req.baseUrl())) { - Grasscutter.getLogger().info(String.format("[Dispatch] Client %s %s request: ", req.ip(), req.method(), req.baseUrl()) + (Grasscutter.getConfig().DebugMode == ServerDebugMode.MISSING ? "(MISSING)" : "")); + Grasscutter.getLogger().info(String.format("[Dispatch] Client %s %s request: %s", req.ip(), req.method(), req.baseUrl()) + (Grasscutter.getConfig().DebugMode == ServerDebugMode.MISSING ? "(MISSING)" : "")); } res.send(response); } diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index 1a59cb9ad..b7e1e34ee 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -319,9 +319,6 @@ public final class DispatchServer { responseData.data.account.uid = account.getId(); responseData.data.account.token = account.generateSessionKey(); responseData.data.account.email = account.getEmail(); - if (responseData.data.account.email == null) { - responseData.data.account.email = ""; - } Grasscutter.getLogger() .info(String.format("[Dispatch] Client %s failed to log in: Account %s created", @@ -346,9 +343,6 @@ public final class DispatchServer { responseData.data.account.uid = account.getId(); responseData.data.account.token = account.generateSessionKey(); responseData.data.account.email = account.getEmail(); - if (responseData.data.account.email == null) { - responseData.data.account.email = ""; - } Grasscutter.getLogger().info(String.format("[Dispatch] Client %s logged in as %s", req.ip(), responseData.data.account.uid)); @@ -389,9 +383,6 @@ public final class DispatchServer { responseData.data.account.uid = requestData.uid; responseData.data.account.token = requestData.token; responseData.data.account.email = account.getEmail(); - if (responseData.data.account.email == null) { // null will trigger crash in some client - responseData.data.account.email = ""; - } Grasscutter.getLogger().info(String.format("[Dispatch] Client %s logged in via token as %s", req.ip(), responseData.data.account.uid)); diff --git a/src/main/java/emu/grasscutter/server/dispatch/json/LoginResultJson.java b/src/main/java/emu/grasscutter/server/dispatch/json/LoginResultJson.java index 88e142d4f..1f4dcd4b4 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/json/LoginResultJson.java +++ b/src/main/java/emu/grasscutter/server/dispatch/json/LoginResultJson.java @@ -16,7 +16,7 @@ public class LoginResultJson { public static class VerifyAccountData { public String uid; public String name = ""; - public String email; + public String email = ""; public String mobile = ""; public String is_email_verify = "0"; public String realname = "";