Jckf's server launcher

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Jckf's server launcher

Postby Jckf on Sun Jan 13, 2008 4:18 pm

This isn't anything fancy, but it does the job for me, and I don't have to have all three windows open.
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).

  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use threads;
  5.  
  6. my (@exes,$nr,%threads,%subs);
  7.  
  8. push @exes, 'Binary/LoginServer.exe login.conf';
  9. push @exes, 'Binary/CharServer.exe char.conf';
  10. push @exes, 'Binary/WorldServer.exe world.conf';
  11.  
  12. foreach my $exe (@exes) {
  13.     $nr++;
  14.     my ($dir,$file) = ('.',$exe);
  15.     if ($file =~ /\//) {
  16.         ($file,$dir) = split(/\//,reverse($exe),2);
  17.         $file = reverse($file);
  18.         $dir = reverse($dir);
  19.     }
  20.     $subs{$nr} = sub {
  21.         chdir($dir);
  22.         while (1) {
  23.             system($file);
  24.             sleep 3;
  25.         }
  26.     };
  27.     $threads{$nr} = threads->new(\&{$subs{$nr}});
  28.     sleep 1;
  29. }
  30. sleep;
  31.  


You'll probably have to change the name of the configuration files in the top (at the end of the "push" lines).
User avatar
Jckf
Antares
Antares
 
Posts: 338
Joined: Wed Nov 28, 2007 1:09 am
Location: Norway

Re: Jckf's server launcher

Postby psychoshooter on Tue Jan 15, 2008 5:36 pm

hehe it works fine indeed i like the 1 window too :D

so it restarts the server as soon as it crashes or something?

EDIT:
found out myself it worked fine hehe.
only when it has the send or don't send error i first must press 1 of the 2 buttons before it closes, is there a possibility to do not let the msg appear but standard the choise is don't send.

greets psycho
Image
User avatar
psychoshooter
Lucky Ghost
Lucky Ghost
 
Posts: 572
Joined: Thu Sep 27, 2007 11:08 pm
Location: The Netherlands

Re: Jckf's server launcher

Postby Jckf on Tue Jan 15, 2008 8:00 pm

psychoshooter wrote:hehe it works fine indeed i like the 1 window too :D

so it restarts the server as soon as it crashes or something?

EDIT:
found out myself it worked fine hehe.
only when it has the send or don't send error i first must press 1 of the 2 buttons before it closes, is there a possibility to do not let the msg appear but standard the choise is don't send.

greets psycho

I don't understart your problem. Please rephrase.
User avatar
Jckf
Antares
Antares
 
Posts: 338
Joined: Wed Nov 28, 2007 1:09 am
Location: Norway

Re: Jckf's server launcher

Postby psychoshooter on Tue Jan 15, 2008 8:07 pm

well there ain't a problem with your launcer/rebooter.
i use him with osirose btw.

in osirose there is still a bug that if you attack a monster in prison your world server will crash.
and i get the window from windows, it says a couple of things such as that he made a log file and if i want to send it to microsoft.
then you can choose for Send or Don't send.
but as long as i don't click any of this the server won't shutdown and your program won't reboot it because the world server is running.
now i want to know if there is a possibility to not get the error but the program just closes down so your program can reboot it instantly.

hope i explained it good now.

greets psycho
Image
User avatar
psychoshooter
Lucky Ghost
Lucky Ghost
 
Posts: 572
Joined: Thu Sep 27, 2007 11:08 pm
Location: The Netherlands

Re: Jckf's server launcher

Postby Jckf on Tue Jan 15, 2008 11:03 pm

psychoshooter wrote:well there ain't a problem with your launcer/rebooter.
i use him with osirose btw.

in osirose there is still a bug that if you attack a monster in prison your world server will crash.
and i get the window from windows, it says a couple of things such as that he made a log file and if i want to send it to microsoft.
then you can choose for Send or Don't send.
but as long as i don't click any of this the server won't shutdown and your program won't reboot it because the world server is running.
now i want to know if there is a possibility to not get the error but the program just closes down so your program can reboot it instantly.

hope i explained it good now.

greets psycho

Ah. Just disable the error reporting service in Windows. That will get rid of the message as far as I know.
User avatar
Jckf
Antares
Antares
 
Posts: 338
Joined: Wed Nov 28, 2007 1:09 am
Location: Norway

Re: Jckf's server launcher

Postby psychoshooter on Wed Jan 16, 2008 11:04 am

do you know where i can find it?
i don't know it

greets psycho
Image
User avatar
psychoshooter
Lucky Ghost
Lucky Ghost
 
Posts: 572
Joined: Thu Sep 27, 2007 11:08 pm
Location: The Netherlands

Re: Jckf's server launcher

Postby Jckf on Wed Jan 16, 2008 11:32 am

psychoshooter wrote:do you know where i can find it?
i don't know it

greets psycho

Right click "My Computer". Click "Manage". Find "Services" in the left hand menu. Locate the "Error reporting service". Doubble click it. From the drop down menu in the new window, select "Disabled". Click the "Stop" button. Click "OK".
User avatar
Jckf
Antares
Antares
 
Posts: 338
Joined: Wed Nov 28, 2007 1:09 am
Location: Norway

Re: Jckf's server launcher

Postby Rifke on Wed Jan 16, 2008 4:51 pm

You could also change the registry (don't know wich key) to make it terminiate right away.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Jckf's server launcher

Postby psychoshooter on Wed Jan 16, 2008 7:07 pm

i cant find the Error reporting service.
some1 else got an idea? or know what registery i need to change
Image
User avatar
psychoshooter
Lucky Ghost
Lucky Ghost
 
Posts: 572
Joined: Thu Sep 27, 2007 11:08 pm
Location: The Netherlands

Re: Jckf's server launcher

Postby Rifke on Wed Jan 16, 2008 9:21 pm

[Start] [Run] [Regedit]
Registry Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting
Modify/Create the Value Name according to the Value Data listed below.
Data Type: REG_DWORD [Dword Value] // Value Name: DoReport
Value Data: [0 = Don’t Send Reports / 1 = Do Send Reports]
Exit Registry and Reboot

Source

Warning: Editing your registry can be dangerous do not forget to backup before you start changing things, I'm not responsible for your mistakes.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Next

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 4 guests

cron