Ejemplo n.º 1
0
        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();
        }