Modify Player Count

Discussion in 'Plugin Development' started by TheMcScavenger, Apr 16, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    TheMcScavenger

    Hi,

    A friend of mine is involved in a community, that recently opened up their fourth server. It basically consists of three regular servers, and a mini games server. At the moment the servers are all running by itself, on the one machine. Plans are to connect them all using BungeeCord, along with a hub to travel to each of them.

    I've been asked to create a number of plugins, of which I've got most done. I've been trying to keep it simple. Basically, I'm making use of YAML files and MySQL at the moment (server status, etc.).

    At the moment, I'm storing some information about all servers on a local MySQL server (status, player count, uptime, etc.), which is put on signs in the hub. The one thing I still have to do is change the actual player count of the hub. The idea is to make the hub have the total player count from all servers combined.

    Like I said, I have no problem storing the player count per server, nor in total, but I need a way to change it in the Multiplayer Server List. I've read a lot of threads about this specific thing, and I know of some servers that use it. I've found some code using ProtocolLib to add packet listeners... Is this the only way to do it?

    https://forums.bukkit.org/threads/fake-the-multiplayer-menu-online-list.95594/page-2

    Regards
     
  2. Offline

    qlimax5000

    TheMcScavenger
    When setting up BungeeCord there's a config, in there you can player amount. BungeeCord also allows a function to show all online players as 1 server on the Multiplayer Menu. So to put it simple.. Install BungeeCord.

    Funergy
    Wow, relax. Don't lock it since he didn't specificly said the he was using it. He said he's still on normal Bukkit, I mentioned that he should use BungeeCord, not him. As of right now, his question is valid and shouldn't be locked.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  3. Offline

    Funergy

    Fail he said in hist post that he was using it. and playercount is completely handled by bungeecord
     
  4. Offline

    qlimax5000

    Funergy
     
  5. Offline

    Funergy

    Yeah but the answer is in Bungeecord. The ip from bungeecord is the one you use in you server list. not the Hub server or another gamemode. If you connect to the bungeecord it will send you to the default server or to the last server you was on. Bungeecord handles the playercount

    I thought the popular servers didn't set the default server(the hub) they made a plugin for bungeecord that when a player connects he will teleport to the hub server.

    And I think this will not set the players from the hub but the players on the whole network.
    If this isn't right Tahg me. I'm not sure if this right

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  6. Offline

    qlimax5000

    Funergy
    I'm aware of this. I run a BungeeCord server for a friend, but what are you saying with this?
    All i said was that there's no to lock the thread since he stated that as of now doesn't use an unofficial build.
     
  7. Offline

    TheMcScavenger

    qlimax5000 Funergy The plans are indeed to use BungeeCord, but I should've probably been more clear. The three main servers are one BungeeCord Connection, and the MiniGames Server is one BungeeCord Connection. I'm not sure exactly how they're going to be connecting the two BungeeCord Connections, and honestly, I try not to get too involved in that (they've been messing with Spigot jars for a while now...).

    I need to get both the player count from the three main servers and the player count from the individual mini games servers, add them up, and use that as the player count on the hub. I have the way to get the player count, I have it stored in a MySQL Database, and I have a method set up to retrieve it at a set interval. I just need:
    • A way to tell the server that it needs to refresh the player count (get it from the DB)
    • A way to set the player count in the multiplayer menu
     
  8. Offline

    qlimax5000

    TheMcScavenger
    Wait.. So you wanna have a hub.. Acting as a portal to 2 different proxy networks? And then display the player amount of both the different networks as 1 on the off-network hub?
    The player amount shouldn't be TOO hard, but having 1 off-network hub connecting to 2 different networks.. I don't that's possible..
     
  9. Offline

    TheMcScavenger

    Every server / network handles it connection and ideas in its own way. I don't know exactly how other major networks do it, and it really doesn't matter, right? Basically, players can connect to one hub server (from which the player count has to be set and updated), from which they can connect to the four servers. One of those will allow them to choose mini games, sending them to yet another server.

    No problems regarding usage / lag, it's a 48Gb Quad-Core E3 or E5 (don't remember :p).

    Once again, it's not my network, and I'm not sure how it'll work exactly. I just need to know how to set the player count, and update it (sending update packets to a server?)..

    Even if it isn't possible with the current system, they might be able to get it to work ;)

    I've found this topic, read around a bit, but couldn't get it to work. Is it me, or is the method no longer working?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page