Save ban to a variable?

Discussion in 'Plugin Development' started by TheNoobiestCrafters, Nov 23, 2012.

Thread Status:
Not open for further replies.
  1. Is there a way I can save the data of a ban in a String variable to pass it on to an online PHP script and have the PHP script write the variable to a text file?
     
  2. Offline

    fireblast709

    why doing it like that? (you can just ban people with player.setBanned(true);)
    Anyway, if you want to send it to an online PHP script, you would end up sending data to an url.
    - Just before anyone tells you this, do NOT use GET transfer in this way, use POST (which is safer) and preferably an encryption (just in case)-

    http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html all you need is in here, just ask any questions that come ahead on here :3
     
  3. I need to do this to save a ban scrypt online. My plan is when a player is banned, they're locally banned first. But then the ban data is sent to an online banlist and the list is downloaded by my two servers using the plugin every heart beat (every 60 seconds).
     
  4. Offline

    fireblast709

    Then use the link I posted
     
  5. Offline

    Adriani6

    Get something like easyban, use it with mysql database, I can write you a php script to show the bans online.
     
  6. Offline

    Royal_Soda

    If I were you, I'd listen for the /ban command, then grab args[2] and on, store in a String variable, using a for loop. Set the player as banned, and kick the player for the same String. Then you could save the String into a file.

    Keep in mind, many plugins already store ban data into a database, which is easily accessible via PHP.
     
  7. Can't we just stick to my original plan? I could do that a lot easier, I just need to pass the bans onto the PHP script to pass on to the online banlist. This is what Milkyway suggested.
     
  8. Offline

    fireblast709

    ^
     
Thread Status:
Not open for further replies.

Share This Page