SynchronizeInitialConfiguration() public method

Force synchronization of database configuration.
public SynchronizeInitialConfiguration ( IALFADatabase Database ) : void
Database IALFADatabase Supplies the database object to use for /// database connectivity.
return void
        /// <summary>
        /// This method initializes the server communicator (one-time startup
        /// processing).
        /// </summary>
        private void InitializeServerCommunicator()
        {
            int ServerId;

            if (Database == null)
                Database = new ALFA.Database(this);

            ServerId = Database.ACR_GetServerID();

            WorldManager = new GameWorldManager(
                ServerId,
                GetName(GetModule()));
            NetworkManager = new ServerNetworkManager(WorldManager, ServerId, this);
            PlayerStateTable = new Dictionary<uint, PlayerState>();

            //
            // Remove any stale IPC commands to this server, as we are starting
            // up fresh.
            //

            Database.ACR_SQLExecute(String.Format(
                "DELETE FROM `server_ipc_events` WHERE `DestinationServerID`={0}",
                Database.ACR_GetServerID()));

            WriteTimestampedLogEntry(String.Format(
                "ACR_ServerCommunicator.InitializeServerCommunicator: Purged {0} old records from server_ipc_events for server id {1}.",
                Database.ACR_SQLGetAffectedRows(),
                Database.ACR_GetServerID()));
            WriteTimestampedLogEntry(String.Format(
                "ACR_ServerCommunicator.InitializeServerCommunicator: Server started with ACR version {0} and IPC subsystem version {1}.",
                Database.ACR_GetVersion(),
                Assembly.GetExecutingAssembly().GetName().Version.ToString()));

            if (GetLocalInt(GetModule(), "ACR_SERVER_IPC_DISABLE_LATENCY_CHECK") == FALSE)
                EnableLatencyCheck = true;
            else
                EnableLatencyCheck = false;

            if (!EnableLatencyCheck)
                WriteTimestampedLogEntry("ACR_ServerCommunicator.InitializeServerCommunicator: Latency check turned off by configuration.");

            WorldManager.SynchronizeInitialConfiguration(Database);

            RecordModuleResources();
            PatchContentFiles();
            ConfigureWer();

            RunPatchInitScript();

            //
            // Finally, drop into the command polling loop.
            //

            CommandDispatchLoop();
            UpdateServerExternalAddress();
        }
        /// <summary>
        /// This method initializes the server communicator (one-time startup
        /// processing).
        /// </summary>
        private void InitializeServerCommunicator()
        {
            int ServerId;

            if (Database == null)
                Database = new ALFA.Database(this);

            ServerId = Database.ACR_GetServerID();

            WorldManager = new GameWorldManager(
                ServerId,
                GetName(GetModule()));
            NetworkManager = new ServerNetworkManager(WorldManager, ServerId, this);
            PlayerStateTable = new Dictionary<uint, PlayerState>();

            //
            // Remove any stale IPC commands to this server, as we are starting
            // up fresh.
            //

            Database.ACR_SQLExecute(String.Format(
                "DELETE FROM `server_ipc_events` WHERE `DestinationServerID`={0}",
                Database.ACR_GetServerID()));

            WriteTimestampedLogEntry(String.Format(
                "ACR_ServerCommunicator.InitializeServerCommunicator: Purged {0} old records from server_ipc_events for server id {1}.",
                Database.ACR_SQLGetAffectedRows(),
                Database.ACR_GetServerID()));
            WriteTimestampedLogEntry(String.Format(
                "ACR_ServerCommunicator.InitializeServerCommunicator: Server started with ACR version {0} and IPC subsystem version {1}.",
                Database.ACR_GetVersion(),
                Assembly.GetExecutingAssembly().GetName().Version.ToString()));

            if (GetLocalInt(GetModule(), "ACR_SERVER_IPC_DISABLE_LATENCY_CHECK") == FALSE)
                EnableLatencyCheck = true;
            else
                EnableLatencyCheck = false;

            if (!EnableLatencyCheck)
                WriteTimestampedLogEntry("ACR_ServerCommunicator.InitializeServerCommunicator: Latency check turned off by configuration.");

            WorldManager.SynchronizeInitialConfiguration(Database);

            //
            // Check that the module is allowed to come online.  If it may be
            // hosted on another machine due to a recovery event, do not allow
            // the module to come online.
            //

            if (!ConfirmModuleOnline())
            {
                //
                // This module has been administratively prevented from loading
                // on all but a specific machine.  Await that condition to be
                // cleared from the database.  Do not initialize the vault
                // connector so that new logons are blocked, and set the
                // offline variable so that periodic time update does not mark
                // the server as online in the database.
                //

                WriteTimestampedLogEntry("ACR_ServerCommunicator.InitializeServerCommunicator: Module offlined because MachineName in servers table for this server is not NULL and does not match the machine name of this server.  This indicates that server startup was blocked for manual recovery.  Clear the MachineName field from the servers table in the database for this server to allow this server to start up normally.");
                SetLocalInt(GetModule(), "ACR_MODULE_OFFLINE", TRUE);
                PollModuleOnlineAllowed();
                SendInfrastructureDiagnosticIrcMessage(String.Format(
                    "Server '{0}' started on a machine that is administratively prohibited from loading the module, going into offline mode until MachineName is cleared in the servers table in the database for this server.",
                    GetName(GetModule())));
                WorldManager.PauseUpdates = true;
                return;
            }

            if (!ServerVaultConnector.Initialize(this, WorldManager.Configuration.VaultConnectionString, WorldManager.Configuration.VerboseVaultLogging))
                WriteTimestampedLogEntry("ACR_ServerCommunicator.InitializeServerCommunicator: ServerVaultConnector failed to initialize.");

            if (!String.IsNullOrEmpty(WorldManager.Configuration.VaultConnectionString))
                WriteTimestampedLogEntry("ACR_ServerCommunicator.InitializeServerCommunicator: Using Azure-based vault storage.");

            RecordModuleResources();
            PatchContentFiles();
            ConfigureWer();

            RunPatchInitScript();

            //
            // Finally, drop into the command polling loop.
            //

            CommandDispatchLoop();
            UpdateServerExternalAddress();
            GameDifficultyCheck();
        }