Share 1 banned-players.txt with multiple Servers

Discussion in 'Plugin Development' started by iZanax, Jan 17, 2013.

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


    Is it possible to share banned-players with multiple Servers?

    Because PlayerLoginEvent seems to do always a check in those files, to see if the player is banned.
    So it would be really easy and efficient if I could add a player to this banned-players from one server and other servers will block the player also.

    But the big question is, Is this possible?
    yes? --> How?
    no? --> What should be the best solution to block the same players on multiple servers?

    Thanks in advance,
  2. Offline


  3. Offline


    chasechocolate I have been discussing this with him on skype. The point was how to keep things updated correctly
    iZanax how about keeping an async timer task checking the MySQL database, and use a CopyOnWriteArrayList updated
  4. Offline


    No mysql PLZ!
  5. Offline


    I think mysql is the best solution
  6. Offline


    You are not even the OP. This isn't the right place to pull the impossible off.
    zachoooo likes this.
  7. Offline


    It is very possible to do this without MySQL.
  8. if you use a shared file for this, you can get problems that the other process wnt know it, and you cant use it across multiple pcs
  9. Offline


    Sharing one single file between several servers sounds like a nightmare, just think about the synchronisation problems you will get and all those threads using the file at the same time will most certainly corrupt it very fast.

    The safest and best solution in sharing data between servers is using a database. I'd recommend MySQL since it's free and very easy to work with. :)
    justcool393 likes this.
  10. Offline


    You could setup plugins to send messages to each other.
  11. Offline


    What about if you set up a file on a website / on github (maybe a dummy account) and when the banlist changes upload the name to the server. Then run a bukkitrunnable every few minutes to refresh the banlist? That should work...

    Edit: Awesome idea btw!

    Edit 2: And btw if you are going with a read & write system you might want openly distribute the read plugin file but selectively distribute the read/write plugin file
    breezeyboy likes this.
  12. Offline


    You could use plugins that have a big database of bans, such as MCBans (not sure if that's still a good choice, heard they had issues, don't know about em though)
  13. Offline


    MCBans is a closed DB from what I understand :/
  14. Offline


    Databases are designed for this sort of thing, they are used to store/share data between all sorts of applications.

    Using a website/connecting to github seems to be a huge mess. I don't understand why you don't want to work with a database since it will just be way easier then sharing a textfile.

    You still use a runnable to check the database periodically for new entries.
    breezeyboy likes this.
  15. Offline


    I was just providing an alternative to databases...
  16. Offline


    Well yeah, but the API checks it, making it unnecessary to have DB details.
  17. Offline


    A database would be the way to go imo
  18. Offline


    You could use dropbox and link to the banned players file

    But i should do msql
  19. Offline


    Hmm... I would say that if you have a MySQL + PHP server, you could do a bit of scripting to have a url return a boolean..
    Which would return a true / false. You can check this URL on the PlayerLoginEvent, and if it returns true, add them to the ban list. If it returns false, attempt to remove a ban on them. (Does Bukkit throw an error if you unban a non-banned player?)

    Then on the PreProcessCommandEvent just listen for /ban and /unban and then call http://yoururl/setBanned.php?user=usernamehere

    and set it to true or false.

    The security on this is really low, because if someone figures out these URLs.. They would have the ability to ban / unban a user at will.

    These are just ideas. Feel free to expand on them. Probably missing something, but hey, its 8 AM and I haven't had my coffee.
  20. Offline


    No need for a middlehand to do the communication with the database. A plugin can just as easily connect directly to the database. :)
  21. Offline


    Well, that is depending on both servers access to the database. ;)
  22. Offline


    Using a file over a database is a bad idea... a database is much more secure than a flat file! Not to mention what would happen with "file open" errors.
  23. EDIT: Never mind, wont work
  24. Offline


Thread Status:
Not open for further replies.

Share This Page