- #!/usr/bin/perl
- use strict;
- use warnings;
- use threads;
- my (@exes,$nr,%threads,%subs);
- push @exes, 'Binary/LoginServer.exe login.conf';
- push @exes, 'Binary/CharServer.exe char.conf';
- push @exes, 'Binary/WorldServer.exe world.conf';
- foreach my $exe (@exes) {
- $nr++;
- my ($dir,$file) = ('.',$exe);
- if ($file =~ /\//) {
- ($file,$dir) = split(/\//,reverse($exe),2);
- $file = reverse($file);
- $dir = reverse($dir);
- }
- $subs{$nr} = sub {
- chdir($dir);
- while (1) {
- system($file);
- sleep 3;
- }
- };
- $threads{$nr} = threads->new(\&{$subs{$nr}});
- sleep 1;
- }
- sleep;
This script spawns a thread for each executable and runs it in there. Its written in Perl, and you would need that to run it (http://www.activestate.com/store/activeperl/download/).
It also restarts any executable that exits.
Just save this as "launcher.pl" or something ending in ".pl" and place it in your osROSE directory (not the binary dir).
You'll probably have to change the name of the configuration files in the top (at the end of the "push" lines).