mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-12 22:03:53 +00:00
shops stuffs
This commit is contained in:
@ -24,6 +24,7 @@ import me.totalfreedom.totalfreedommod.httpd.module.Module_permbans;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_players;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_punishments;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_schematic;
|
||||
import me.totalfreedom.totalfreedommod.httpd.module.Module_vpnbans;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -69,6 +70,7 @@ public class HTTPDaemon extends FreedomService
|
||||
module("players", Module_players.class, false);
|
||||
module("punishments", Module_punishments.class, true);
|
||||
module("schematic", Module_schematic.class, true);
|
||||
module("vpnbans", Module_vpnbans.class, true);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -0,0 +1,32 @@
|
||||
package me.totalfreedom.totalfreedommod.httpd.module;
|
||||
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.banning.VPNBanList;
|
||||
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
|
||||
public class Module_vpnbans extends HTTPDModule
|
||||
{
|
||||
|
||||
public Module_vpnbans(TotalFreedomMod plugin, NanoHTTPD.HTTPSession session)
|
||||
{
|
||||
super(plugin, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NanoHTTPD.Response getResponse()
|
||||
{
|
||||
File vpnbanFile = new File(plugin.getDataFolder(), VPNBanList.CONFIG_FILENAME);
|
||||
|
||||
if (vpnbanFile.exists())
|
||||
{
|
||||
return HTTPDaemon.serveFileBasic(new File(plugin.getDataFolder(), VPNBanList.CONFIG_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