# HG changeset patch # User unc0rr # Date 1224528703 0 # Node ID ca72264f921a1c519264576352ccba24125de521 # Parent 329d3308e2e3f22356e390b19b019e97c596c371 Shutdown private server when room is abandoned diff -r 329d3308e2e3 -r ca72264f921a QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Mon Oct 20 18:35:36 2008 +0000 +++ b/QTfrontend/newnetclient.cpp Mon Oct 20 18:51:43 2008 +0000 @@ -184,7 +184,7 @@ void HWNewNet::ParseCmd(const QStringList & lst) { - qDebug() << "Server: " << lst; + //qDebug() << "Server: " << lst; if(!lst.size()) { diff -r 329d3308e2e3 -r ca72264f921a netserver/HWProto.hs --- a/netserver/HWProto.hs Mon Oct 20 18:35:36 2008 +0000 +++ b/netserver/HWProto.hs Mon Oct 20 18:51:43 2008 +0000 @@ -14,7 +14,7 @@ answerServerMessage = [(clientOnly, "SERVER_MESSAGE" : [body])] where - body = serverMessage globalOptions ++ if isDedicated globalOptions then "" else "
Private server
" + body = serverMessage globalOptions ++ if isDedicated globalOptions then "Dedicated server
" else "Private server
" answerBadCmd = [(clientOnly, ["ERROR", "Bad command, state or incorrect parameter"])] answerNotMaster = [(clientOnly, ["ERROR", "You cannot configure room parameters"])] answerBadParam = [(clientOnly, ["ERROR", "Bad parameter"])] diff -r 329d3308e2e3 -r ca72264f921a netserver/hedgewars-server.hs --- a/netserver/hedgewars-server.hs Mon Oct 20 18:35:36 2008 +0000 +++ b/netserver/hedgewars-server.hs Mon Oct 20 18:51:43 2008 +0000 @@ -77,7 +77,9 @@ clientsIn <- sendAnswers answers mclient mclients mrooms - when ((isDedicated globalOptions) || (not $ null clientsIn)) $ mainLoop servSock acceptChan clientsIn mrooms + let hadRooms = (not $ null rooms) && (null mrooms) + in unless ((not $ isDedicated globalOptions) && ((null clientsIn) || hadRooms)) $ + mainLoop servSock acceptChan clientsIn mrooms startServer serverSocket = do