remove legacy category system
This commit is contained in:
@ -41,35 +41,10 @@ function handleRequest(req, res) {
|
||||
} else if (requestUrl === '/publicConfig.json') {
|
||||
res.setHeader('Content-Type', 'application/javascript');
|
||||
|
||||
var categories = config.serverCategories;
|
||||
|
||||
// Legacy support for people without categories configured.
|
||||
if (!categories || Object.keys(categories).length === 0) {
|
||||
categories = {
|
||||
'default': 'All Networks'
|
||||
};
|
||||
}
|
||||
|
||||
for (var i = 0; i < servers.length; i++) {
|
||||
var entry = servers[i];
|
||||
|
||||
if (!entry.category) {
|
||||
entry.category = 'default';
|
||||
|
||||
logger.warn('%s has no category, defaulting!', entry.name);
|
||||
} else if (!categories[entry.category]) {
|
||||
logger.warn('%s has an unknown category (%s), defaulting!', entry.name, entry.category);
|
||||
|
||||
entry.category = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
var publicConfig = {
|
||||
categories: categories,
|
||||
graphDuration: config.graphDuration,
|
||||
servers: servers,
|
||||
bootTime: util.getBootTime(),
|
||||
categoriesVisible: config.categoriesVisible || false,
|
||||
serverTypesVisible: config.serverTypesVisible || false,
|
||||
minecraftVersions: minecraft.versions
|
||||
};
|
||||
|
Reference in New Issue
Block a user