]> jfr.im git - irc/gameservirc.git/blame - gameserv/configscript.cpp
Added a lot of functionality. Added player flags and save/load them in the players...
[irc/gameservirc.git] / gameserv / configscript.cpp
CommitLineData
f8656e40 1#include <fstream>
2#include <iostream>
3
f8656e40 4using std::cout;
42ec1800 5using std::cin;
6using std::endl;
f8656e40 7using std::ofstream;
8
9char menu();
10
11int main()
12{
13 ofstream outfile;
14
15 outfile.open("options.h");
16 if (outfile.fail())
17 {
9cc5ab57 18 cout << "Error opening options.h" << endl;
f8656e40 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:
173302fe 36 continue;
f8656e40 37 }
173302fe 38 }while (c == 'Q' || c == 'q' || (int(c) < 48) || (int(c) > 57));
f8656e40 39
40 outfile.close();
41return 0;
42}
43
44char 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}