addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Tue Jan 08, 2013 18:42 Post subject: |
|
|
Now that you post that, I realize how horrible Windows is for automation compared to its unix rivals.
Hmmmmmmmmm. Welll, let's see.
You could use event scheduler, I forget if there is a Microsoft one with the OS or a 3rd party one you can download, since I don't use those things, but I remember seeing MS had one awhile back.
The first thing you'll want is a batch file to run, and its going to call a program called taskkill -- you're going to axe the watchdog so your server doesn't try to restart while your computer is shutting down.
The second thing you'll want is to run a mysql command line and stuff a SQL statement into your database (and setup NWNX to check for it later). You may be able to do this with a pipe (|) directive to cmd in your batch file using type. Basically, the file typed would contain your SQL statements, and a command to exit the mysql prompt. This is sort-of-similar to "cat" in Unix. I'm sure this will not be good to you -- play around with it, and you may have to use something else instead of cmd (or type, for that matter).
Thirdly your server's heartbeat npc presumably every 15 mins or so will check to see if a reboot order is in the DB. If it is, he shouts and does the shutdown sequence and gives players time to logoff. Finally, the server shuts down.
Using an event manager, the one that fired your batch file, (and you have everything perfectly timed that hte NWN server should be shut down by now) you tell the system to reboot.
I think using msconfig - and very carefully I should add - I think you can create startup directives when your computer boots. You can then put in your remaining goals of defrag and load nwnx.
There is probably a cleaner way to do it. In fact, I'd bet on it. |
|