Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Win32 FDS » Custom Commands Plug-in
Re: Custom Commands Plug-in [message #390590 is a reply to message #390549] Sun, 14 June 2009 07:03 Go to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma:
General (5 Stars)
In the command function in the plugin use;

1) Running batch file
system <patch_to_batch_file>;


Asks the OS to execute the given file




2) Restarting FDS
system tskill server.dat


To stop server.dat (WARNING: tskill is a Windows XP system call which will stop ANY process with the given name or ID. The syntax above will stop ALL processes named server.dat, so if you have more than one server running it will kill them all. It also requires BRenBot to have admin rights or it wont have permission to call tskill).

This assumes you are using autorestart on the server, which will mean RenegadeServer.exe will relaunch the server.dat process automatically after this is called.


See replacement step below for a better method to perform this step.




3) Restarting BRenBot
exec brenbot.exe


Stops the current copy of BRenBot and launches a new copy.




References
System (Perl Function)
tskill (Windows XP system call)
Exec (Perl Function)




Edit : Replacement method for 2) Restarting FDS

Thinking about it, you could replace the tskill step with a simple RenRemCMD call to instruct the FDS to restart itself and sidestep the admin rights / multi server problems. Don't know why I didn't think of it first time around. Anyway, instead of that second code snippet regarding tskill above use;

plugin::RenRemCMD("restart");


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Sun, 14 June 2009 07:10]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: Changing the Host Name
Next Topic: Sponsor a server
Goto Forum:
  


Current Time: Sat Dec 21 02:45:25 MST 2024

Total time taken to generate the page: 0.00731 seconds