Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Extensions » m and h files merger tool
Re: m and h files merger tool Thu, 30 May 2013 10:50 Go to previous messageGo to previous message
Ron is currently offline Ron

 
Commander
Forum Administrator
Stars! AutoHost Administrator

Messages: 1231
Registered: October 2002
Location: Collegedale, TN
Actually, the turn merge tool gives a non-zero run level error for other problems besides missing .x file(s). When this happens, as I recall, it actually crashes Wine itself. If any of you are familiar with Linux and Wine and want to help me with this, please contact me.

The code I'm using to handle this in PERL is:
@command = ("cd /stars/games/$game_name; /usr/bin/wine \"/stars/prog/sahturnmerger.exe\" $game_name-turn-merge.ini >> /stars/games/$game_name/turn-merge-error.log 2>&1");
&handle_sys;

#
# Function: handle_sys
#
# Purpose:  Handle system calls, and their error messages.
#
#

sub handle_sys {
    $e_flag = 0;
AGAIN:
    $rc = 0xffff & system @command;
    if ($rc == 0) {
       $error_flag = 0;
#       print "handle_sys: exit 0\n";
    }
    elsif ($rc == 0xff00) {
#       print STDOUT "handle_sys: exit 0xff00\n";
        printf "system(%s) returned %#04x: ", "@command", $rc;
        print "command failed: $!\n";

        if ($error_flag == 1) {
           if ($e_flag == 0) {
              print "Trying again after 20 seconds.\n";
              sleep(20);
              $e_flag = 1;
              goto AGAIN;
           }
#          print STDOUT "handle_sys: error_flag == 1...exiting\n";
           exit;
        }
#       print STDOUT "handle_sys: error_flag != 1... exiting\n";
        exit;
    }
    elsif ($rc > 0x80) {
#       print STDOUT "handle_sys: exit 80\n";
        printf "system(%s) returned %#04x: ", "@command", $rc;
        print "ran with non-zero exit status $rc\n";
#       print STDOUT "handle_sys: exiting\n";
        exit;
    }
    else {
        printf "system(%s) returned %#04x: ", "@command", $rc;
        print "ran with ";
        if ($rc & 0x80) {
           $rc &= ~0x80;
           print "coredump from ";
        }
        print "signal $rc\n";
#       print STDOUT "handle_sys: exiting\n";
        exit;
    }
}


I'm willing to work on this again. It's 99% complete, but I can't have it crashing the whole system if it has a non-zero run-level error.

nmid
, send me a small test game, 4 players, 2 teams. In the email, specify which player is on which team. We'll test this out.


[Updated on: Thu, 30 May 2013 10:55]




Ron Miller
Stars! AutoHost

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon4.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Planet mover (remapping tool)
Next Topic: My wheels are turning
Goto Forum:
  


Current Time: Sat Apr 27 02:35:24 EDT 2024