public static void Main(string[] args) { bool_0 = true; DateTime now = DateTime.Now; Output.InitializeStream(true, OutputLevel.DebugInformation); Output.WriteLine("Initializing BoomBang game environment..."); ConfigManager.Initialize(Constants.DataFileDirectory + @"\server-main.cfg"); Output.SetVerbosityLevel((OutputLevel)ConfigManager.GetValue("output.verbositylevel")); foreach (string str in args) { Output.WriteLine("Command line argument: " + str); Input.ProcessInput(str.Split(new char[] { ' ' })); } try { Output.WriteLine("Initializing MySQL manager..."); SqlDatabaseManager.Initialize(); Output.WriteLine("Setting up server listener on port " + ((int)ConfigManager.GetValue("net.bind.port")) + "..."); boomBangTcpListener_0 = new BoomBangTcpListener(new IPEndPoint(IPAddress.Any, (int)ConfigManager.GetValue("net.bind.port")), (int)ConfigManager.GetValue("net.backlog"), new OnNewConnectionCallback(SessionManager.HandleIncomingConnection)); using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { Output.WriteLine("Resetting database counters and statistics..."); smethod_0(client); Output.WriteLine("Initializing game components and workers..."); DataRouter.Initialize(); GlobalHandler.Initialize(); SessionManager.Initialize(); CharacterInfoLoader.Initialize(); UserCredentialsAuthenticator.Initialize(); RegisterManager.Initialize(); Class1.smethod_0(); LaptopHandler.Initialize(); CatalogManager.Initialize(client); FlowerPowerManager.Initialize(); NewsCacheManager.Initialize(client); Navigator.Initialize(client); SpaceManager.Initialize(client); SpaceInfoLoader.Initialize(); SpaceHandler.Initialize(); GameHandler.Initialize(); CrossdomainPolicy.Initialize(@"Data\crossdomain.xml"); WordFilterManager.Initialize(client); AdvertisementManager.Initialize(); ContestHandler.Initialize(); SilverCoinsWorker.Initialize(); ModerationBanManager.Initialize(client); } } catch (Exception exception) { HandleFatalError("Could not initialize BoomBang game environment: " + exception.Message + "\nStack trace: " + exception.StackTrace); return; } TimeSpan span = (TimeSpan)(DateTime.Now - now); Output.WriteLine("The server has initialized successfully (" + Math.Round(span.TotalSeconds, 2) + " seconds). Ready for connections.", OutputLevel.Notification); Output.WriteLine("Pulsa ENTER e introduce un comando. Ten una guía de comandos escribiendo HELP", OutputLevel.Notification); Console.Beep(); }
public static void Main(string[] args) { mAlive = true; DateTime InitStart = DateTime.Now; // Set up basic output Console.WriteLine("Initializing Snowlight..."); // Cannot be localized before config+lang is loaded // Load configuration, translation, and re-configure output from config data ConfigManager.Initialize(Constants.DataFileDirectory + "server-main.cfg"); Output.InitializeStream(true, (OutputLevel)ConfigManager.GetValue("output.verbositylevel")); Output.WriteLine("Initializing Snowlight..."); Localization.Initialize(Constants.LangFileDirectory + "lang_" + ConfigManager.GetValue("lang") + ".lang"); // Process args foreach (string arg in args) { Output.WriteLine(Localization.GetValue("core.init.cmdarg", arg)); Input.ProcessInput(arg.Split(' ')); } try { // Initialize and test database Output.WriteLine(Localization.GetValue("core.init.mysql")); SqlDatabaseManager.Initialize(); // Initialize network components Output.WriteLine(Localization.GetValue("core.init.net", ConfigManager.GetValue("net.bind.port").ToString())); mServer = new SnowTcpListener(new IPEndPoint((IPAddress)ConfigManager.GetValue("net.bind.ip"), (int)ConfigManager.GetValue("net.bind.port")), (int)ConfigManager.GetValue("net.backlog"), new OnNewConnectionCallback( SessionManager.HandleIncomingConnection)); /*Output.WriteLine(Localization.GetValue("core.init.net", ConfigManager.GetValue("net.cmd.bind.port").ToString())); * musServer = new SnowTcpListener(new IPEndPoint((IPAddress)ConfigManager.GetValue("net.cmd.bind.ip"), (int)ConfigManager.GetValue("net.cmd.bind.port")), * (int)ConfigManager.GetValue("net.backlog"), new OnNewConnectionCallback( * CommandListener.parse));*/ using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient()) { Output.WriteLine(Localization.GetValue("core.init.dbcleanup")); PerformDatabaseCleanup(MySqlClient); Output.WriteLine(Localization.GetValue("core.init.game")); // Core DataRouter.Initialize(); // Sessions, characters SessionManager.Initialize(); // RandomGenerator.Initialize(); StatisticsSyncUtil.Initialize(); //Global Handler Global.Initialize(); //Login Handler Login.Initialize(); CharacterInfoLoader.Initialize(); UserCredentialsAuthenticator.Initialize(); //Bpad Handler LaptopHandler.Initialize(); //FlowerHandler FlowerPower.Initialize(); ContestHandler.Initialize(); CatalogManager.Initialize(MySqlClient); NewsCacheManager.Initialize(MySqlClient); SpaceInfoLoader.Initialize(); Navigator.Initialize(MySqlClient); LaptopHandler.Initialize(); UserCredentialsAuthenticator.Initialize(); SpaceManager.Initialize(MySqlClient); SpaceHandler.Initialize(); SilverCoinsWorker.Initialize(); } } catch (Exception e) { HandleFatalError(Localization.GetValue("core.init.error.details", new string[] { e.Message, e.StackTrace })); return; } // Init complete TimeSpan TimeSpent = DateTime.Now - InitStart; Output.WriteLine(Localization.GetValue("core.init.ok", Math.Round(TimeSpent.TotalSeconds, 2).ToString()), OutputLevel.Notification); Output.WriteLine((string)Localization.GetValue("core.init.ok.cmdinfo"), OutputLevel.Notification); Console.Write("$" + Environment.UserName.ToLower() + "@snowlight> "); Console.Beep(); Input.Listen(); // This will make the main thread process console while Program.Alive. }