+void Sys_InitConsole (void)
+{
+ int t;
+
+ // initialize the windows dedicated server console if needed
+ tevent = CreateEvent(NULL, false, false, NULL);
+
+ if (!tevent)
+ Sys_Error ("Couldn't create event");
+
+ // LordHavoc: can't check cls.state because it hasn't been initialized yet
+ // if (cls.state == ca_dedicated)
+ if (COM_CheckParm("-dedicated"))
+ {
+ if (!AllocConsole ())
+ Sys_Error ("Couldn't create dedicated server console");
+
+ hinput = GetStdHandle (STD_INPUT_HANDLE);
+ houtput = GetStdHandle (STD_OUTPUT_HANDLE);
+
+#ifdef WIN64
+#define atoi _atoi64
+#endif
+ // give QHOST a chance to hook into the console
+ if ((t = COM_CheckParm ("-HFILE")) > 0)
+ {
+ if (t < com_argc)
+ hFile = (HANDLE)atoi (com_argv[t+1]);
+ }
+
+ if ((t = COM_CheckParm ("-HPARENT")) > 0)
+ {
+ if (t < com_argc)
+ heventParent = (HANDLE)atoi (com_argv[t+1]);
+ }
+
+ if ((t = COM_CheckParm ("-HCHILD")) > 0)
+ {
+ if (t < com_argc)
+ heventChild = (HANDLE)atoi (com_argv[t+1]);
+ }
+
+ InitConProc (hFile, heventParent, heventChild);
+ }
+
+// because sound is off until we become active
+ S_BlockSound ();
+}
+
+void Sys_Init_Commands (void)
+{
+ Cvar_RegisterVariable(&sys_usetimegettime);
+}
+