Support for separate Classic html folder.

This commit is contained in:
MobiusDev 2015-05-01 12:08:41 +00:00
parent d2b5c5fc4a
commit b5da915fd8
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,6 @@
All files that are located in this folder will replace the ones from the html folder.
Any additional files in this folder they will work as well as if they where in the html folder.
WARNING
LazyCache config at General.properties must be set as False

View File

@ -137,7 +137,13 @@ public class AdminReload implements IAdminCommandHandler
{
final String path = st.nextToken();
final File file = new File(Config.DATAPACK_ROOT, "data/html/" + path);
if (file.exists())
final File file_classic = new File(Config.DATAPACK_ROOT, "data/html_classic/" + path);
if (Config.SERVER_CLASSIC_SUPPORT && file_classic.exists())
{
HtmCache.getInstance().reload(file_classic);
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Htm File:" + file_classic.getName() + ".");
}
else if (file.exists())
{
HtmCache.getInstance().reload(file);
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Htm File:" + file.getName() + ".");

View File

@ -114,7 +114,8 @@ public class HtmCache
return null;
}
final String relpath = Util.getRelativePath(Config.DATAPACK_ROOT, file);
String relpath = Util.getRelativePath(Config.DATAPACK_ROOT, file);
relpath = relpath.replace("_classic", "");
String content = null;
try (FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis))