… | |
… | |
469 | my ($conn, $flags, $prompt) = @_; |
469 | my ($conn, $flags, $prompt) = @_; |
470 | |
470 | |
471 | # FIXME: a very ugly hack to wait for stat update #d# |
471 | # FIXME: a very ugly hack to wait for stat update #d# |
472 | if ($prompt =~ /roll new stats/ and not $conn->{stat_change_with}) { |
472 | if ($prompt =~ /roll new stats/ and not $conn->{stat_change_with}) { |
473 | unless ($QUERY_TIMER) { |
473 | unless ($QUERY_TIMER) { |
474 | $QUERY_TIMER = |
|
|
475 | EV::timer 1, 0, sub { |
474 | $QUERY_TIMER = EV::timer 1, 0, sub { |
476 | server_query ($conn, $flags, $prompt, 1); |
475 | server_query ($conn, $flags, $prompt, 1); |
477 | $QUERY_TIMER = undef |
476 | $QUERY_TIMER = undef |
478 | }; |
477 | }; |
|
|
478 | |
479 | return; |
479 | return; |
480 | } |
480 | } |
481 | } |
481 | } |
482 | |
482 | |
483 | $conn->{query_dialog} = my $dialog = new CFPlus::UI::Toplevel |
483 | $conn->{query_dialog} = my $dialog = new CFPlus::UI::Toplevel |
… | |
… | |
2348 | }, |
2348 | }, |
2349 | ); |
2349 | ); |
2350 | |
2350 | |
2351 | ############################################################################# |
2351 | ############################################################################# |
2352 | |
2352 | |
2353 | $SIG{INT} = $SIG{TERM} = sub { exit }; |
2353 | $SIG{INT} = $SIG{TERM} = sub { |
|
|
2354 | EV::unloop; |
|
|
2355 | #d# TODO calling exit here hangs the process in some futex |
|
|
2356 | }; |
2354 | |
2357 | |
2355 | { |
2358 | { |
2356 | CFPlus::read_cfg "$Crossfire::VARDIR/cfplusrc"; |
2359 | CFPlus::read_cfg "$Crossfire::VARDIR/cfplusrc"; |
2357 | CFPlus::DB::Server::run; |
2360 | CFPlus::DB::Server::run; |
2358 | |
2361 | |