Get chat and send it to website

Discussion in 'Plugin Development' started by qwertyjl, Dec 3, 2013.

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

    qwertyjl

    I am making a plugin to get the chat contents and upload it to a PHP script on my website, that will then display the chat to the website's viewers. The PHP listener simply takes information transmitted by the HTTP method, POST, and turns it into something readable through a browser. I would also like it to send what EssentialsChat sends to the client (ex. "&1[GameMaker]&r &6Notch&7: &rI made this game!"). But, I don't know how to take the chat contents and enclose them in an HTTP request or get the chat contents after (Or even before) EssentialsChat modifies it. Any help would be great. I would also be okay with using the HTTP method, GET.
     
  2. Offline

    Bart

    Plugin - Take the chat from the bukkit server and store on a MySQL database.
    PHP - Read from the database and display as you wish.
     
  3. Offline

    qwertyjl

    Not really.
    Plugin - Take chat and send it to Webserver in an HTTP POST (or GET) request.
    PHP - Read and process request, then output to file for the website's viewer to read.
     
  4. Offline

    Plo124

    qwertyjl What I did for my web-chat is I listen to the AsyncPlayerChatEvent, and then add it to an arraylist, and every 5 seconds, I would (Asyncronously, so it doesn't lag the server,) POST the data to a php file, which would write to the file, and then the browser would load the file in an iframe, and every 5 seconds, the browser would then read the file and display.

    There are some downsides:
    - Even the Async tasks did end up crashing my server
    - With Async Tasks, they don't send instantly, so it might be 5 seconds before it sends, which could potentially break the 5-second timer for that time, giving a repeat for the client.
    - If the server is down, it keeps displaying blank lines to the browser
    - Its not secure, once you know the file location, you can view the chat as you wish (but that isn't much of a security risk, unless its listening in on people's /msg's e.t.c)
     
  5. Offline

    HyrulesLegend

    I know Sushi just adores PHP.
     
  6. Offline

    Sushi

    ayy lmao
     
  7. Offline

    Not2EXceL


    POST 'ing the data leaves open vulnerabilities. plugin => sql db => php is faster and more efficient and fewer vulns
     
  8. Offline

    Plo124

    Not2EXceL
    Yeah, but its quicker for me to code :p
     
Thread Status:
Not open for further replies.

Share This Page