]> jfr.im git - irc/gameservirc.git/blame - gameserv/configscript.cpp
Updated the TODO file
[irc/gameservirc.git] / gameserv / configscript.cpp
CommitLineData
f8656e40 1#include <fstream>
2#include <iostream>
3
f8656e40 4using std::cout;
fb37ecc7 5using std::cerr;
42ec1800 6using std::cin;
7using std::endl;
f8656e40 8using std::ofstream;
9
9f8c2acc 10char menu(int page = 1);
f8656e40 11
12int main()
13{
14 ofstream outfile;
15
16 outfile.open("options.h");
17 if (outfile.fail())
18 {
fb37ecc7 19 cerr << "Error opening options.h" << endl;
f8656e40 20 return 1;
21 }
22 char c = 0;
23
24 do {
25 c = menu();
26 switch(c)
27 {
28 case '1':
29 outfile << "#define UNREAL" << endl;
30 outfile << "#undef BAHAMUT" << endl;
e1c41a84 31 outfile << "#undef P10" << endl;
581ec09e 32 outfile << "#undef HYBRID" << endl;
f8656e40 33 break;
34 case '2':
35 outfile << "#undef UNREAL" << endl;
36 outfile << "#define BAHAMUT" << endl;
e1c41a84 37 outfile << "#undef P10" << endl;
581ec09e 38 outfile << "#undef HYBRID" << endl;
e1c41a84 39 break;
40 case '3':
41 outfile << "#undef UNREAL" << endl;
42 outfile << "#undef BAHAMUT" << endl;
43 outfile << "#define P10" << endl;
581ec09e 44 outfile << "#undef HYBRID" << endl;
45 break;
46 case '4':
47 outfile << "#undef UNREAL" << endl;
48 outfile << "#undef BAHAMUT" << endl;
49 outfile << "#undef P10" << endl;
50 outfile << "#define HYBRID" << endl;
f8656e40 51 break;
52 default:
9f8c2acc 53 break;
f8656e40 54 }
173302fe 55 }while (c == 'Q' || c == 'q' || (int(c) < 48) || (int(c) > 57));
f8656e40 56
9f8c2acc 57 do {
58 c = menu(2);
59 switch(c)
60 {
61 case 'y':
62 case 'Y':
63 outfile << "#define DEBUGMODE" << endl;
64 break;
65 case 'n':
66 case 'N':
67 outfile << "#undef DEBUGMODE" << endl;
68 break;
69 default:
70 break;
71 }
72 }while (c != 'y' && c != 'Y' && c != 'n' && c != 'N');
f8656e40 73 outfile.close();
74return 0;
75}
76
9f8c2acc 77char menu(int page)
f8656e40 78{
79 char selection = 0;
80
9f8c2acc 81 if (page == 2)
82 {
83 cout << "Do you want to enable debug mode? (Y/N): ";
84 }
85 else
86 {
87 cout << "Choose your IRCD" << endl;
e1c41a84 88 cout << "1. Unreal3.x" << endl
89 << "2. bahamut-1.4.x" << endl
581ec09e 90 << "3. ircu 2.10.x (P10)" << endl
91 << "4. ircd-hybrid, ircd-ratbox, or csircd" << endl;
9f8c2acc 92 cout << "Make your selection: ";
93 }
94
f8656e40 95 cin >> selection;
96 return selection;
97}