From fca6e0750b83f337c61b994a191b8463585ea655 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 31 Aug 2018 11:44:53 +0200 Subject: Print game code name when player errors --- main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index aa92b64..c863cca 100644 --- a/main.cpp +++ b/main.cpp @@ -261,7 +261,8 @@ static void playMatch(Player &p1, Player &p2, int index, const Params ¶ms) { while (true) { for (int i = 0; i < 2; i++) { if (!procs[i].writeLine(lastMove)) { - cout << "ERROR writing move to player " << i+1 << endl; + cout << "ERROR writing move to player " << i+1 + << " (game " << gameCodeName(p1, p2, index) << ")" << endl; throw StopCompetitionError(); } @@ -269,7 +270,8 @@ static void playMatch(Player &p1, Player &p2, int index, const Params ¶ms) { int64_t start = gettimestamp(); optional oline = procs[i].readLine(); if (!oline) { - cout << "ERROR reading move from player " << i+1 << endl; + cout << "ERROR reading move from player " << i+1 + << " (game " << gameCodeName(p1, p2, index) << ")" << endl; throw StopCompetitionError(); } @@ -287,7 +289,8 @@ static void playMatch(Player &p1, Player &p2, int index, const Params ¶ms) { } if (!referee.moveValid(i, lastMove)) { - cout << "ERROR in player " << i+1 << ": invalid move '" << lastMove << "'" << endl; + cout << "ERROR in player " << i+1 << ": invalid move '" << lastMove << "'" + << " (game " << gameCodeName(p1, p2, index) << ")" << endl; throw StopCompetitionError(); } -- cgit v1.2.3-70-g09d2