Is this possible?

Discussion in 'Spigot Plugin Development' started by jay275475, Mar 30, 2015.

  1. Is it possible to send packets to a server from like a computer and have a plugin recive it and do something? Kinda like Buycraft anyone know where I can look for this? I was thinking about making a plugin that allows you to use your local host Internet to type in commands on online console and it would send a packet to the plugin that we'll check for them.
  2. I'm sure there's a way to do it. Do you mean like use your own windows cmd as a console?
  3. Not really I was hoping I could try to make some PHP script that can send stuff to a plugin that would dispatch commands.

    By Stuff I mean like packets or something.

    I could always just do something like this,
    where it puts what the person wants it to say?
  4. Can't access that link. Please explain to us more. It can probably be done.
  5. By that fact that you know something from PHP, I'm guessing you also know how to do something with MySQL ?

    Try to make a database with:

    Command_ID | Command_C | Command_Time | Command_Done
    1 | /say Hello | 10:50 31-3-2015 | false​

    and then make a repeating task for every minute. Then you go over the results you have, And when you dispatch the command with:
    Server.dispatchCommand("/say Hello");
    update the database:

    Command_ID | Command_C | Command_Time | Command_Done
    1 | /say Hello | 10:50 31-3-2015 | true​
    • Useful Useful x 1
  6. Ok thanks I'll try that :)
  7. If you need help just mention me! ;)

    This shouldn't be too hard to do. I can provide you with everything you need ;)
  8. it's possible, but you need open connection between your page (in PHP/Ruby/Whatever) and in your plugin...
    Read some stuff about sockets.

    But that can make some problems, you will need protect this connection (it will be simple if page is on this same host, so you can just block port)
  9. What your asking is can you make a plugin that creates a non-mc sub-server. This is possible java-wise, but I believe spigot/bukkit uses Java Security Manager and might block it. Best way to test would to find a open-source HTTP server for java and modify it to run as a plugin. Then try and connect to the server-site.
  10. Hey. I've decided to use MySQL and I've gotten it to work.
  11. #11 Coltll, Apr 1, 2015
    Last edited: Apr 1, 2015
  12. Thanks! I'm currently trying to find a way to log the console into a file or an array list.
  13. If you are working with a HTTP server, use just stick to URLs and URLConnections. No need to reimplement the HTTP protocol :p.
    Why not use a direct Connection :p?
  14. I was just thing about some simple socket connection, to sent data from web server to minecraft server, using Sockets, php should have some way to do that? (open a socket)
  15. thought you meant mc server -> web server, my bad :p. Yes, PHP has sockets.
  16. Just throwing some ideas around, there are many ways to achieve what the OP is asking.
  17. If you have SSH access you can always make PHP send shell commands by making a simple API or if your on a Linux PC then type ssh [email protected] [-p] for port.

    I'm also sure you can install something like this on Windows's.

    When hosting a minecraft server there is no point buying shared hosting because you can pick up a VPS with a shared i7 with 4gb ram for $5-6 from some hosts I know. Plus you have more control over your server and a IPv4 that you control meaning you can put your minecraft server on any port.