Hub
hub is what Minefort tells its own hub: the portals of the experience grounds and the staff. Never the servers or the hubs: the hub browses them with network.browse, and its hubs with network.instances, and asks the count with network.online. On a server that is not a hub, every list is empty.
v0.1.0
task.spawn(function()
for _, s in network.browse('featured') or {} do print(s.name, s.players) end
for _, e in hub.experiences() do print(e.slot, e.experience) end
for _, h in network.instances() or {} do print(h.name, h.players) end
print(network.online())
end)
hub.role(player)returns the player’s rank on Minefort:"owner","admin","moderator"or"builder", and nil for everyone else. It also takes a uuid, with or without dashes.- Minefort sends the ranks every minute. Anywhere but a hub, they are nil.
hub.role(player)returns the player’s rank on Minefort:"owner","admin","moderator"or"builder", and nil for everyone else. It also takes a uuid, with or without dashes. Minefort sends the list every minute, so a new rank reaches the hub within one. Anywhere but a hub, it is nil.hub.experiences()returns a list of{slot, experience, title, pitch, icon, banner, players}.experienceis the name/playtakes. A slot that is not in the list has no experience.- A
banneris a 1024×512 PNG its creator uploaded and Minefort checked: 8 by 4 maps. Read it withhttp.get(banner, { cache = 86400 }):image(); a new banner has a new URL, so the cache never shows an old one. hub.rent(player, slot, product, experience)offers a portal of the grounds for Gems, likeshop.prompt:productis one of the hub’s rentals, such asportal_24h, andexperiencethe name/playtakes of any published experience, which the portal then leads to. It returns a request id, or nil;shop.on_paidhands the purchase over. Renting your own portal again adds time, and may leaveexperienceout to keep what it shows.hub.point(player, slot, experience)turns the player’s own live portal to another published experience, as often as they like. It returns whether it did.- Minefort decides who may rent or point what: a stand someone else holds, or a name that is no published experience, is a no. Anywhere but its hub, every answer is no.
- Minefort keeps the lists up to date. The first call of
experienceswaits at most two seconds for them, so call it from a task.