# HG changeset patch # User koda # Date 1295123564 -3600 # Node ID 849740a91d36002ffe86a384aacdde585d24a7ca # Parent 62471157bd627d3a54b578ec8639d857f74a05a3 possible fix hanging server on ctlr+w diff -r 62471157bd62 -r 849740a91d36 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sat Jan 15 21:00:45 2011 +0100 +++ b/QTfrontend/hwform.cpp Sat Jan 15 21:32:44 2011 +0100 @@ -980,7 +980,7 @@ if (wBackground) wBackground->startAnimation(); if (hwnet) hwnet->gameFinished(); } - if (gameState == gsHalted) close(); + if (gameState == gsHalted) close(); }; } } diff -r 62471157bd62 -r 849740a91d36 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sat Jan 15 21:00:45 2011 +0100 +++ b/hedgewars/uCommandHandlers.pas Sat Jan 15 21:32:44 2011 +0100 @@ -23,35 +23,35 @@ procedure chQuit(var s: shortstring); const prevGState: TGameState = gsConfirm; begin -s:= s; // avoid compiler hint -if GameState <> gsConfirm then - begin + s:= s; // avoid compiler hint + if GameState <> gsConfirm then + begin prevGState:= GameState; GameState:= gsConfirm - end else - GameState:= prevGState + end else + GameState:= prevGState end; procedure chForceQuit(var s: shortstring); begin s:= s; // avoid compiler hint - SendIPC('Q'); - GameState:= gsExit + GameState:= gsConfirm; + ParseCommand('confirm', true); end; procedure chConfirm(var s: shortstring); begin -s:= s; // avoid compiler hint -if GameState = gsConfirm then + s:= s; // avoid compiler hint + if GameState = gsConfirm then begin - SendIPC('Q'); - GameState:= gsExit + SendIPC('Q'); + GameState:= gsExit end else ParseCommand('chat team', true); end; -procedure chShutdown (var s: shortstring); +procedure chHalt (var s: shortstring); begin s:= s; // avoid compiler hint SendIPC('H'); @@ -598,7 +598,7 @@ RegisterVariable('quit' , vtCommand, @chQuit , true ); RegisterVariable('forcequit', vtCommand, @chForceQuit , true ); RegisterVariable('confirm' , vtCommand, @chConfirm , true ); - RegisterVariable('shutdown', vtCommand, @chShutdown , true ); + RegisterVariable('halt', vtCommand, @chHalt , true ); RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); diff -r 62471157bd62 -r 849740a91d36 hedgewars/uKeys.pas --- a/hedgewars/uKeys.pas Sat Jan 15 21:00:45 2011 +0100 +++ b/hedgewars/uKeys.pas Sat Jan 15 21:32:44 2011 +0100 @@ -136,7 +136,7 @@ if ((tkbdn[KeyNameToCode('left_ctrl')] = 1) or (tkbdn[KeyNameToCode('right_ctrl')] = 1)) then {$ENDIF} begin - if tkbdn[KeyNameToCode('q')] = 1 then ParseCommand ('shutdown', true) + if tkbdn[KeyNameToCode('q')] = 1 then ParseCommand ('halt', true) else if tkbdn[KeyNameToCode('w')] = 1 then ParseCommand ('forcequit', true); end;