Skip to content

Instantly share code, notes, and snippets.

@Bibliofile
Last active December 5, 2018 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bibliofile/dd1c463c606d16c05ae7487e69c5329f to your computer and use it in GitHub Desktop.
Save Bibliofile/dd1c463c606d16c05ae7487e69c5329f to your computer and use it in GitHub Desktop.
// @ts-check
/**
* @typedef Server
* @property {string} name
* @property {string} link
* @property {string} owner
* @property {boolean?} expert
* @property {'Survival' | 'Custom'} type
* @property {'cloud' | 'mac'} host
* @property {string | string[]} theme
* @property {{[k: string]: string}} rules
*/
const { readFileSync } = require('fs')
const json = JSON.parse(readFileSync('servers.json', 'utf-8'))
const servers = json.sort((a, b) => a.name.localeCompare(b.name))
/** @param {Server} server */
function formatServer(server) {
return `[${server.name}](${server.link}) by ${server.owner}`
}
/**
* @param {string} theme
* @returns {(server: Server) => boolean}
*/
function byTheme(theme) {
return server => (Array.isArray(server.theme) ? server.theme : [server.theme]).includes(theme)
}
const themes = new Set()
const tpRules = new Set()
for (const s of servers) {
for (const theme of Array.isArray(s.theme) ? s.theme : [s.theme]) {
themes.add(theme)
}
tpRules.add(s.rules["trade portals"])
}
/**
* @param {(server: Server) => boolean} filter
* @param {string} title
*/
function serversBy(filter, title = 'Servers') {
return `<details><summary>${title}</summary>
${servers
.filter(filter)
.map(formatServer)
.join('\n')}
</details>`
}
/** @param {string} text */
function formatTitle(text) {
return text.split(' ').map(word => word[0].toUpperCase() + word.substr(1)).join(' ')
}
const post = `
It can sometimes be difficult to find a server that you like. The "random join" option only works if someone is online when you are looking, and doesn't catch Mac servers.
This thread organizes most active forum servers into categories so that you can easily find ones you are interested in. I've also organized the servers based on Survival / Custom rules and based on a few custom rules. Enjoy! If you think I missed something obvious, or I made a mistake, please let me know! (I'd kind of like to add some more server themes, as a few servers didn't really fit into any category perfectly)
Note: Servers were chosen by looking at threads in #multiplayer that have >10 replies and have been active within a month. If I missed a server that you'd like added, let me know! I've skipped servers which don't have a substantive OP as I didn't have time to join all the servers to get a feel for their theme. Servers by banned users have not been included.
### Servers by theme
${Array.from(themes)
.map(theme => serversBy(byTheme(theme), theme))
.join("\n")}
### Expert servers
${serversBy(s => s.expert)}
### Custom servers
${serversBy(s => s.type === "Custom")}
### Survival servers
${serversBy(s => s.type === "Survival")}
### Cloud servers
${serversBy(s => s.host === "cloud")}
### Mac servers
${serversBy(s => s.host === "mac")}
### Servers with PVP on
${serversBy(s => s.rules.pvp === "on")}
### Servers with PVP off
${serversBy(s => s.rules.pvp === "off")}
### Servers by size
${["1/16x", "1/4x", "1x", "4x", "16x"]
.map(size => serversBy(s => s.rules.size === size, size))
.join("\n")}
### Servers by TP rules
${Array.from(tpRules)
.map(rule =>
serversBy(s => s.rules["trade portals"] === rule, formatTitle(rule))
)
.join("\n")}
### All servers
${serversBy(() => true)}
---
Generated with [this script]() and hand built JSON.
---
Part of the [2018 Advent Calendar](https://forums.theblockheads.net/t/the-2018-blockheads-advent-calendar/73937)
`;
console.log(post)
[
{
"name": "Comfort&Joy",
"link": "https://forums.theblockheads.net/t/cloud-server-world-comfort-joy/72906",
"owner": "Lizzie1",
"type": "Custom",
"expert": true,
"host": "cloud",
"theme": "Survival",
"rules": {
"pvp": "off",
"size": "16x",
"health": "one hit kill",
"trade portals": "disabled"
}
},
{
"name": "Nzima",
"link": "https://forums.theblockheads.net/t/server-world-nzima/71590",
"owner": "Lizzie1",
"type": "Survival",
"expert": true,
"host": "cloud",
"theme": "Survival",
"rules": {
"pvp": "off",
"size": "16x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "Outside The Blocks",
"link": "https://forums.theblockheads.net/t/mac-server-outside-the-blocks/67366",
"owner": "Donutask",
"type": "Custom",
"host": "mac",
"theme": ["Survival", "Economy", "PVP"],
"rules": {
"pvp": "on",
"size": "16x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "GIANTS",
"link": "https://forums.theblockheads.net/t/cloud-server-giants-thrive-like-a-giant/64545",
"owner": "Brer-Rabbit",
"type": "Custom",
"host": "cloud",
"theme": ["Survival", "Economy", "Building"],
"rules": {
"pvp": "off",
"size": "4x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "SUGARFLOP",
"link": "https://forums.theblockheads.net/t/cloud-world-sugarflop/70580",
"owner": "Sugarflop",
"type": "Survival",
"host": "cloud",
"theme": "Economy",
"rules": {
"pvp": "off",
"size": "16x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "PVP Search",
"link": "https://forums.theblockheads.net/t/pvp-search-opens-on-december-14/72733",
"owner": "GoodGradesBoy",
"type": "Custom",
"host": "mac",
"theme": "PVP",
"rules": {
"pvp": "on",
"size": "1/16x",
"health": "normal",
"trade portals": "sell only"
}
},
{
"name": "Griffen-land",
"link": "https://forums.theblockheads.net/t/griffen-land-by-killerender120y-4-years-old/72056",
"owner": "Legoboy70",
"type": "Custom",
"host": "cloud",
"theme": "Building",
"rules": {
"pvp": "off",
"size": "16x",
"health": "normal",
"trade portals": "10% higher when buying"
}
},
{
"name": "Regia",
"link": "https://forums.theblockheads.net/t/whitelist-removed-mac-world-regia/73234",
"owner": "bleatingsheep39",
"type": "Custom",
"host": "mac",
"theme": "Survival",
"rules": {
"pvp": "off",
"size": "1/16x",
"health": "easy",
"trade portals": "buy and sell prices equal"
}
},
{
"name": "Survivor",
"link": "https://forums.theblockheads.net/t/survivor/73807",
"owner": "YousifDuck1",
"type": "Survival",
"expert": true,
"host": "cloud",
"theme": ["Survival", "PVP"],
"rules": {
"pvp": "on",
"size": "16x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "UNIHORSE",
"link": "https://forums.theblockheads.net/t/cloud-world-unihorse/47980",
"owner": "UNIHORSE",
"type": "Survival",
"host": "cloud",
"theme": ["Building", "Survival"],
"rules": {
"pvp": "off",
"size": "4x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "War of a Lifetime",
"link": "https://forums.theblockheads.net/t/new-server-war-of-a-lifetime/73704",
"owner": "Connor15",
"type": "Custom",
"host": "mac",
"theme": "PVP",
"rules": {
"pvp": "on",
"size": "16x",
"health": "normal",
"trade portals": "10% higher when buying"
}
},
{
"name": "Ailes",
"link": "https://forums.theblockheads.net/t/ailes/63019",
"owner": "agentpinkdog",
"type": "Custom",
"host": "cloud",
"theme": ["Survival", "Economy"],
"rules": {
"pvp": "off",
"size": "1/4",
"health": "hard",
"trade portals": "disabled"
}
},
{
"name": "Skylands Arena",
"link": "https://forums.theblockheads.net/t/cloud-world-skylands-arena/13180",
"owner": "jemnidad",
"type": "Custom",
"host": "cloud",
"theme": "Survival",
"rules": {
"pvp": "off",
"size": "4x",
"health": "easy",
"trade portals": "normal"
}
},
{
"name": "Wolf Return",
"link": "https://forums.theblockheads.net/t/server-world-wolf-return/73411",
"owner": "The_Fading_Star",
"type": "Custom",
"host": "cloud",
"theme": ["Survival", "PVP"],
"rules": {
"pvp": "on",
"size": "16x",
"health": "normal",
"trade portals": "jobs only"
}
},
{
"name": "Pixmilla",
"link": "https://forums.theblockheads.net/t/cloud-world-pixmilla-by-milla-pixel-art-world/54161",
"owner": "milla",
"type": "Custom",
"host": "cloud",
"theme": "Building",
"rules": {
"pvp": "off",
"size": "1x",
"health": "infinite",
"trade portals": "everything free"
}
},
{
"name": "Skeeve's Gigantic Empire",
"link": "https://forums.theblockheads.net/t/cloud-world-skeeves-gigantic-empire/8295",
"owner": "Skeeve",
"type": "Survival",
"host": "cloud",
"theme": ["Survival", "Building"],
"rules": {
"pvp": "off",
"size": "16x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "Skeeve's Exile",
"link": "https://forums.theblockheads.net/t/skeeves-exile-announcing-the-first-expert-mode-world-of-1-7/64855",
"owner": "Skeeve",
"type": "Custom",
"expert": true,
"host": "cloud",
"theme": "Survival",
"rules": {
"pvp": "off",
"size": "16x",
"health": "one hit kill",
"trade portals": "normal"
}
},
{
"name": "Moonlight lanterns",
"link": "https://forums.theblockheads.net/t/cloud-world-moonlight-lanterns/13404",
"owner": "alice311_21",
"type": "Custom",
"host": "cloud",
"theme": "Building",
"rules": {
"pvp": "on",
"size": "4x",
"health": "normal",
"trade portals": "normal"
}
},
{
"name": "Skylands Odyssey",
"link": "https://forums.theblockheads.net/t/custom-cloud-world-skylands-odyssey/18319",
"owner": "jemnidad",
"type": "Custom",
"host": "cloud",
"theme": ["Building"],
"rules": {
"pvp": "off",
"size": "1x",
"health": "normal",
"trade portals": "everything free"
}
},
{
"name": "Rabbithole",
"link": "https://forums.theblockheads.net/t/ancient-server-rabbithole/4529",
"owner": "jemnidad",
"type": "Survival",
"host": "cloud",
"theme": ["Building", "Survival"],
"rules": {
"pvp": "off",
"size": "1x",
"health": "normal",
"trade portals": "normal"
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment