Esempio n. 1
0
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            // hide everything related to service
            HasToExit = false;
            serviceStatusLabel.Hide();
            serviceStatusValueLabel.Hide();
            restartServiceButton.Hide();
            stopServiceButton.Hide();

            Text = MyPerServerSettings.GameName + " - Dedicated server configurator";

            if (m_isService)
            {
                // show everything that is related to service
                restartServiceButton.Show();
                stopServiceButton.Show();
                serviceStatusLabel.Show();
                serviceStatusValueLabel.Show();
                serviceStatusValueLabel.Text = "";

                // update service label
                updateServiceStatus();
            }

            MyLoadListResult worldList = new MyLoadListResult();

            m_loadWorldsAsync      = new MyLoadListResult();
            worldListTimer.Enabled = true;
            MySandboxGame.ConfigDedicated.Load();

            UpdateLoadedData();
        }
Esempio n. 2
0
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            // hide everything related to service
            HasToExit = false;
            serviceStatusLabel.Hide();
            serviceStatusValueLabel.Hide();
            restartServiceButton.Hide();
            stopServiceButton.Hide();

            if (m_isService)
            {
                // show everything that is related to service
                restartServiceButton.Show();
                stopServiceButton.Show();
                serviceStatusLabel.Show();
                serviceStatusValueLabel.Show();
                serviceStatusValueLabel.Text = "";

                // update service label
                updateServiceStatusLabel();
            }

            MyLoadListResult worldList = new MyLoadListResult();

            m_loadWorldsAsync = new MyLoadListResult();
            timer1.Enabled    = true;

            MySandboxGame.ConfigDedicated.Load();

            IPTextBox.Text               = MySandboxGame.ConfigDedicated.IP;
            QueryPortUD.Value            = MySandboxGame.ConfigDedicated.ServerPort;
            serverNameTextBox.Text       = MySandboxGame.ConfigDedicated.ServerName;
            worldNameTextBox.Text        = MySandboxGame.ConfigDedicated.WorldName;
            SteamGroupID.Text            = MySandboxGame.ConfigDedicated.GroupID.ToString();
            adminIDs.Text                = string.Join(Environment.NewLine, MySandboxGame.ConfigDedicated.Administrators.ToArray());
            bannedIDs.Text               = string.Join(Environment.NewLine, MySandboxGame.ConfigDedicated.Banned.ToArray());
            modIdsTextBox.Text           = string.Join(Environment.NewLine, MySandboxGame.ConfigDedicated.Mods.ToArray());
            pauseWhenEmptyCHB.Checked    = MySandboxGame.ConfigDedicated.PauseGameWhenEmpty;
            ignoreLastSessionCHB.Checked = MySandboxGame.ConfigDedicated.IgnoreLastSession;

            scenarioCB.Items.Clear();

            var scenarioId = MySandboxGame.ConfigDedicated.Scenario;

            MyDefinitionManager.Static.LoadScenarios();

            foreach (var scenario in MyDefinitionManager.Static.GetScenarioDefinitions())
            {
                ScenarioItem item = new ScenarioItem()
                {
                    Definition = scenario
                };
                scenarioCB.Items.Add(item);
                if (scenario.Id == scenarioId)
                {
                    scenarioCB.SelectedItem = item;
                }
            }
            if (scenarioCB.Items.Count > 0 && scenarioCB.SelectedIndex == -1)
            {
                scenarioCB.SelectedIndex = 0;
            }

            asteroidAmountUD.Value = MySandboxGame.ConfigDedicated.AsteroidAmount;
        }