]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/configscript.cpp
Made it so missing directives are found on a config file load.
[irc/gameservirc.git] / gameserv / configscript.cpp
index 2f9313b097433efb52a142b2b530d07b21e49a0c..13fb4c165c855f89ea000d1dfb71af659393cf31 100644 (file)
@@ -1,11 +1,13 @@
 #include <fstream>
 #include <iostream>
 
-using std::cerr;
 using std::cout;
+using std::cerr;
+using std::cin;
+using std::endl;
 using std::ofstream;
 
-char menu();
+char menu(int page = 1);
 
 int main()
 {
@@ -26,28 +28,70 @@ int main()
            case '1':
                outfile << "#define UNREAL" << endl;
                outfile << "#undef BAHAMUT" << endl;
+               outfile << "#undef P10" << endl;
+               outfile << "#undef HYBRID" << endl;
                break;
            case '2':
                outfile << "#undef UNREAL" << endl;
                outfile << "#define BAHAMUT" << endl;
+               outfile << "#undef P10" << endl;
+               outfile << "#undef HYBRID" << endl;
+               break;
+           case '3':
+               outfile << "#undef UNREAL" << endl;
+               outfile << "#undef BAHAMUT" << endl;
+               outfile << "#define P10" << endl;
+               outfile << "#undef HYBRID" << endl;
+               break;
+           case '4':
+               outfile << "#undef UNREAL" << endl;
+               outfile << "#undef BAHAMUT" << endl;
+               outfile << "#undef P10" << endl;
+               outfile << "#define HYBRID" << endl;
                break;
            default:
                break;
        }
-    }while (c != 'Q' && c != 'q' && (int(c) < 48) && (int(c) > 57));
+    }while (c == 'Q' || c == 'q' || (int(c) < 48) || (int(c) > 57));
 
+    do {
+       c = menu(2);
+       switch(c)
+       {
+           case 'y':
+           case 'Y':
+               outfile << "#define DEBUGMODE" << endl;
+               break;
+           case 'n':
+           case 'N':
+               outfile << "#undef DEBUGMODE" << endl;
+               break;
+           default:
+               break;
+       }
+    }while (c != 'y' && c != 'Y' && c != 'n' && c != 'N');
     outfile.close();
 return 0;
 }
 
-char menu()
+char menu(int page)
 {
     char selection = 0;
 
-    cout << "Choose your IRCD" << endl;
-    cout << "1. Unreal3.x\r\n"
-        << "2. bahamut-1.4.x" << endl;
-    cout << "Make your selection: ";
+    if (page == 2)
+    {
+       cout << "Do you want to enable debug mode? (Y/N): ";
+    }
+    else
+    {
+       cout << "Choose your IRCD" << endl;
+       cout << "1. Unreal3.x" << endl
+            << "2. bahamut-1.4.x" << endl
+            << "3. ircu 2.10.x (P10)" << endl
+            << "4. ircd-hybrid, ircd-ratbox, or csircd" << endl;
+       cout << "Make your selection: ";
+    }
+
     cin >> selection;
     return selection;
 }