Exemple #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();
        }
Exemple #2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            GlobalHandler.Initialize();
            GlobalHandler.ConnectionHandler.ChangedStatus += ChangedStatus;

            chat     = new FormChat();
            overflow = new FormOverflow();
            random   = new FormRandom();
            custom   = new FormCustom();
            about    = new FormAbout();
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            mAlive = true;
            DateTime InitStart = DateTime.Now;

            // Set up basic output, configuration, etc
            Output.InitializeStream(true, OutputLevel.DebugInformation);
            Output.WriteLine("Initializing Snowlight...");

            ConfigManager.Initialize(Constants.DataFileDirectory + "\\server-main.cfg");
            Output.SetVerbosityLevel((OutputLevel)ConfigManager.GetValue("output.verbositylevel"));

            // Load Lang
            LangManager.Initialize(Constants.LangFileDirectory + "\\lang_" + ConfigManager.GetValue("lang") + ".lang");

            // Process args
            foreach (string arg in args)
            {
                Output.WriteLine("Command line argument: " + arg);
                Input.ProcessInput(arg.Split(' '));
            }

            try
            {
                // Initialize and test database
                Output.WriteLine("Initializing MySQL manager...");
                SqlDatabaseManager.Initialize();

                // Initialize network components
                Output.WriteLine("Setting up server listener on port " + (int)ConfigManager.GetValue("net.bind.port") + "...");
                mServer = new SnowTcpListener(new IPEndPoint(IPAddress.Any, (int)ConfigManager.GetValue("net.bind.port")),
                                              (int)ConfigManager.GetValue("net.backlog"), new OnNewConnectionCallback(
                                                  SessionManager.HandleIncomingConnection));

                using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
                {
                    Output.WriteLine("Resetting database counters and statistics...");
                    PerformDatabaseCleanup(MySqlClient);

                    Output.WriteLine("Initializing game components and workers...");

                    // Core
                    DataRouter.Initialize();

                    // Sessions, characters
                    Handshake.Initialize();
                    GlobalHandler.Initialize();
                    SessionManager.Initialize();
                    CharacterInfoLoader.Initialize();
                    RightsManager.Initialize(MySqlClient);
                    SingleSignOnAuthenticator.Initialize();

                    // Room management and navigator
                    RoomManager.Initialize(MySqlClient);
                    RoomInfoLoader.Initialize();
                    RoomHandler.Initialize();
                    RoomItemHandler.Initialize();
                    Navigator.Initialize(MySqlClient);

                    // Help and moderation
                    HelpTool.Initialize(MySqlClient);
                    ModerationPresets.Initialize(MySqlClient);
                    ModerationTicketManager.Initialize(MySqlClient);
                    ModerationHandler.Initialize();
                    ModerationBanManager.Initialize(MySqlClient);

                    // Catalog, pets and items
                    ItemDefinitionManager.Initialize(MySqlClient);
                    CatalogManager.Initialize(MySqlClient);
                    CatalogPurchaseHandler.Initialize();
                    Inventory.Initialize();
                    ItemEventDispatcher.Initialize();
                    PetDataManager.Initialize(MySqlClient);

                    // Messenger
                    MessengerHandler.Initialize();

                    // Achievements and quests
                    AchievementManager.Initialize(MySqlClient);
                    QuestManager.Initialize(MySqlClient);

                    // Misc/extras
                    CrossdomainPolicy.Initialize("Data\\crossdomain.xml");
                    InfobusManager.Initialize();
                    ActivityPointsWorker.Initialize();
                    BotManager.Initialize(MySqlClient);
                    InterstitialManager.Initialize(MySqlClient);
                    ChatEmotions.Initialize();
                    EffectsCacheWorker.Initialize();
                    RecyclerManager.Initialize(MySqlClient);
                    DrinkSetManager.Initialize(MySqlClient);
                    SongManager.Initialize();
                    TradeHandler.Initialize();
                    RandomGenerator.Initialize();
                    StatisticsSyncUtil.Initialize();

                    // Polish
                    WarningSurpressors.Initialize();
                }
            }
            catch (Exception e)
            {
                HandleFatalError("Could not initialize Snowlight: " + e.Message + "\n" + e.StackTrace);
                return;
            }

            // Init complete
            TimeSpan TimeSpent = DateTime.Now - InitStart;

            Output.WriteLine("The server has initialized successfully (" + Math.Round(TimeSpent.TotalSeconds, 2) + " seconds). Ready for connections.", OutputLevel.Notification);
            Output.WriteLine((string)LangManager.GetValue("initialized.info.cmd"), OutputLevel.Notification);

            Console.Beep();
            Input.Listen(); // This will make the main thread process console while Program.Alive.
        }
Exemple #4
0
        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
                    Handshake.Initialize();
                    GlobalHandler.Initialize();
                    SessionManager.Initialize();
                    CharacterInfoLoader.Initialize();
                    RightsManager.Initialize(MySqlClient);
                    SingleSignOnAuthenticator.Initialize();

                    // Room management and navigator
                    RoomManager.Initialize(MySqlClient);
                    RoomInfoLoader.Initialize();
                    RoomHandler.Initialize();
                    RoomItemHandler.Initialize();
                    Navigator.Initialize(MySqlClient);

                    // Help and moderation
                    HelpTool.Initialize(MySqlClient);
                    ModerationPresets.Initialize(MySqlClient);
                    ModerationTicketManager.Initialize(MySqlClient);
                    ModerationHandler.Initialize();
                    ModerationBanManager.Initialize(MySqlClient);

                    // Catalog, pets and items
                    ItemDefinitionManager.Initialize(MySqlClient);
                    CatalogManager.Initialize(MySqlClient);
                    CatalogPurchaseHandler.Initialize();
                    Inventory.Initialize();
                    ItemEventDispatcher.Initialize();
                    PetDataManager.Initialize(MySqlClient);

                    // Messenger
                    MessengerHandler.Initialize();

                    // Achievements and quests
                    AchievementManager.Initialize(MySqlClient);
                    QuestManager.Initialize(MySqlClient);

                    // Misc/extras
                    CrossdomainPolicy.Initialize("Data\\crossdomain.xml");
                    InfobusManager.Initialize();
                    ActivityPointsWorker.Initialize();
                    BotManager.Initialize(MySqlClient);
                    InterstitialManager.Initialize(MySqlClient);
                    ChatEmotions.Initialize();
                    EffectsCacheWorker.Initialize();
                    RecyclerManager.Initialize(MySqlClient);
                    DrinkSetManager.Initialize(MySqlClient);
                    SongManager.Initialize();
                    TradeHandler.Initialize();
                    RandomGenerator.Initialize();
                    StatisticsSyncUtil.Initialize();
                    Wordfilter.Initialize(MySqlClient);

                    // Polish
                    WarningSurpressors.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.
        }