Jump to content

Remote Execution


Guest stil1
 Share

Recommended Posts

I'll start this off by saying I'm a relative newbie in most forms of programming and FTP commands.

I've written a script in hopes of remedying the lack of a true dedicated server for a game. It needs to be run on the remote computer to allow the client to shut down and start the server. I didn't realize that I couldn't run the file on the remote computer via FTP until after writing it.

Is there a way to run the file on the remote computer?

Link to comment
Share on other sites

One way this can work using FTP is to write a little "file watcher" program that runs on the server and watches a folder for changes to the files in it. When it notices a new file, it can do stuff based on the file and what's in it. For example, let's say you have a folder in your FTP server named "StartOrStopTheGame". In that folder is a file named "StartOrStop.txt". Now your server-side program watches that folder and checks the timestamp on the file every few seconds (say every 30 seconds). When it notices the file has been updated, it opens it and reads it. If the content of the file is "start" then the watcher program starts the game. If the content of the file is "stop" then it stops the game. Any other contents and it does nothing. Either way it updates it's memory of the timestamp and then goes back to watching for a change.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...