static void IRunDaemon(string[] args) { if (!ILoadConfig()) return; // Decide which servers we need to spawn... bool auth = false; bool file = false; bool game = false; bool gate = false; bool lookup = false; bool vault = false; foreach (string arg in args) { if (arg.ToLower() == "auth") auth = true; else if (arg.ToLower() == "file") file = true; else if (arg.ToLower() == "game") game = true; else if (arg.ToLower() == "gate") gate = true; else if (arg.ToLower() == "lookup") lookup = true; else if (arg.ToLower() == "vault") vault = true; } // Test the database connection if (auth || vault) if (!ITestDb()) return; // Start the lobby server with the requested services... pnLobby lobby = new pnLobby(auth, file, game, gate, lookup, vault); try { lobby.Listen(); IInteractiveMode(); } catch (pnBindException e) { Console.WriteLine("Error: " + e.Message); Console.WriteLine("Reason: " + e.InnerException.Message); #if DEBUG throw e.InnerException; #else return; #endif } // TODO: Exit throw new NotImplementedException(); }
protected override void OnStart(string[] args) { Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)); string[] arguments; if(args.Length == 0) arguments = new string[] { "auth", "file", "game", "gate", "lookup", "vault" }; else arguments = args; if (!ILoadConfig()) return; // Decide which servers we need to spawn... bool auth = false; bool file = false; bool game = false; bool gate = false; bool lookup = false; bool vault = false; foreach (string arg in arguments) { if (arg.ToLower() == "auth") auth = true; else if (arg.ToLower() == "file") file = true; else if (arg.ToLower() == "game") game = true; else if (arg.ToLower() == "gate") gate = true; else if (arg.ToLower() == "lookup") lookup = true; else if (arg.ToLower() == "vault") vault = true; } // Test the database connection if (auth || vault) if (!ITestDb()) return; // Start the lobby server with the requested services... pnLobby lobby = new pnLobby(auth, file, game, gate, lookup, vault); lobby.Listen(); }