SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.58k stars 1.11k forks source link

Live adding, removing, enabling, disabling servers #1240

Closed misiek08 closed 8 years ago

misiek08 commented 10 years ago

Is it possible to add to BungeeCord Plugin API and/or command to allow administrators change server config live? For example I have at average 1000-1500 players and restarting bungeecord to add few lobby servers for minigames is painful.

LaxWasHere commented 10 years ago

Add the server in config.yml the do /greload..

misiek08 commented 10 years ago

I saw in many places that /greload can cause bugs, unstability and other bad things. Are you sure is good way to do it?

stuntguy3000 commented 10 years ago

@misiek08 Don't do greload. @LaxWasHere is misinformed.

misiek08 commented 10 years ago

So what's the best way (if there is any way)?

I thought about writing such proxy by myself it I can't do such things with BC. I stick with it until now, because it's ready solution, but performance and resources usage it's bad from my point of view and features set it's like 70% of what proxy should contain :)

minecrafter commented 10 years ago

I'll give you a hint: ProxyServer.getServers() is mutable.

You can figure out how to do the rest, if you can develop a plugin.

misiek08 commented 10 years ago

Just adding servers to Configuration.servers will make them accessible after few seconds?

stefan01 commented 9 years ago

No, you have to write a custom BungeeCord Plugin. The right way to add a Server in a Plugin is the following:

public void addServerToBungee(String name, String adress, String motd, Boolean restricted)
{
        getProxy().getInstance().getServers().put(name, getProxy().getInstance().constructServerInfo(name, net.md_5.bungee.Util.getAddr(adress), motd, restricted));
}

Now you can just call the method "addServerToBungee()" to add a new Server. I didn't test it, but it should work.