Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

_POST to plugin

Comments in 'Plugin Development' started by DarkN3ss, Apr 29, 2014.

  1. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    Hey there
    Does anyone know how I could receive a POST request in a plugin, form a website? e.g on a form on a website (www.example.com/form.php) sending a POST to the server 127.0.0.1:19123

    Thanks
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    You would have to open a socket in a separate thread maybe on port 8080 and then wait for post requests, I'm not exactly sure how you would parse them (probably not too tricky).
  3. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    There must be a way to open it on the same port the server is running on though because RCON and query both run oh that same port

    And by the way I'm going to be modding the src files so if I needed to make the class somewhere else to do this then that would be fine to

    So my problem, is that I'm clueless on how to do this XD
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    RCON runs on the TCP interface. Query runs on the UDP interface with the server though. By default ports are locked to the script once bound, there is a way to prevent this but I don't think it would have the desired effect.
  5. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,196
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    why dont u just locate the form.php directory and just linked it in the plugin.

    idk if this is possible but "/var/www/website/form.php"
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    What do you mean?
  7. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    I understand what you are trying to say but that won't work since the website with the form.php is not going to be hosted on the same server that the mcpe server is running on
  8. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Maybe get file contents via ftp?
  9. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    If you disable RCON there will be nothing locking 19132 on the TCP side. Then you could bind to it.
    DarkN3ss likes this.
  10. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    218
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
    You can do it wih cURL, i think
    DarkN3ss likes this.
  11. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    That's a good idea but the problem is that FTP is way to slow
  12. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    That would be good, but how?
  13. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    How would I bind it to that port though?
  14. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    So you can't port forward another port?
  15. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    218
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
  16. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    Thats correct, it needs to be running on the same port
  17. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61
    Opps sorry a bit of mixed communication, I know how to do that, I thought you meant there was a way to receive cURL POST within the server
  18. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    DarkN3ss likes this.
  19. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    DarkN3ss likes this.
  20. DarkN3ss
    Offline

    DarkN3ss Active Member Plugin Developer

    Joined:
    Dec 17, 2013
    Posts:
    143
    Plugins:
    7
    Minecraft User:
    DarkN3ss61

Share This Page

Advertisement