diff options
author | tomsmeding <tom.smeding@gmail.com> | 2018-08-31 11:44:53 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2018-08-31 11:44:53 +0200 |
commit | fca6e0750b83f337c61b994a191b8463585ea655 (patch) | |
tree | 7f4d69987e7407a22bc4dbe4be020ad6081d1570 | |
parent | aaa342471b02cc283c83e44829ecb1bae7a7beeb (diff) |
Print game code name when player errors
-rw-r--r-- | main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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<string> 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(); } |