]> jfr.im git - irc/gameservirc.git/blob - gameserv/configscript.cpp
Added a lot of functionality. Added player flags and save/load them in the players...
[irc/gameservirc.git] / gameserv / configscript.cpp
1 #include <fstream>
2 #include <iostream>
3
4 using std::cout;
5 using std::cin;
6 using std::endl;
7 using std::ofstream;
8
9 char menu();
10
11 int main()
12 {
13 ofstream outfile;
14
15 outfile.open("options.h");
16 if (outfile.fail())
17 {
18 cout << "Error opening options.h" << endl;
19 return 1;
20 }
21 char c = 0;
22
23 do {
24 c = menu();
25 switch(c)
26 {
27 case '1':
28 outfile << "#define UNREAL" << endl;
29 outfile << "#undef BAHAMUT" << endl;
30 break;
31 case '2':
32 outfile << "#undef UNREAL" << endl;
33 outfile << "#define BAHAMUT" << endl;
34 break;
35 default:
36 continue;
37 }
38 }while (c == 'Q' || c == 'q' || (int(c) < 48) || (int(c) > 57));
39
40 outfile.close();
41 return 0;
42 }
43
44 char menu()
45 {
46 char selection = 0;
47
48 cout << "Choose your IRCD" << endl;
49 cout << "1. Unreal3.x\r\n"
50 << "2. bahamut-1.4.x" << endl;
51 cout << "Make your selection: ";
52 cin >> selection;
53 return selection;
54 }