//
// Matthew E. Moses & Michael A. Long
//
-// $Revision: 1.19 $
-// $Date: 2002/07/02 00:05:19 $
+// $Revision: 1.17 $
+// $Date: 1998/09/10 19:57:17 $
+//
+// $Author: mlong $
+// $Locker: $
//
//--------------------------------------------------------------------------
+// static char RCSid[] = "$Id: Mamer.cc,v 1.17 1998/09/10 19:57:17 mlong Exp $";
+
#include "Mamer.hh"
extern void HandleSignals(int);
switch(errno) {
case ENOENT:
if(-1 == mkdir(userFilePath, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH)) {
+ printf("name = '%s'\n", userFilePath);
perror("create user file path");
return(0);
}
Game *g = NULL;
TourneyPlayers *tp = NULL;
+ printf("MESSAGE: %s\n", message);
+
// {Game 8 (Blammor vs. Havard) Blammor resigns} 0-1
sscanf(message, "{Game %d (%s vs. %s", &gameNumber, user1, user2);
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<TourneyPlayers> playerIter(t->playerList);
playerIter.Reset();
player, ratings[2], ratings[3], ratings[1], ratings[0], ratings[4], ratings[5]);
p = FindPending(player);
-
+printf("player p=%d\n", p);
if(p != NULL) {
tourneyNumber = p->value; // find out which tourney we want
t = FindTourney(tourneyNumber); // Get the tourney. If its in the list it should be valid
} //Check for valid tourney is done in CommandEntry::JoinTourney
return_from_AddPlayer = t->AddPlayer(player, ratings[t->GetVariant()], 0.0);
+printf("ret = %d\n", return_from_AddPlayer);
TellUser(JoinedTourney, player, return_from_AddPlayer);
if(return_from_AddPlayer == 1)
XServerCom("%s %s %d%s", "tournset", player, 1, "\n");
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));
LinkListIter<Tourney> 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<Game> gameIter(t->gameList);
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);
}
// $Log: Mamer.cc,v $
-// Revision 1.19 2002/07/02 00:05:19 tridge
-// got rid of a bunch of RCS tags now that its in CVS
-//
-// Revision 1.18 2002/07/02 00:02:40 tridge
-// - fixed compile on g++ 2.96
-// - updated for lasker 'rmatch'
-//
// Revision 1.17 1998/09/10 19:57:17 mlong
// lots of little bug fixes and a few new features
//