[PATCH] Handle case where an AI sends an invalid message and then crashes
[progcomp2012.git] / judge / manager / ai_controller.cpp
index 40ee3df..b73520f 100644 (file)
@@ -54,11 +54,12 @@ MovementResult AI_Controller::QueryMove(string & buffer)
        if (!Running())
                return MovementResult::NO_MOVE; //AI has quit
        Game::theGame->theBoard.Print(output, colour);
        if (!Running())
                return MovementResult::NO_MOVE; //AI has quit
        Game::theGame->theBoard.Print(output, colour);
-
+       //Game::theGame->logMessage("DEBUG: About to get message from %d\n", colour);
        if (!GetMessage(buffer,timeout))
        {
                return MovementResult::NO_MOVE; //AI did not respond (within the timeout). It will lose by default.
        }
        if (!GetMessage(buffer,timeout))
        {
                return MovementResult::NO_MOVE; //AI did not respond (within the timeout). It will lose by default.
        }
+       //Game::theGame->logMessage("DEBUG: Got message \"%s\" from %d\n", buffer.c_str(), colour);
        return MovementResult::OK; //Got the message
 }
 
        return MovementResult::OK; //Got the message
 }
 

UCC git Repository :: git.ucc.asn.au