void LoadEcoProps()
        {
            eco_cbEnabled.Checked = Economy.Enabled;
            eco_txtCurrency.Text  = Server.Config.Currency;
            Eco_UpdateEnables();

            foreach (Item item in Economy.Items)
            {
                eco_cmbCfg.Items.Add(item.Name);
            }
            eco_cmbCfg.Items.Add("(none)");
            eco_cmbCfg.SelectedIndex = eco_cmbCfg.Items.Count - 1;

            GuiPerms.SetRanks(eco_cmbItemRank);
            eco_colRankPrice.CellTemplate = new NumericalCell();
            eco_dgvRanks.DataError       += eco_dgv_DataError;

            eco_colLvlPrice.CellTemplate = new NumericalCell();
            eco_colLvlX.CellTemplate     = new NumericalCell();
            eco_colLvlY.CellTemplate     = new NumericalCell();
            eco_colLvlZ.CellTemplate     = new NumericalCell();
            eco_colLvlTheme.CellTemplate = new ThemeCell();

            foreach (MapGen gen in MapGen.Generators)
            {
                if (gen.Type == GenType.Advanced)
                {
                    continue;
                }
                eco_colLvlTheme.Items.Add(gen.Theme);
            }
            eco_dgvMaps.DataError += eco_dgv_DataError;
        }
예제 #2
0
        void PropertyWindow_Load(object sender, EventArgs e)
        {
            // try to use same icon as main window
            // must be done in OnLoad, otherwise icon doesn't show on Mono
            GuiUtils.SetIcon(this);

            OnMapsChangedEvent.Register(HandleMapsChanged, Priority.Low);
            OnStateChangedEvent.Register(HandleStateChanged, Priority.Low);
            GuiPerms.UpdateRanks();

            GuiPerms.SetRanks(blk_cmbMin);
            GuiPerms.SetRanks(cmd_cmbMin);

            //Load server stuff
            LoadProperties();
            LoadRanks();
            try {
                LoadCommands();
                LoadBlocks();
            } catch (Exception ex) {
                Logger.LogError("Error loading commands and blocks", ex);
            }

            LoadGameProps();
        }
        void LoadSecurityProps()
        {
            sec_cbLogNotes.Checked     = Server.Config.LogNotes;
            sec_cbVerifyAdmins.Checked = Server.Config.verifyadmins;
            sec_cbWhitelist.Checked    = Server.Config.WhitelistedOnly;
            GuiPerms.SetRanks(sec_cmbVerifyRank);
            GuiPerms.SetSelectedRank(sec_cmbVerifyRank, Server.Config.VerifyAdminsRank);
            sec_cmbVerifyRank.Enabled = Server.Config.verifyadmins;

            sec_cbChatAuto.Checked = Server.Config.ChatSpamCheck;
            sec_numChatMsgs.Value  = Server.Config.ChatSpamCount;
            sec_numChatSecs.Value  = Server.Config.ChatSpamInterval;
            sec_numChatMute.Value  = Server.Config.ChatSpamMuteTime;
            ToggleChatSpamSettings(Server.Config.ChatSpamCheck);

            sec_cbCmdAuto.Checked = Server.Config.CmdSpamCheck;
            sec_numCmdMsgs.Value  = Server.Config.CmdSpamCount;
            sec_numCmdSecs.Value  = Server.Config.CmdSpamInterval;
            sec_numCmdMute.Value  = Server.Config.CmdSpamBlockTime;
            ToggleCmdSpamSettings(Server.Config.CmdSpamCheck);

            sec_cbBlocksAuto.Checked = Server.Config.BlockSpamCheck;
            sec_numBlocksMsgs.Value  = Server.Config.BlockSpamCount;
            sec_numBlocksSecs.Value  = Server.Config.BlockSpamInterval;
            ToggleBlocksSpamSettings(Server.Config.BlockSpamCheck);

            sec_cbIPAuto.Checked = Server.Config.IPSpamCheck;
            sec_numIPMsgs.Value  = Server.Config.IPSpamCount;
            sec_numIPSecs.Value  = Server.Config.IPSpamInterval;
            sec_numIPMute.Value  = Server.Config.IPSpamBlockTime;
            ToggleIPSpamSettings(sec_cbIPAuto.Checked);
        }
        void LoadRankProps()
        {
            LoadDefaultRank();
            GuiPerms.SetRanks(rank_cmbOsMap);
            GuiPerms.SetSelectedRank(rank_cmbOsMap, Server.Config.OSPerbuildDefault);

            rank_cbTPHigher.Checked     = Server.Config.HigherRankTP;
            rank_cbSilentAdmins.Checked = Server.Config.AdminsJoinSilently;
            rank_cbEmpty.Checked        = Server.Config.ListEmptyRanks;
        }
        void CommandInitSpecificArrays()
        {
            if (commandItems.MinBox != null)
            {
                return;
            }
            commandItems.MinBox        = cmd_cmbMin;
            commandItems.AllowBoxes    = new ComboBox[] { cmd_cmbAlw1, cmd_cmbAlw2, cmd_cmbAlw3 };
            commandItems.DisallowBoxes = new ComboBox[] { cmd_cmbDis1, cmd_cmbDis2, cmd_cmbDis3 };
            commandItems.FillInitial();

            commandExtraBoxes = new ComboBox[] { cmd_cmbExtra1, cmd_cmbExtra2, cmd_cmbExtra3,
                                                 cmd_cmbExtra4, cmd_cmbExtra5, cmd_cmbExtra6, cmd_cmbExtra7 };
            commandExtraLabels = new Label[] { cmd_lblExtra1, cmd_lblExtra2, cmd_lblExtra3,
                                               cmd_lblExtra4, cmd_lblExtra5, cmd_lblExtra6, cmd_lblExtra7 };
            GuiPerms.SetRanks(commandExtraBoxes);
        }
        void LoadIRCProps()
        {
            irc_chkEnabled.Checked = Server.Config.UseIRC;
            irc_txtServer.Text     = Server.Config.IRCServer;
            irc_numPort.Value      = Server.Config.IRCPort;
            irc_txtNick.Text       = Server.Config.IRCNick;
            irc_txtChannel.Text    = Server.Config.IRCChannels;
            irc_txtOpChannel.Text  = Server.Config.IRCOpChannels;
            irc_chkPass.Checked    = Server.Config.IRCIdentify;
            irc_txtPass.Text       = Server.Config.IRCPassword;

            irc_cbTitles.Checked       = Server.Config.IRCShowPlayerTitles;
            irc_cbWorldChanges.Checked = Server.Config.IRCShowWorldChanges;
            irc_cbAFK.Checked          = Server.Config.IRCShowAFK;
            ToggleIrcSettings(Server.Config.UseIRC);

            GuiPerms.SetRanks(irc_cmbRank);
            GuiPerms.SetSelectedRank(irc_cmbRank, Server.Config.IRCControllerRank);
            irc_cmbVerify.Items.AddRange(Enum.GetNames(typeof(IRCControllerVerify)));
            irc_cmbVerify.SelectedIndex = (int)Server.Config.IRCVerify;
            irc_txtPrefix.Text          = Server.Config.IRCCommandPrefix;
        }
예제 #7
0
 public void FillInitial()
 {
     GuiPerms.SetRanks(AllowBoxes, true);
     GuiPerms.SetRanks(DisallowBoxes, true);
 }