X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fbots%2Fmamer%2FMamer.cc;h=9de4abc6faeb1a57d9513a6f8eddf2c9f2c3b152;hp=ee10805f0160b5bfdf4e555d8a341dadae139fa6;hb=HEAD;hpb=0ff5591bb1fcb56b4ebf451eb30fb3c413eaad2d diff --git a/lasker-2.2.3/bots/mamer/Mamer.cc b/lasker-2.2.3/bots/mamer/Mamer.cc index ee10805..9de4abc 100644 --- a/lasker-2.2.3/bots/mamer/Mamer.cc +++ b/lasker-2.2.3/bots/mamer/Mamer.cc @@ -1207,7 +1207,7 @@ int Mamer::HandleGame(char *message) { continue; } moreGames = t->SetGameResult(user1, user2, result_code); //- SetGameResult deletes the game for us - if(moreGames == 2) { + if(moreGames == 2 && !t->IsPaused()) { moreRounds = (t->GetRoundsRemaining()); LinkListIter playerIter(t->playerList); playerIter.Reset(); @@ -1302,7 +1302,7 @@ printf("player p=%d\n", p); return 0; } //Check for valid tourney is done in CommandEntry::JoinTourney - return_from_AddPlayer = t->AddPlayer(player, ratings[t->GetVariant()], 0.0); + return_from_AddPlayer = t->AddPlayer(player, ratings[t->GetVariant()], p->floatValue); // [HGM] use score to signal att/join printf("ret = %d\n", return_from_AddPlayer); TellUser(JoinedTourney, player, return_from_AddPlayer); if(return_from_AddPlayer == 1) @@ -1469,6 +1469,12 @@ void Mamer::BuildCommandList(void) { commandList.Append(new Command("open", "ot", DIRECTOR, "Opens the tournament to players.", "d", (USERFP)&Mamer::OpenTourney)); + commandList.Append(new Command("pause", "pa", DIRECTOR, "Supresses start of new round.", + "d", (USERFP)&Mamer::PauseTourney)); + + commandList.Append(new Command("resume", "re", DIRECTOR, "Resumes a paused tournament.", + "d", (USERFP)&Mamer::ResumeTourney)); + commandList.Append(new Command("setcommandlevel", "setcl", VICE, "Set the level required to execute a command.", "wd", (USERFP)&Mamer::SetCommandLevel)); @@ -1516,7 +1522,7 @@ void Mamer::NextRound() { LinkListIter tourneyIter(tourneyList); tourneyIter.Reset(); while((t = tourneyIter.Next())) { - if(t->GetStatus() != CLOSED) continue; + if(t->GetStatus() != CLOSED || t->IsPaused()) continue; moreRounds = (t->GetRoundsRemaining()); moreGames = 0; LinkListIter gameIter(t->gameList); @@ -1532,7 +1538,7 @@ void Mamer::NextRound() { if(madeMoreGames) t->TellThemWhoTheyPlay(); else { // tourney over! - cerr << "Coulnd't make any more games. End of Tourney. From Next Round" << endl; + cerr << "Couldn't make any more games. End of Tourney. From Next Round" << endl; AnnounceTourneyEnd(t); savePlayerData(t); }