Add 2-sec delay before issuing rmatch
[capablanca.git] / lasker-2.2.3 / bots / mamer / main.cc
1 //--------------------------------------------------------------------------
2 // main.cc - main source file that starts Mamer
3 //
4 // Matthew E. Moses
5 //
6 // $Revision: 1.4 $
7 // $Date: 1998/09/10 19:57:17 $
8 //
9 // $Author: mlong $
10 // $Locker:  $
11 //
12 // $Log: main.cc,v $
13 // Revision 1.4  1998/09/10 19:57:17  mlong
14 // lots of little bug fixes and a few new features
15 //
16 // Revision 1.3  1998/04/18 20:05:14  mlong
17 // *** empty log message ***
18 //
19 // Revision 1.2  1998/04/18 18:46:04  mlong
20 // fixed delete bug &
21 // added delete tourney function
22 //
23 // Revision 1.1  1996/09/30 20:52:48  moses
24 // Initial revision
25 //
26 //
27 //--------------------------------------------------------------------------
28
29 //static char RCSid[] = "$Id: main.cc,v 1.4 1998/09/10 19:57:17 mlong Exp $";
30
31 #include "Mamer.hh"
32
33 //- Globals ----------------------------------------------------------------
34 Mamer gMamer;
35
36 //- Prototypes -------------------------------------------------------------
37 int main(int, char **);
38
39 //- main -------------------------------------------------------------------
40 int main(int argc, char **argv) {
41
42     if(gMamer.Initialize(argc, argv)) 
43         if(gMamer.OpenServerConnection()) {
44             gMamer.ListenLoop();
45             gMamer.Shutdown();
46         }
47         else
48 //          cerr << "ERROR: couldn't open server connection!" << endl;
49 ;
50     else
51 //      cerr << "ERROR: couldn't initialize mamer!" << endl;
52 ;
53     exit(0);
54 } //- End of main
55
56 //- HandleSignals ---------------------------------------------------------
57 void HandleSignals(int theSignal) {
58     switch(theSignal) {
59      case SIGTERM:
60      case SIGKILL:
61         gMamer.Shutdown();
62         exit(0);
63         break;
64      case SIGUSR1:
65         gMamer.Shutdown();
66         exit(0);        
67      case SIGUSR2:
68         gMamer.DumpConfiguration();
69      default:
70         break;
71     }
72 } //- End of HandleSignals