mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2026-06-05 02:46:54 +00:00
fuck you super there is development
This commit is contained in:
@@ -12,6 +12,7 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.HTTPDModule;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_activitylog;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_admins;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_bans;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_dump;
|
||||
@@ -58,6 +59,7 @@ public class HTTPDaemon extends FreedomService
|
||||
|
||||
// Modules
|
||||
modules.clear();
|
||||
module("activitylog", Module_activitylog.class, true);
|
||||
module("admins", Module_admins.class, true);
|
||||
module("bans", Module_bans.class, true);
|
||||
module("dump", Module_dump.class, true);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package me.totalfreedom.totalfreedommod.httpd.module;
|
||||
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.admin.ActivityLog;
|
||||
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
|
||||
public class Module_activitylog extends HTTPDModule
|
||||
{
|
||||
|
||||
public Module_activitylog(TotalFreedomMod plugin, NanoHTTPD.HTTPSession session)
|
||||
{
|
||||
super(plugin, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NanoHTTPD.Response getResponse()
|
||||
{
|
||||
File activityLogFile = new File(plugin.getDataFolder(), ActivityLog.FILENAME);
|
||||
if (activityLogFile.exists())
|
||||
{
|
||||
return HTTPDaemon.serveFileBasic(new File(plugin.getDataFolder(), ActivityLog.FILENAME));
|
||||
}
|
||||
else
|
||||
{
|
||||
return new NanoHTTPD.Response(NanoHTTPD.Response.Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT,
|
||||
"Error 404: Not Found - The requested resource was not found on this server.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user