Web Hosting Talk







View Full Version : Anywhere to learn how to make a "basic" game control panel?


robgct
08-05-2004, 12:41 AM
I'm looking for anywhere to explain how to create a game control panel that's very basic - simply a start / stop and restart button based on login details entered into a MySQL database to see which server their running. I currently know PHP/MySQL and that's pretty much it. Are they any sites that detail this or would I have to figure it out on my own?

Thanks, yo. Keep it real.

SEATi
08-05-2004, 04:24 PM
Well, it's not really simple, as you would need to do a su to run the game as the proper user and also to be able to kill the process.

The "easy" way of doing it would be running all the games under "nobody" (or the user that runs apache) and using the system() function.

For more info read http://www.php.net/system

Hope this helps.

hiryuu
08-05-2004, 05:11 PM
suPHP can probably address the ownership issues. From there, the system function can launch it, and a kill command can stop it (obviously restart would do both). You may need something like start-stop-daemon to store the process ID (which you need for the kill).

robgct
08-05-2004, 06:18 PM
Thanks to both of you. Just what I needed.

leight
08-06-2004, 07:34 AM
what about apaches built in suexec to execute as the desired user.

Either way I recommend making 2 shell scripts, 1 to start the game, and 1 to stop the game, and then execute them using exec, or shell_exec

adidasrta
08-06-2004, 08:52 AM
are you trying to remotely execute the commands from another machine or is the 'basic cp' running on the same machine?

robgct
08-06-2004, 07:45 PM
it's runnign on the same machine.