diff --git a/src/buttondevteam/website/ButtonWebsiteModule.java b/src/buttondevteam/website/ButtonWebsiteModule.java
index f232878..a219aab 100644
--- a/src/buttondevteam/website/ButtonWebsiteModule.java
+++ b/src/buttondevteam/website/ButtonWebsiteModule.java
@@ -119,7 +119,7 @@ public class ButtonWebsiteModule extends JavaPlugin {
((Runnable) server::start).run(); // Totally normal way of calling a method
this.getLogger().info("Webserver started");
final Calendar calendar = Calendar.getInstance();
- if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY) { // Only update every week
+ if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY && !TBMCCoreAPI.IsTestServer()) { // Only update every week
Thread t = new Thread(() -> AcmeClient.main("server.figytuna.com"));
t.setContextClassLoader(getClass().getClassLoader());
t.start();
diff --git a/src/buttondevteam/website/io/IOHelper.java b/src/buttondevteam/website/io/IOHelper.java
index 156983c..faae178 100644
--- a/src/buttondevteam/website/io/IOHelper.java
+++ b/src/buttondevteam/website/io/IOHelper.java
@@ -72,14 +72,9 @@ public class IOHelper {
/**
* Sends login headers and sets the session id on the user
- *
- * @param exchange
- * @param user
*/
public static void LoginUser(HttpExchange exchange, WebUser user) {
Bukkit.getLogger().fine("Logging in user: " + user);
- // provider.SetValues(() ->
- // user.setSessionid(UUID.randomUUID().toString()));
user.sessionID().set(UUID.randomUUID());
new Cookies(2).add(new Cookie("user_id", user.getUUID() + ""))
.add(new Cookie("session_id", user.sessionID().get().toString())).SendHeaders(exchange);
@@ -97,9 +92,9 @@ public class IOHelper {
.SendHeaders(exchange);
}
- public static void Redirect(String url, HttpExchange exchange) throws IOException {
+ public static Response Redirect(String url, HttpExchange exchange) throws IOException {
exchange.getResponseHeaders().add("Location", url);
- IOHelper.SendResponse(303, "If you can see this, click here to continue", exchange);
+ return new Response(303, "If you can see this, click here to continue", exchange);
}
public static Cookies GetCookies(HttpExchange exchange) {
diff --git a/src/buttondevteam/website/page/Page.java b/src/buttondevteam/website/page/Page.java
index 66633f8..4128e8f 100644
--- a/src/buttondevteam/website/page/Page.java
+++ b/src/buttondevteam/website/page/Page.java
@@ -34,7 +34,7 @@ public abstract class Page implements HttpHandler {
str.print("");
IOHelper.SendResponse(500, baos.toString("UTF-8"), exchange);
} catch (Exception e1) {
- e1.printStackTrace();
+ TBMCCoreAPI.SendException("Exception while sending Internal Server Error in ButtonWebsiteModule!", e1);
}
}
}