X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fbots%2Fmamer%2FCommandEntry.cc;h=0b7708e1b15d17a089b5779b9b3263a329dc28dd;hp=39c884bce7667ce26a0f58ee078eb17c050cf7a1;hb=HEAD;hpb=0ff5591bb1fcb56b4ebf451eb30fb3c413eaad2d diff --git a/lasker-2.2.3/bots/mamer/CommandEntry.cc b/lasker-2.2.3/bots/mamer/CommandEntry.cc index 39c884b..0b7708e 100644 --- a/lasker-2.2.3/bots/mamer/CommandEntry.cc +++ b/lasker-2.2.3/bots/mamer/CommandEntry.cc @@ -230,7 +230,7 @@ int CommandEntry::ListManagers(User *user, param_list params) { "-----------------", "---", "----", "--------", "", "-----------------", "---", "----", "--------", "", "\\n"); i=1; - memset(date, '\0', 64); + memset(date, '\0', 16); gMamer.XServerCom("\n%s %s ", "qtell", user->name); while(fscanf(theFile, "%s", manager) > 0) { needToDelete = 0; @@ -576,6 +576,37 @@ int CommandEntry::OpenTourney(User *user, param_list params) { return(0); }//- End OpenTourney +//- PauseTourney ------------------------------------------------------------ +int CommandEntry::PauseTourney(User *user, param_list params) { + Tourney *tourn = NULL; + + tourn = gMamer.FindTourney(params[0].val.integer); + if(NULL != tourn) { + if(tourn->GetStatus() == CLOSED) { + tourn->SetPause(TRUE); + } + return(1); + } + gMamer.TellUser(NotFound, user->name, "tourney"); + return(0); +}//- End PauseTourney + +//- ResumeTourney ------------------------------------------------------------ +int CommandEntry::ResumeTourney(User *user, param_list params) { + Tourney *tourn = NULL; + + tourn = gMamer.FindTourney(params[0].val.integer); + if(NULL != tourn) { + if(tourn->GetStatus() == CLOSED && tourn->IsPaused()) { + tourn->SetPause(FALSE); // unpause + gMamer.NextRound(); // and start next round + } + return(1); + } + gMamer.TellUser(NotFound, user->name, "tourney"); + return(0); +}//- End ResumeTourney + //- AnnounceTourney ---------------------------------------------------------- int CommandEntry::AnnounceTourney(User *user, param_list params) { Tourney *tourn = NULL; @@ -722,7 +753,7 @@ int CommandEntry::ListTourneys(User *user, param_list params) { else if(Tstatus == OPEN) sprintf(outStatus, "%s", "open"); else if(Tstatus == CLOSED) - sprintf(outStatus, "%s", "closed"); + sprintf(outStatus, "%s", t->IsPaused() ? "paused" : "closed"); else if(Tstatus == DONE) sprintf(outStatus, "%s", "done"); else @@ -754,7 +785,7 @@ printf("join\n"); tourn = gMamer.FindTourney(params[0].val.integer); if(NULL != tourn) { - newEntry = new Player(user->name, params[0].val.integer); + newEntry = new Player(user->name, 0., params[0].val.integer); // [HGM] signal this was from join printf("entry=%d\n",newEntry); gMamer.pendingList.Append(newEntry); gMamer.XServerCom("getpi %s%s", user->name, "\n"); @@ -773,7 +804,7 @@ int CommandEntry::AddToTourney(User *user, param_list params) { tourn = gMamer.FindTourney(params[1].val.integer); if(NULL != tourn) { - newEntry = new Player(params[0].val.word, params[1].val.integer); + newEntry = new Player(params[0].val.word, 1., params[1].val.integer); // [HGM] signal this was from att gMamer.pendingList.Append(newEntry); gMamer.XServerCom("getpi %s%s", params[0].val.word, "\n"); return(1); @@ -942,7 +973,7 @@ int CommandEntry::ListTourneyPlayers(User *user, param_list params) { } gMamer.XServerCom("%c%-0.2d%c ", result, p->value, color); } - if(((i % 9) == 0) && (i > 0)) { + if(((i % 8) == 0) && (i > 0)) { gMamer.XServerCom("%s %s %s %s", "\n", "qtell", user->name, "\\n"); } else { gMamer.XServerCom("%s", "\\n");