1. Hey.

    So I'm working on a website which will allow me to control my rust server with a few basic functions (start, stop, restart, run a command) and so I need a way to run the commands from the webpage on the server.

    I can call system functions in windows from PHP, but I don't know how to get these to the server.
    Using
    Code:
     type "say hi" | RustDedicated.exe 
    just errors and writes a crash log.

    I also thought about a way in which I could achieve this by writing a plugin. I'm not sure how it could work, perhaps if you could call functions in the plugin from a batch file or directly from the php, or maybe if the plugin was constantly checking the data file for any text (which could be written by a batch script) and when there is some it runs it as a console command.

    If anyone has any ideas about this please drop them below.

    Thanks,
    PsychoTea
     
  2. Wulf

    Wulf Community Admin

    The best way to control the server from a page is using RCON, which there are PHP libraries available for.
     
  3. The ones I could find I couldn't get to work and I was pulling my hair out over.

    Instead I used the second method I posted which is working fine; I will explain all the details soon incase anyone else needs them.
     
  4. Alternatively if you're handy at PHP you can make something decent using webrequests quite easily, just be be sure there's a unique encrypted string that you can possibly generate and compare in PHP for security if you're going to do anything crazy.

    [TUTORIAL] Execute Actions from WebRequest [LUA/PHP] | Oxide