]> jfr.im git - irc/gameservirc.git/commitdiff
Added the source for the .config script
authorkainazzzo <redacted>
Thu, 30 Oct 2003 06:49:13 +0000 (06:49 +0000)
committerkainazzzo <redacted>
Thu, 30 Oct 2003 06:49:13 +0000 (06:49 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@44 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/configscript.cpp [new file with mode: 0644]

diff --git a/gameserv/configscript.cpp b/gameserv/configscript.cpp
new file mode 100644 (file)
index 0000000..2f9313b
--- /dev/null
@@ -0,0 +1,53 @@
+#include <fstream>
+#include <iostream>
+
+using std::cerr;
+using std::cout;
+using std::ofstream;
+
+char menu();
+
+int main()
+{
+    ofstream outfile;
+
+    outfile.open("options.h");
+    if (outfile.fail())
+    {
+       cerr << "Error opening options.h" << endl;
+       return 1;
+    }
+    char c = 0;
+
+    do {
+       c = menu();
+        switch(c)
+       {
+           case '1':
+               outfile << "#define UNREAL" << endl;
+               outfile << "#undef BAHAMUT" << endl;
+               break;
+           case '2':
+               outfile << "#undef UNREAL" << endl;
+               outfile << "#define BAHAMUT" << endl;
+               break;
+           default:
+               break;
+       }
+    }while (c != 'Q' && c != 'q' && (int(c) < 48) && (int(c) > 57));
+
+    outfile.close();
+return 0;
+}
+
+char menu()
+{
+    char selection = 0;
+
+    cout << "Choose your IRCD" << endl;
+    cout << "1. Unreal3.x\r\n"
+        << "2. bahamut-1.4.x" << endl;
+    cout << "Make your selection: ";
+    cin >> selection;
+    return selection;
+}