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

    iZanax

    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,
    Zanax
     
  2. Offline

    chasechocolate

  3. Offline

    fireblast709

    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

    Tvand227

    No mysql PLZ!
     
  5. Offline

    EcMiner

    I think mysql is the best solution
     
  6. Offline

    stuntguy3000

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

    keto23

    It is very possible to do this without MySQL.
     
  8. Offline

    ferrybig

    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

    LucasEmanuel

    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

    breezeyboy

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

    Minnymin3

    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

    Lolmewn Retired Staff

    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

    breezeyboy

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

    LucasEmanuel

    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

    Minnymin3

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

    Lolmewn Retired Staff

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

    gomeow

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

    EcMiner

    You could use dropbox and link to the banned players file

    But i should do msql
     
  19. Offline

    russjr08

    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..
    http://yoururl/getBanned.php?user=usernamehere
    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

    LucasEmanuel

    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

    russjr08

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

    Junrall

    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. Offline

    CaptainBern Retired Staff

  24. EDIT: Never mind, wont work
     
  25. Offline

    GodzOfMadness

    *facepalm*
     
Thread Status:
Not open for further replies.

Share This Page