X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fbots%2Fmamer%2FCommandEntry.cc;h=40463584d484080658a9a8c56f68c811d3332951;hp=39c884bce7667ce26a0f58ee078eb17c050cf7a1;hb=de64701702c2b4d4d951be0e77afeda5177bc494;hpb=0ff5591bb1fcb56b4ebf451eb30fb3c413eaad2d diff --git a/lasker-2.2.3/bots/mamer/CommandEntry.cc b/lasker-2.2.3/bots/mamer/CommandEntry.cc index 39c884b..4046358 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;