Esempio n. 1
0
        /// <summary>
        /// Server content loading and start up
        /// </summary>
        public override void Start()
        {
            #region Internal StartUp
            DBManager.SetConnectionData(
                Settings.SqlEngine,
                "Server=" + Settings.SqlIp + ";Database=" + Settings.SqlDatabase + ";UID=" + Settings.SqlUsername + ";PWD=" + Settings.SqlPassword + ";Connection Timeout=5;",
                "",
                ""
            );

            using (DBManager dbManager = new DBManager(Databases.Auth))
            {
                if (dbManager.TestConnection())
                    ConsoleUtils.ShowInfo("Auth database connection test passed");
                else
                    return;
            }

            Database.Statements.Init();
            this.GameServers = new Dictionary<ushort, GameServer>();
            #endregion

            #region Listener StartUp
            GameManager.Instance.Start();
            ClientManager.Instance.Start();
            #endregion
        }
Esempio n. 2
0
        /// <summary>
        /// Server content loading and start up
        /// </summary>
        public override void Start()
        {
            PendingUsers = new Dictionary<string, PendingUserData>();

            // Sets server connection data
            DBManager.SetConnectionData(
                (SqlEngine)Settings.SqlEngine,
                "",
                "Server=" + Settings.SqlGameIp + ";Database=" + Settings.SqlGameDatabase + ";UID=" + Settings.SqlGameUsername + ";PWD=" + Settings.SqlGamePassword + ";Connection Timeout=5;",
                "Server = " + Settings.SqlUserIp + "; Database = " + Settings.SqlUserDatabase + "; UID = " + Settings.SqlUserUsername + "; PWD = " + Settings.SqlUserPassword + "; Connection Timeout = 5;"
            );

            using (DBManager dbManager = new DBManager(Databases.Game))
            {
                if (dbManager.TestConnection())
                    ConsoleUtils.ShowInfo("Game database connection test passed");
                else
                    return;
            }

            using (DBManager dbManager = new DBManager(Databases.User))
            {
                if (dbManager.TestConnection())
                    ConsoleUtils.ShowInfo("User database connection test passed");
                else
                    return;
            }
            #region Content Load

            Statements.Init();
            Arcadia.Init(sqlConType, sqlConString);

            // Pre-process the url list so it doesn't have to be generated everytime.
            StringBuilder urlList = new StringBuilder();

            urlList.Append("guild.url|");
            urlList.Append(Settings.GuildUrl);
            urlList.Append("|guild_test_download.url|");
            urlList.Append(Settings.GuildTestDownloadUrl);
            urlList.Append("|web_download|");
            urlList.Append(Settings.WebDownload);
            urlList.Append("|web_download_port|");
            urlList.Append(Settings.WebDownloadPort);
            urlList.Append("|shop.url|");
            urlList.Append(Settings.ShopUrl);
            urlList.Append("|ghelp_url|");
            urlList.Append(Settings.GHelpUrl);
            urlList.Append("|guild_icon_upload.ip|");
            urlList.Append(Settings.GuildIconUploadIp);
            urlList.Append("|guild_icon_upload.port|");
            urlList.Append(Settings.GuildIconUploadPort);

            UrlList = urlList.ToString();

            #endregion

            AuthManager.Instance.Start();
            ClientManager.Instance.Start();
        }