public bool Has(Privileges flags) { bool hasPrivileges = false; CPrivileges cpriv = new CPrivileges((UInt32)flags); cpriv.SetLowestPrivileges(this); if ((cpriv.PrivilegesFlags & (UInt32)flags) == (UInt32)flags) { hasPrivileges = true; } return(hasPrivileges); }
private void m_prcConnection_ProconPrivileges(PRoConClient sender, CPrivileges spPrivs) { this.InvokeIfRequired(() => { if (spPrivs.CanIssueLimitedProconPluginCommands == true && this.tbcClientTabs.TabPages.Contains(this.m_tabParentLayerControl) == false) { this.tbcClientTabs.TabPages.Add(this.m_tabParentLayerControl); this.m_tabParentLayerControl.ImageKey = "sitemap_color.png"; /* this.m_prcConnection.SendCommand(new List<string> { "procon.account.listAccounts" }); this.m_prcConnection.SendCommand(new List<string> { "procon.account.listLoggedIn" }); this.m_prcConnection.SendCommand(new List<string> { "procon.plugin.listLoaded" }); this.m_prcConnection.SendCommand(new List<string> { "procon.plugin.listEnabled" }); */ } else if (spPrivs.CanIssueLimitedProconCommands == false && this.tbcClientTabs.TabPages.Contains(this.m_tabParentLayerControl) == true) { this.tbcClientTabs.TabPages.Remove(this.m_tabParentLayerControl); } if (this.m_praApplication.OptionsSettings.LayerHideLocalPlugins == true) { this.tbcClientTabs.TabPages.Remove(this.tabPlugins); // this.tabPlugins.Hide(); } if (this.m_praApplication.OptionsSettings.LayerHideLocalAccounts == true) { this.tbcClientTabs.TabPages.Remove(this.tabAccounts); // this.tabAccounts.Hide(); } this.pnlMapControls.Visible = spPrivs.CanUseMapFunctions; this.m_prcConnection.SendGetProconVarsPacket("TEMP_BAN_CEILING"); //this.m_prcConnection.SendRequest(new List<string> { "procon.vars", "TEMP_BAN_CEILING" }); }); }
/* public List<string> SetListsSettings { set { bool blChecked = true; if (value.Count >= 1 && bool.TryParse(value[0], out blChecked) == true) { this.spltBanlistManualBans.Panel2Collapsed = !blChecked; this.picCloseOpenManualBans_Click(null, null); } } } public string ListsSettings { get { return String.Format("{0}", this.spltBanlistManualBans.Panel2Collapsed); } } */ public uscListControlPanel() { InitializeComponent(); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.m_regIP = new Regex(@"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", RegexOptions.Compiled); this.m_regPbGUID = new Regex("^[A-Fa-f0-9]{32}$", RegexOptions.Compiled); this.m_regBc2GUID = new Regex("^(?:E|e)(?:A|a)_[A-Fa-f0-9]{32}$", RegexOptions.Compiled); this.m_lvwReservedSlotsColumnSorter = new ListViewColumnSorter(); this.lsvReservedList.ListViewItemSorter = this.m_lvwReservedSlotsColumnSorter; this.m_lvwSpectatorSlotsColumnSorter = new ListViewColumnSorter(); this.lsvSpectatorList.ListViewItemSorter = this.m_lvwSpectatorSlotsColumnSorter; this.m_lvwBanlistColumnSorter = new ListViewColumnSorter(); this.lsvBanlist.ListViewItemSorter = this.m_lvwBanlistColumnSorter; this.pnlReservedPanel.Dock = DockStyle.Fill; this.pnlSpectatorPanel.Dock = DockStyle.Fill; this.m_fntComboBoxSelectedFont = new Font("Segoe UI", 10, FontStyle.Bold); this.m_blSettingAppendingReservedPlayer = false; this.m_blSettingRemovingReservedPlayer = false; this.m_blSettingAppendingSpectatorPlayer = false; this.m_blSettingRemovingSpectatorPlayer = false; this.m_dicAsyncSettingControls = new Dictionary<string, AsyncStyleSetting>(); // Reservedlist updates this.m_dicAsyncSettingControls.Add("local.reservedlist.list", new AsyncStyleSetting(this.picReservedList, this.lsvReservedList, new Control[] { this.btnReservedSlotsListRefresh }, true)); this.m_dicAsyncSettingControls.Add("local.reservedlist.append", new AsyncStyleSetting(this.picReservedAddSoldierName, this.lsvReservedList, new Control[] { this.lblReservedAddSoldierName, this.txtReservedAddSoldierName, this.lnkReservedAddSoldierName }, true)); this.m_dicAsyncSettingControls.Add("local.reservedlist.remove", new AsyncStyleSetting(this.picReservedList, this.lsvReservedList, new Control[] { this.btnReservedRemoveSoldier }, true)); // SpectatorList updates this.m_dicAsyncSettingControls.Add("local.spectatorlist.list", new AsyncStyleSetting(this.picSpectatorList, this.lsvSpectatorList, new Control[] { this.btnSpectatorSlotsListRefresh }, true)); this.m_dicAsyncSettingControls.Add("local.spectatorlist.append", new AsyncStyleSetting(this.picSpectatorAddSoldierName, this.lsvSpectatorList, new Control[] { this.lblSpectatorAddSoldierName, this.txtSpectatorAddSoldierName, this.lnkSpectatorAddSoldierName }, true)); this.m_dicAsyncSettingControls.Add("local.spectatorlist.remove", new AsyncStyleSetting(this.picSpectatorList, this.lsvSpectatorList, new Control[] { this.btnSpectatorRemoveSoldier }, true)); this.m_dicAsyncSettingControls.Add("local.banlist.clearlist", new AsyncStyleSetting(this.picClearLists, this.btnBanlistClearBanlist, new Control[] { this.btnBanlistClearBanlist }, true)); this.m_dicAsyncSettingControls.Add("local.banlist.unban", new AsyncStyleSetting(this.picUnbanPlayer, this.btnBanlistUnban, new Control[] { this.btnBanlistUnban }, true)); this.m_dicAsyncSettingControls.Add("local.banlist.banning", new AsyncStyleSetting(this.picBanlistManualBanOkay, this.btnBanlistAddBan, new Control[] { this.btnBanlistAddBan }, false)); this.ma_strTimeDescriptionsShort = new string[] { "y ", "y ", "M ", "M ", "w ", "w ", "d ", "d ", "h ", "h ", "m ", "m ", "s ", "s " }; this.ma_strTimeDescriptionsLong = new string[] { " year ", " years ", " month ", " months ", " week ", " weeks ", " day ", " days ", " hour ", " hours ", " minute ", " minutes ", " second", " seconds" }; this.cboBanlistTimeMultiplier.SelectedIndex = 0; this.m_spPrivileges = new CPrivileges(CPrivileges.FullPrivilegesFlags); this.BansSource = new BansSource { Take = this.pagination1.ItemsPerPage = 30 }; this.pagination1.Source = this.BansSource; this.BansSource.Changed += BansSourceOnChanged; }
public void m_prcClient_ProconPrivileges(PRoConClient sender, CPrivileges spPrivs) { this.InvokeIfRequired(() => { this.m_spPrivileges = spPrivs; this.m_dicAsyncSettingControls["local.reservedlist.append"].m_blReEnableControls = this.m_spPrivileges.CanEditReservedSlotsList; this.m_dicAsyncSettingControls["local.reservedlist.remove"].m_blReEnableControls = this.m_spPrivileges.CanEditReservedSlotsList; if (this.lsvReservedList.SelectedItems.Count > 0) { this.btnReservedRemoveSoldier.Enabled = this.m_spPrivileges.CanEditReservedSlotsList; } // ELSE It'll already be disabled this.lnkReservedAddSoldierName.Enabled = this.m_spPrivileges.CanEditReservedSlotsList; this.m_dicAsyncSettingControls["local.spectatorlist.append"].m_blReEnableControls = this.m_spPrivileges.CanEditReservedSlotsList; this.m_dicAsyncSettingControls["local.spectatorlist.remove"].m_blReEnableControls = this.m_spPrivileges.CanEditReservedSlotsList; if (this.lsvSpectatorList.SelectedItems.Count > 0) { this.btnSpectatorRemoveSoldier.Enabled = this.m_spPrivileges.CanEditReservedSlotsList; } // ELSE It'll already be disabled this.lnkSpectatorAddSoldierName.Enabled = this.m_spPrivileges.CanEditReservedSlotsList; this.m_dicAsyncSettingControls["local.banlist.clearlist"].m_blReEnableControls = this.m_spPrivileges.CanEditBanList; this.m_dicAsyncSettingControls["local.banlist.unban"].m_blReEnableControls = this.m_spPrivileges.CanEditBanList; this.btnBanlistClearBanlist.Enabled = this.m_spPrivileges.CanEditBanList; if (this.lsvBanlist.SelectedItems.Count > 0) { this.btnBanlistUnban.Enabled = this.m_spPrivileges.CanEditBanList; } // ELSE It'll already be disabled // Manual banning.. this.rdoBanlistPbGUID.Enabled = this.rdoBanlistPermanent.Enabled = this.m_spPrivileges.CanPermanentlyBanPlayers; if (this.rdoBanlistPbGUID.Checked == true && this.rdoBanlistPbGUID.Enabled == false) { this.rdoBanlistName.Checked = true; } if (this.rdoBanlistPermanent.Checked == true && this.rdoBanlistPermanent.Enabled == false) { this.rdoBanlistTemporary.Checked = true; } this.spltBanlistManualBans.Panel2.Enabled = this.m_spPrivileges.CanTemporaryBanPlayers; }); }
public void SetLowestPrivileges(CPrivileges spCompare) { Privileges newPrivilegesFlags = 0; newPrivilegesFlags |= (this.CanLogin && spCompare.CanLogin) ? Privileges.CanLogin : 0; newPrivilegesFlags |= (this.CanAlterServerSettings && spCompare.CanAlterServerSettings) ? Privileges.CanAlterServerSettings : 0; newPrivilegesFlags |= (this.CanUseMapFunctions && spCompare.CanUseMapFunctions) ? Privileges.CanUseMapFunctions : 0; newPrivilegesFlags |= (this.CannotPunishPlayers || spCompare.CannotPunishPlayers) ? Privileges.CannotPunishPlayers : 0; newPrivilegesFlags |= (this.CanKillPlayers && spCompare.CanKillPlayers) ? Privileges.CanKillPlayers : 0; newPrivilegesFlags |= (this.CanKickPlayers && spCompare.CanKickPlayers) ? Privileges.CanKickPlayers : 0; newPrivilegesFlags |= (this.CanTemporaryBanPlayers && spCompare.CanTemporaryBanPlayers) ? Privileges.CanTemporaryBanPlayers : 0; newPrivilegesFlags |= (this.CanPermanentlyBanPlayers && spCompare.CanPermanentlyBanPlayers) ? Privileges.CanPermanentlyBanPlayers : 0; newPrivilegesFlags |= (this.CanMovePlayers && spCompare.CanMovePlayers) ? Privileges.CanMovePlayers : 0; newPrivilegesFlags |= (this.CannotIssuePunkbusterCommands || spCompare.CannotIssuePunkbusterCommands) ? Privileges.CannotIssuePunkbusterCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedPunkbusterCommands && spCompare.CanIssueLimitedPunkbusterCommands) ? Privileges.CanIssueLimitedPunkbusterCommands : 0; newPrivilegesFlags |= (this.CanIssueAllPunkbusterCommands && spCompare.CanIssueAllPunkbusterCommands) ? Privileges.CanIssueAllPunkbusterCommands : 0; newPrivilegesFlags |= (this.CanEditBanList && spCompare.CanEditBanList) ? Privileges.CanEditBanList : 0; newPrivilegesFlags |= (this.CanEditMapList && spCompare.CanEditMapList) ? Privileges.CanEditMapList : 0; newPrivilegesFlags |= (this.CanEditReservedSlotsList && spCompare.CanEditReservedSlotsList) ? Privileges.CanEditReservedSlotsList : 0; newPrivilegesFlags |= (this.CannotIssueProconCommands || spCompare.CannotIssueProconCommands) ? Privileges.CannotIssueProconCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedProconPluginCommands && spCompare.CanIssueLimitedProconPluginCommands) ? Privileges.CanIssueLimitedProconPluginCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedProconCommands && spCompare.CanIssueLimitedProconCommands) ? Privileges.CanIssueLimitedProconCommands : 0; newPrivilegesFlags |= (this.CanIssueAllProconCommands && spCompare.CanIssueAllProconCommands) ? Privileges.CanIssueAllProconCommands : 0; newPrivilegesFlags |= (this.CanEditMapZones && spCompare.CanEditMapZones) ? Privileges.CanEditMapZones : 0; newPrivilegesFlags |= (this.CanEditTextChatModerationList && spCompare.CanEditTextChatModerationList) ? Privileges.CanEditTextChatModerationList : 0; newPrivilegesFlags |= (this.CanShutdownServer && spCompare.CanShutdownServer) ? Privileges.CanShutdownServer : 0; this.PrivilegesFlags = (UInt32) newPrivilegesFlags; }
/* private int GetTempBanCeiling() { int iReturn = 3600; if (this.m_uscConnectionPanel != null && this.m_uscConnectionPanel.SV_Variables.ContainsKey("TEMP_BAN_CEILING") == true) { if (int.TryParse(this.m_uscConnectionPanel.SV_Variables["TEMP_BAN_CEILING"], out iReturn) == false) { iReturn = 3600; } } // else return 3600 return iReturn; } */ public void SetPrivileges(CPrivileges spPrivileges) { this.m_spPrivileges = spPrivileges; //this.Enabled = !this.m_spPrivileges.CannotPunishPlayers; this.rdoKick.Enabled = this.m_spPrivileges.CanKickPlayers; this.rdoTemporaryBan.Enabled = this.m_spPrivileges.CanTemporaryBanPlayers; this.rdoPermanentlyBan.Enabled = this.m_spPrivileges.CanPermanentlyBanPlayers; if (this.rdoPermanentlyBan.Enabled == false && this.rdoPermanentlyBan.Checked == true) { this.rdoTemporaryBan.Checked = true; } if (this.rdoTemporaryBan.Enabled == false && this.rdoTemporaryBan.Checked == true) { this.rdoKick.Checked = true; } if (this.rdoKick.Enabled == false && this.rdoKick.Checked == true) { this.rdoKill.Checked = true; } if (this.rdoKill.Enabled == false && this.rdoKill.Checked == true) { this.rdoKill.Checked = false; } if (this.rdoKill.Checked == false && this.rdoKick.Checked == false && this.rdoTemporaryBan.Checked == false && this.rdoPermanentlyBan.Checked == false) { this.rdoKill.Checked = true; } }
private void uscPrivileges_OnUpdatePrivileges(string strAccountName, CPrivileges spUpdatedPrivs) { if (this.lsvLayerAccounts.SelectedItems.Count > 0) { this.WaitForSettingResponse("procon.layer.setPrivileges"); this.m_prcClient.SendProconLayerSetPrivilegesPacket(this.lsvLayerAccounts.SelectedItems[0].Text, spUpdatedPrivs.PrivilegesFlags); } this.ShowLayerPanel(this.pnlMainLayerServer); }
private void Client_ProconPrivileges(PRoConClient sender, CPrivileges privileges) { this.InvokeIfRequired(() => { this.Privileges = privileges; this.kbpPunkbusterPunishPanel.Enabled = (!this.Privileges.CannotPunishPlayers && this.Privileges.CanIssueLimitedPunkbusterCommands); this.kbpPunkbusterPunishPanel.SetPrivileges(this.Privileges); this.kbpBfbcPunishPanel.Enabled = !this.Privileges.CannotPunishPlayers; this.kbpBfbcPunishPanel.SetPrivileges(this.Privileges); }); }
// Erweitern!!! Die Gamemodes m??n eingef??werden private bool isInWhitelist(string wlPlayer) { WritePluginConsole("Check if " + wlPlayer + " is in Whitelist", "Info", 2); if (Auto_Whitelist_Admins == enumBoolYesNo.Yes) { currentPrivileges = GetAccountPrivileges(wlPlayer); //Use ProCon Account as wlist Player if (currentPrivileges != null) { WritePluginConsole("Player has an ProCon Account", "Info", 5); return true; } } // Gerneral Whitelist if (mWhitelist_isEnabled == enumBoolYesNo.Yes) // Is General Whitelist Enabled { WritePluginConsole("Check General Player Whitelist...", "Info", 5); if (m_PlayerWhitelist.Contains(wlPlayer)) // Is Player in General Player Whitelist { WritePluginConsole(wlPlayer + " is in General Player Whitelist", "Info", 2); return true; } if (m_ClanWhitelist.Count >= 1 && m_ClanWhitelist[0] != "") // Is General Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check General Clan Whitelist...", "Info", 5); if (m_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in General Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in General Clan Whitelist", "Info", 2); return true; } } } // Private Mode Whitelist if (serverMode == "private") // Is PRIVATE MODE Enabled { WritePluginConsole("Check PRIVATE MODE Player Whitelist...", "Info", 5); if (pm_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in PRIVATE MODE Player Whitelist", "Info", 2); return true; } if (pm_ClanWhitelist.Count >= 1 && pm_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check PRIVATE MODE Clan Whitelist...", "Info", 5); if (pm_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in PRIVATE MODE Clan Whitelist", "Info", 2); return true; } } } // Flagrun Mode Whitelist if (serverMode == "flagrun") // Is PRIVATE MODE Enabled { WritePluginConsole("Check FLAGRUN MODE Player Whitelist...", "Info", 5); if (fm_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in PRIVATE MODE Player Whitelist", "Info", 2); return true; } if (fm_ClanWhitelist.Count >= 1 && fm_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check FLAGRUN MODE Clan Whitelist...", "Info", 5); if (fm_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in FLAGRUN MODE Clan Whitelist", "Info", 2); return true; } } } // Pistol Only Mode Whitelist if (serverMode == "pistol") // Is PRIVATE MODE Enabled { WritePluginConsole("Check PISTOL ONLY MODE Player Whitelist...", "Info", 5); if (pom_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in PISTOL ONLY MODE Player Whitelist", "Info", 2); return true; } if (pom_ClanWhitelist.Count >= 1 && pom_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check PISTOL ONLY MODE Clan Whitelist...", "Info", 5); if (pom_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in PISTOL ONLY MODE Clan Whitelist", "Info", 2); return true; } } } // Knife Only Mode Whitelist if (serverMode == "knife") // Is PRIVATE MODE Enabled { WritePluginConsole("Check KNIFE ONLY MODE Player Whitelist...", "Info", 5); if (kom_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in KNIFE ONLY MODE Player Whitelist", "Info", 2); return true; } if (kom_ClanWhitelist.Count >= 1 && kom_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check KNIFE ONLY MODE Clan Whitelist...", "Info", 5); if (kom_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in KNIFE ONLY MODE Clan Whitelist", "Info", 2); return true; } } } // Shotgun Only Mode Whitelist if (serverMode == "shotgun") // Is PRIVATE MODE Enabled { WritePluginConsole("Check SHOTGUN ONLY MODE Player Whitelist...", "Info", 5); if (sm_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in SHOTGUN ONLY MODE Player Whitelist", "Info", 2); return true; } if (sm_ClanWhitelist.Count >= 1 && sm_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check SHOTGUN ONLY MODE Clan Whitelist...", "Info", 5); if (sm_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in SHOTGUN ONLY MODE Clan Whitelist", "Info", 2); return true; } } } // BoltAction Only Mode Whitelist if (serverMode == "boltaction") // Is PRIVATE MODE Enabled { WritePluginConsole("Check BOLTACTION ONLY MODE Player Whitelist...", "Info", 5); if (bam_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in BOLTACTION ONLY MODE Player Whitelist", "Info", 2); return true; } if (bam_ClanWhitelist.Count >= 1 && pom_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check BOLTACTION ONLY MODE Clan Whitelist...", "Info", 5); if (bam_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in BOLTACTION ONLY MODE Clan Whitelist", "Info", 2); return true; } } } // Autosniper (DMR) Only Mode Whitelist if (serverMode == "autosniper") // Is PRIVATE MODE Enabled { WritePluginConsole("Check AUTOSNIPER (DMR) ONLY MODE Player Whitelist...", "Info", 5); if (dmr_PlayerWhitelist.Contains(wlPlayer)) // Is Player in Player Whitelist { WritePluginConsole(wlPlayer + " is in AUTOSNIPER (DMR) ONLY MODE Player Whitelist", "Info", 2); return true; } if (dmr_ClanWhitelist.Count >= 1 && dmr_ClanWhitelist[0] != "") // Is Clan Whitelist NOT Empty { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " Check AUTOSNIPER (DMR) ONLY MODE Clan Whitelist...", "Info", 5); if (dmr_ClanWhitelist.Contains(players.GetPlayerClanTag(wlPlayer))) // Get Player Clantag from Battlelog and check if it is in Clan Whitelist { WritePluginConsole(wlPlayer + " has Clantag: " + players.GetPlayerClanTag(wlPlayer) + " is in AUTOSNIPER (DMR) ONLY MODE Clan Whitelist", "Info", 2); return true; } } } WritePluginConsole(wlPlayer + " is not in Whitelist", "Info", 2); return false; }
//public void OnAccountDeleted(string strAccountName) { //} private void m_prcClient_RemoteAccountAltered(PRoConClient sender, string accountName, CPrivileges accountPrivileges) { this.InvokeIfRequired(() => { if (this.lsvLayerAccounts.Items.ContainsKey(accountName) == true) { this.OnSettingResponse("procon.layer.setPrivileges", true); this.lsvLayerAccounts.Items[accountName].SubItems["rconaccess"].Tag = accountPrivileges; this.RefreshLayerPrivilegesPanel(); } }); }
private bool IsAdmin(string speaker) { bool isAdmin = false; currentPrivileges = GetAccountPrivileges(speaker); if (currentPrivileges != null) { if (currentPrivileges.CanLogin) isAdmin = true; /* .CanKillPlayers .CanKickPlayers .CanTemporaryBanPlayers .CanPermanentlyBanPlayers .CanMovePlayers .CanUseMapFunctions .CanLogin .CanAlterServerSettings .CanUseMapFunctions .CanPermanentlyBanPlayers .CanMovePlayers .CanIssueAllPunkbusterCommands .CanEditMapList .CanEditBanList .CanEditReservedSlotsList .CanIssueAllProconCommands .CanEditMapZones .CanEditTextChatModerationList .CanShutdownServer */ } return isAdmin; }
void uscPrivileges_OnUpdatePrivileges(string strAccountName, CPrivileges spUpdatedPrivs) { if (this._client.Layer.AccountPrivileges.Contains(strAccountName) == true) { this._client.Layer.AccountPrivileges[strAccountName].SetPrivileges(spUpdatedPrivs); } this.ShowLayerPanel(this.pnlMainLayerServer); this.RefreshLayerPrivilegesPanel(); }
public static string GetConfirmationLabel(out bool blAbleToPunish, string strBanDescription, CPrivileges cpPrivileges, CLocalization clocLanguage, bool blKill, bool blKick, bool blPerm, bool blTemp, TextBox txtTime, ComboBox cboTimeMultiplier, string[] a_strTimeDescriptionsLong, int iTempBanCeiling) { string strLabel = String.Empty; blAbleToPunish = false; if (clocLanguage != null) { if (blKill == true) { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.Kill", new string[] { strBanDescription }); blAbleToPunish = true && (cpPrivileges.CanKillPlayers == true); } else if (blKick == true) { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.Kick", new string[] { strBanDescription }); blAbleToPunish = true && (cpPrivileges.CanKickPlayers == true); } else if (blPerm == true) { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.PermanentBan", new string[] { strBanDescription }); blAbleToPunish = true && (cpPrivileges.CanPermanentlyBanPlayers == true); } else if (blTemp == true) { string strBanLength = uscPlayerPunishPanel.GetBanLength(txtTime, cboTimeMultiplier, a_strTimeDescriptionsLong); if (strBanLength.Length > 0) { // strLabel += " for " + strBanLength; if (cpPrivileges.CanTemporaryBanPlayers == true && cpPrivileges.CanPermanentlyBanPlayers == false && (uscPlayerPunishPanel.GetBanLength(txtTime, cboTimeMultiplier) * 60) > iTempBanCeiling) { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.TemporaryBan.ToLong", new string[] { uscPlayerPunishPanel.SecondsToText((UInt32)(iTempBanCeiling), a_strTimeDescriptionsLong) }); blAbleToPunish = false; } else { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.TemporaryBan", new string[] { strBanDescription, clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.TemporaryBan.Time", new string[] { strBanLength }) }); blAbleToPunish = true && (cpPrivileges.CanTemporaryBanPlayers == true); } } else { strLabel = clocLanguage.GetLocalized("uscPlayerPunishPanel.lblConfirmation.TemporaryBan", new string[] { strBanDescription, String.Empty }); blAbleToPunish = false; } } strLabel += ":"; } return strLabel; }
public uscServerConnection(PRoConApplication paProcon, PRoConClient prcConnection, frmMain frmParent, frmManageAccounts frmAccounts) { //public uscServerConnection(PRoConApplication paProcon, ProConClient prcConnection, frmMain frmParent, frmManageAccounts frmAccounts, uscServerPlayerTreeview uscServerPlayerTree, string strHost, UInt16 iu16Port, string strUsername, string strPassword) { InitializeComponent(); this.m_praApplication = paProcon; this.m_prcConnection = prcConnection; this.m_prcConnection.GameTypeDiscovered += new PRoConClient.EmptyParamterHandler(m_prcConnection_GameTypeDiscovered); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.m_cpPrivileges = new CPrivileges(CPrivileges.FullPrivilegesFlags); this.m_frmParent = frmParent; this.m_frmAccounts = frmAccounts; this.tbcClientTabs.ImageList = this.m_frmParent.iglIcons; this.uscLogin.BackgroundHostPort = prcConnection.HostNamePort; if (prcConnection.State != ConnectionState.Connected) { this.uscLogin.Dock = DockStyle.Fill; this.uscLogin.Show(); } else { this.uscLogin.Hide(); } this.uscLists.OnTabChange += new OnTabChangeDelegate(uscLists_OnTabChange); this.tabPlayerList.ImageKey = "mouse.png"; this.tabLists.ImageKey = "table.png"; this.tabChat.ImageKey = "comments.png"; this.tabEvents.ImageKey = "flag_blue.png"; this.tabMapView.ImageKey = "map-pin.png"; this.tabServerSettings.ImageKey = "server_edit.png"; this.tabPlugins.ImageKey = "plugin.png"; this.tabAccounts.ImageKey = "vcard.png"; this.tabConsole.ImageKey = "application_xp_terminal.png"; #region Map Controls this.SettingLoading = this.m_frmParent.picAjaxStyleLoading.Image; this.SettingSuccess = this.m_frmParent.picAjaxStyleSuccess.Image; this.SettingFail = this.m_frmParent.picAjaxStyleFail.Image; this.btnRestartRound.Image = this.m_frmParent.iglIcons.Images["arrow-retweet.png"]; this.btnNextRound.Image = this.m_frmParent.iglIcons.Images["arrow-step-over.png"]; this.AsyncSettingControls.Add("admin.runNextRound", new AsyncStyleSetting(this.picNextRound, null, new Control[] { this.btnNextRound }, true)); this.AsyncSettingControls.Add("admin.restartRound", new AsyncStyleSetting(this.picRestartRound, null, new Control[] { this.btnRestartRound }, true)); #endregion this.uscPlugins.GetPluginDetails += new uscPluginPanel.GetPluginDetailsDelegate(uscPlugins_GetPluginDetails); this.uscPlugins.SetPluginVariable += new uscPluginPanel.SetPluginVariableDelegate(uscPlugins_SetPluginVariable); this.uscPlugins.PluginEnabled += new uscPluginPanel.PluginEnabledDelegate(uscPlugins_PluginEnabled); this.uscPlugins.PluginLoaded += new uscPluginPanel.PluginEventDelegate(uscPlugins_PluginLoaded); this.uscPlugins.PluginVariablesAltered += new uscPluginPanel.PluginEventDelegate(uscPlugins_PluginVariablesAltered); this.uscPlugins.ReloadPlugins += new uscPluginPanel.EventDelegate(uscPlugins_ReloadPlugins); this.uscPlugins.OnTabChange += new OnTabChangeDelegate(uscPlugins_OnTabChange); this.uscAccounts.ManageAccountsRequest += new uscAccountsPanel.ManageAccountsRequestDelegate(uscAccounts_ManageAccountsRequest); this.uscServerConsole.SendCommand += new uscConsolePanel.SendCommandDelegate(uscServerConsole_SendCommand); this.uscServerConsole.SendListCommand += new uscConsolePanel.SendListCommandDelegate(uscServerConsole_SendListCommand); this.uscServerConsole.OnTabChange += new OnTabChangeDelegate(uscServerConsole_OnTabChange); this.m_tabParentLayerControl = new TabPage("Parent Layer Control"); this.m_tabParentLayerControl.Name = "tabLayerControl"; this.m_tabParentLayerControl.Padding = new Padding(8); this.m_tabParentLayerControl.UseVisualStyleBackColor = true; this.m_uscParentLayerControl = new uscParentLayerControl(); this.m_uscParentLayerControl.Dock = DockStyle.Fill; this.m_uscParentLayerControl.BackColor = Color.Transparent; //this.m_uscParentLayerControl.SendCommand += new uscParentLayerControl.SendCommandDelegate(m_uscParentLayerControl_SendCommand); this.m_uscParentLayerControl.Initialize(this.m_frmParent, this); this.m_tabParentLayerControl.Controls.Add(m_uscParentLayerControl); this.m_uscParentLayerControl.OnTabChange += new OnTabChangeDelegate(m_uscParentLayerControl_OnTabChange); this.uscPlugins.Initialize(this.m_frmParent, this); this.uscPlugins.SetConnection(this.m_prcConnection); this.uscLogin.Initalize(this.m_frmParent, this); this.uscLogin.SetConnection(this.m_prcConnection); this.uscLogin.SetLocalization(this.m_prcConnection.Language); this.uscMap.SetConnection(this.m_prcConnection); this.uscEvents.SetConnection(this.m_prcConnection); this.uscLists.SetConnection(this.m_prcConnection); this.uscSettings.SetConnection(this.m_prcConnection); this.uscServerConsole.SetConnection(this.m_prcConnection); this.uscChat.SetConnection(this.m_prcConnection); this.uscPlayers.SetConnection(this.m_prcConnection); this.m_uscParentLayerControl.SetConnection(this.m_prcConnection); this.uscAccounts.SetConnection(this.m_praApplication, this.m_prcConnection); }
void m_prcClient_ProconPrivileges(PRoConClient sender, CPrivileges spPrivs) { this.InvokeIfRequired(() => { this.m_isConnectionValid = true; this.RequestInitialSettings(); }); }
public void OnAccountPrivilegesUpdate(string strUsername, CPrivileges cpPrivs) { }
public void ExecutePRoConCommand(object objSender, List<string> lstWords, int iRecursion) { if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.protected.weapons.add", true) == 0 && objSender is PRoConClient) { if (((PRoConClient)objSender).Weapons.Contains(lstWords[2]) == false && Enum.IsDefined(typeof(Kits), lstWords[1]) == true && Enum.IsDefined(typeof(WeaponSlots), lstWords[3]) == true && Enum.IsDefined(typeof(DamageTypes), lstWords[4]) == true) { //this.SavedWindowState = (System.Windows.Forms.FormWindowState)Enum.Parse(typeof(System.Windows.Forms.FormWindowState), lstWords[1]); ((PRoConClient)objSender).Weapons.Add( new Weapon( (Kits)Enum.Parse(typeof(Kits), lstWords[1]), lstWords[2], (WeaponSlots)Enum.Parse(typeof(WeaponSlots), lstWords[3]), (DamageTypes)Enum.Parse(typeof(DamageTypes), lstWords[4]) ) ); } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.weapons.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Weapons.Clear(); } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.zones.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).MapGeometry.MapZones.Clear(); } else if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.protected.zones.add", true) == 0 && objSender is PRoConClient) { List<Point3D> points = new List<Point3D>(); int iPoints = 0; if (int.TryParse(lstWords[4], out iPoints) == true) { for (int i = 0, iOffset = 5; i < iPoints && iOffset + 3 <= lstWords.Count; i++) { points.Add(new Point3D(lstWords[iOffset++], lstWords[iOffset++], lstWords[iOffset++])); } } if (((PRoConClient)objSender).MapGeometry.MapZones.Contains(lstWords[1]) == false) { ((PRoConClient)objSender).MapGeometry.MapZones.Add(new MapZoneDrawing(lstWords[1], lstWords[2], lstWords[3], points.ToArray(), true)); } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.specialization.add", true) == 0 && objSender is PRoConClient) { if (((PRoConClient)objSender).Specializations.Contains(lstWords[2]) == false && Enum.IsDefined(typeof(SpecializationSlots), lstWords[1]) == true) { ((PRoConClient)objSender).Specializations.Add(new Specialization((SpecializationSlots)Enum.Parse(typeof(SpecializationSlots), lstWords[1]), lstWords[2])); } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.specialization.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Specializations.Clear(); } else if (lstWords.Count >= 5 && String.Compare(lstWords[0], "procon.protected.teamnames.add", true) == 0 && objSender is PRoConClient) { if (lstWords.Count >= 6) { int iTeamID = 0; if (int.TryParse(lstWords[2], out iTeamID) == true) { ((PRoConClient)objSender).ProconProtectedTeamNamesAdd(lstWords[1], iTeamID, lstWords[3], lstWords[4], lstWords[5]); } } else { int iTeamID = 0; if (int.TryParse(lstWords[2], out iTeamID) == true) { ((PRoConClient)objSender).ProconProtectedTeamNamesAdd(lstWords[1], iTeamID, lstWords[3], lstWords[4]); } } } else if (lstWords.Count >= 6 && String.Compare(lstWords[0], "procon.protected.maps.add", true) == 0 && objSender is PRoConClient) { int iDefaultSquadID = 0; if (int.TryParse(lstWords[5], out iDefaultSquadID) == true) { ((PRoConClient)objSender).ProconProtectedMapsAdd(lstWords[1], lstWords[2], lstWords[3], lstWords[4], iDefaultSquadID); } } else if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.protected.plugins.setVariable", true) == 0 && objSender is PRoConClient) { string strUnescapedNewlines = lstWords[3].Replace(@"\n", "\n"); strUnescapedNewlines = strUnescapedNewlines.Replace(@"\r", "\r"); strUnescapedNewlines = strUnescapedNewlines.Replace(@"\""", "\""); ((PRoConClient)objSender).ProconProtectedPluginSetVariable(lstWords[1], lstWords[2], strUnescapedNewlines); } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.vars.set", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Variables.SetVariable(lstWords[1], lstWords[2]); } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.layer.setPrivileges", true) == 0 && objSender is PRoConClient) { CPrivileges sprPrivs = new CPrivileges(); UInt32 ui32Privileges = 0; if (UInt32.TryParse(lstWords[2], out ui32Privileges) == true) { sprPrivs.PrivilegesFlags = ui32Privileges; if (this.AccountsList.Contains(lstWords[1]) == true) { ((PRoConClient)objSender).ProconProtectedLayerSetPrivileges(this.AccountsList[lstWords[1]], sprPrivs); } } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.send", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); // Block them from changing the admin password to X if (String.Compare(lstWords[0], "vars.adminPassword", true) != 0) { ((PRoConClient)objSender).SendRequest(lstWords); } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.public.accounts.create", true) == 0) { this.AccountsList.CreateAccount(lstWords[1], lstWords[2]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.public.accounts.delete", true) == 0) { this.AccountsList.DeleteAccount(lstWords[1]); } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.public.accounts.setPassword", true) == 0) { this.AccountsList.ChangePassword(lstWords[1], lstWords[2]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.config.exec", true) == 0 && objSender is PRoConClient) { if (iRecursion < 5) { ((PRoConClient)objSender).ExecuteConnectionConfig(lstWords[1], iRecursion, lstWords.Count > 2 ? lstWords.GetRange(2, lstWords.Count - 2) : null, false); } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.pluginconsole.write", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).PluginConsole.Write(lstWords[1]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.console.write", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Console.Write(lstWords[1]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.chat.write", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ChatConsole.WriteViaCommand(lstWords[1]); } else if (lstWords.Count >= 5 && String.Compare(lstWords[0], "procon.protected.events.write", true) == 0 && objSender is PRoConClient) { // EventType etType, CapturableEvents ceEvent, string strEventText, DateTime dtLoggedTime, string instigatingAdmin if (Enum.IsDefined(typeof(EventType), lstWords[1]) == true && Enum.IsDefined(typeof(CapturableEvents), lstWords[2]) == true) { EventType type = (EventType)Enum.Parse(typeof(EventType), lstWords[1]); CapturableEvents cappedEventType = (CapturableEvents)Enum.Parse(typeof(CapturableEvents), lstWords[2]); CapturedEvent cappedEvent = new CapturedEvent(type, cappedEventType, lstWords[3], DateTime.Now, lstWords[4]); ((PRoConClient)objSender).EventsLogging.ProcessEvent(cappedEvent); } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.layer.enable", true) == 0 && objSender is PRoConClient) { // procon.protected.layer.enable <true> <port> bool blEnabled = false; UInt16 ui16Port = 0; if (bool.TryParse(lstWords[1], out blEnabled) == true) { if (lstWords.Count >= 5) { UInt16.TryParse(lstWords[2], out ui16Port); ((PRoConClient)objSender).ProconProtectedLayerEnable(blEnabled, ui16Port, lstWords[3], lstWords[4]); } else { ((PRoConClient)objSender).ProconProtectedLayerEnable(blEnabled, 27260, "0.0.0.0", "PRoCon[%servername%]"); } } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.teamnames.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedTeamNamesClear(); } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.maps.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedMapsClear(); } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.reasons.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedReasonsClear(); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.reasons.add", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedReasonsAdd(lstWords[1]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.serverversions.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedServerVersionsClear(lstWords[1]); } else if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.protected.serverversions.add", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedServerVersionsAdd(lstWords[1], lstWords[2], lstWords[3]); } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.plugins.enable", true) == 0 && objSender is PRoConClient) { bool blEnabled = false; if (bool.TryParse(lstWords[2], out blEnabled) == true) { ((PRoConClient)objSender).ProconProtectedPluginEnable(lstWords[1], blEnabled); } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.private.servers.add", true) == 0 && objSender == this) { // add IP port [password [username]] // procon.private.servers.add "127.0.0.1" 27260 "Password" "Phogue" UInt16 ui16Port = 0; if (UInt16.TryParse(lstWords[2], out ui16Port) == true) { if (lstWords.Count == 3) { this.AddConnection(lstWords[1], ui16Port, String.Empty, String.Empty); } else if (lstWords.Count == 4) { this.AddConnection(lstWords[1], ui16Port, String.Empty, lstWords[3]); } else if (lstWords.Count == 5) { this.AddConnection(lstWords[1], ui16Port, lstWords[4], lstWords[3]); } } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.private.servers.connect", true) == 0 && objSender == this) { if (this.Connections.Contains(lstWords[1] + ":" + lstWords[2]) == true) { this.Connections[lstWords[1] + ":" + lstWords[2]].ProconPrivateServerConnect(); } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.private.servers.autoconnect", true) == 0 && objSender == this) { if (this.Connections.Contains(lstWords[1] + ":" + lstWords[2]) == true) { this.Connections[lstWords[1] + ":" + lstWords[2]].AutomaticallyConnect = true; // Originally leaving it for the reconnect thread to pickup but needed a quicker effect. this.Connections[lstWords[1] + ":" + lstWords[2]].ProconPrivateServerConnect(); } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.private.servers.name", true) == 0 && objSender == this) { // CurrentServerInfo not initialized. if (this.Connections.Contains(lstWords[1] + ":" + lstWords[2]) == true) { this.Connections[lstWords[1] + ":" + lstWords[2]].ConnectionServerName = lstWords[3]; } } /* else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.private.servers.name", true) == 0 && objSender == this) { this.uscServerPlayerTreeviewListing.SetServerName(lstWords[1] + ":" + lstWords[2], lstWords[3]); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.window.splitterPosition", true) == 0 && objSender == this) { int iPositionVar = 0; if (int.TryParse(lstWords[1], out iPositionVar) == true) { if (iPositionVar >= this.spltTreeServers.Panel1MinSize && iPositionVar <= this.spltTreeServers.Width - this.spltTreeServers.Panel2MinSize) { this.spltTreeServers.SplitterDistance = iPositionVar; } } } */ else if (lstWords.Count >= 6 && String.Compare(lstWords[0], "procon.private.window.position", true) == 0 && objSender == this) { Rectangle recWindowBounds = new Rectangle(0, 0, 1024, 768); int iPositionVar = 0; if (Enum.IsDefined(typeof(System.Windows.Forms.FormWindowState), lstWords[1]) == true) { this.SavedWindowState = (System.Windows.Forms.FormWindowState)Enum.Parse(typeof(System.Windows.Forms.FormWindowState), lstWords[1]); if (int.TryParse(lstWords[2], out iPositionVar) == true) { if (iPositionVar >= 0) { recWindowBounds.X = iPositionVar; } } if (int.TryParse(lstWords[3], out iPositionVar) == true) { if (iPositionVar >= 0) { recWindowBounds.Y = iPositionVar; } } if (int.TryParse(lstWords[4], out iPositionVar) == true) { recWindowBounds.Width = iPositionVar; } if (int.TryParse(lstWords[5], out iPositionVar) == true) { recWindowBounds.Height = iPositionVar; } this.SavedWindowBounds = recWindowBounds; } } // procon.private.httpWebServer.enable true 27360 "0.0.0.0" else if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.private.httpWebServer.enable", true) == 0 && objSender == this) { bool blEnabled = false; string bindingAddress = "0.0.0.0"; UInt16 ui16Port = 27360; if (bool.TryParse(lstWords[1], out blEnabled) == true) { if (this.HttpWebServer != null) { this.HttpWebServer.Shutdown(); this.HttpWebServer.ProcessRequest -= new HttpWebServer.ProcessResponseHandler(HttpWebServer_ProcessRequest); this.HttpWebServer.HttpServerOnline -= new HttpWebServer.StateChangeHandler(HttpWebServer_HttpServerOnline); this.HttpWebServer.HttpServerOffline -= new HttpWebServer.StateChangeHandler(HttpWebServer_HttpServerOffline); } bindingAddress = lstWords[3]; if (UInt16.TryParse(lstWords[2], out ui16Port) == false) { ui16Port = 27360; } this.HttpWebServer = new HttpWebServer(bindingAddress, ui16Port); this.HttpWebServer.ProcessRequest += new HttpWebServer.ProcessResponseHandler(HttpWebServer_ProcessRequest); this.HttpWebServer.HttpServerOnline += new HttpWebServer.StateChangeHandler(HttpWebServer_HttpServerOnline); this.HttpWebServer.HttpServerOffline += new HttpWebServer.StateChangeHandler(HttpWebServer_HttpServerOffline); if (blEnabled == true) { this.HttpWebServer.Start(); } } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.setLanguage", true) == 0 && objSender == this) { // if it does not exist but they have explicity asked for it, see if we can load it up // this could not be loaded because it is running in lean mode. if (this.Languages.Contains(lstWords[1]) == false) { this.Languages.LoadLocalizationFile(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Localization"), lstWords[1]), lstWords[1]); } if (this.Languages.Contains(lstWords[1]) == true) { this.CurrentLanguage = this.Languages[lstWords[1]]; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.autoCheckDownloadUpdates", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AutoCheckDownloadUpdates = blEnabled; // Force an update check right now.. if (this.OptionsSettings.AutoCheckDownloadUpdates == true) { //this.CheckVersion(); //this.VersionCheck("http://www.phogue.net/procon/version.php"); } } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.autoApplyUpdates", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AutoApplyUpdates = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.autoCheckGameConfigsForUpdates", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AutoCheckGameConfigsForUpdates = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.allowanonymoususagedata", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AllowAnonymousUsageData = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.consoleLogging", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ConsoleLogging = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.eventsLogging", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.EventsLogging = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.chatLogging", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ChatLogging = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.pluginLogging", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.PluginLogging = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.showtrayicon", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ShowTrayIcon = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.minimizetotray", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.MinimizeToTray = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.closetotray", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.CloseToTray = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.runPluginsInSandbox", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.RunPluginsInTrustedSandbox = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.adminMoveMessage", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AdminMoveMessage = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.chatDisplayAdminName", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ChatDisplayAdminName = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.EnableAdminReason", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.EnableAdminReason = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.layerHideLocalPlugins", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.LayerHideLocalPlugins = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.layerHideLocalAccounts", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.LayerHideLocalAccounts = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.ShowRoundTimerConstantly", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ShowRoundTimerConstantly = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.ShowCfmMsgRoundRestartNext", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ShowCfmMsgRoundRestartNext = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.ShowDICESpecialOptions", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.ShowDICESpecialOptions = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.allowAllODBCConnections", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AllowAllODBCConnections = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.allowAllSmtpConnections", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.AllowAllSmtpConnections = blEnabled; } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.private.options.trustedHostDomainsPorts", true) == 0 && objSender == this) { lstWords.RemoveAt(0); UInt16 ui16Port = 0; for (int i = 0; i + 1 < lstWords.Count; i = i + 2) { if (UInt16.TryParse(lstWords[i + 1], out ui16Port) == true) { this.OptionsSettings.TrustedHostsWebsitesPorts.Add(new TrustedHostWebsitePort(lstWords[i], ui16Port)); } } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.private.options.statsLinksMaxNum", true) == 0 && objSender == this) { int itmp = 4; if (int.TryParse(lstWords[1], out itmp) == true) { this.OptionsSettings.StatsLinksMaxNum = itmp; } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.private.options.statsLinkNameUrl", true) == 0 && objSender == this) { this.OptionsSettings.StatsLinkNameUrl.Clear(); lstWords.RemoveAt(0); for (int i = 0; i + 1 < lstWords.Count; i = i + 2) { if (this.OptionsSettings.StatsLinkNameUrl.Count < this.OptionsSettings.StatsLinksMaxNum) { this.OptionsSettings.StatsLinkNameUrl.Add(new StatsLinkNameUrl(lstWords[i], lstWords[i + 1])); } } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.private.options.pluginMaxRuntime", true) == 0 && objSender == this && this.OptionsSettings.PluginMaxRuntimeLocked == false) { this.OptionsSettings.PluginMaxRuntime_m = 0; this.OptionsSettings.PluginMaxRuntime_s = 10; lstWords.RemoveAt(0); int itmp = 0; if (lstWords.Count == 2) { if (int.TryParse(lstWords[0], out itmp) == true) { if (itmp < 0) { itmp = 0; } if (itmp >= 60) { itmp = 59; } this.OptionsSettings.PluginMaxRuntime_m = itmp; } itmp = 10; if (int.TryParse(lstWords[1], out itmp) == true) { if (itmp < 0) { itmp = 0; } if (itmp >= 60) { itmp = 59; } this.OptionsSettings.PluginMaxRuntime_s = itmp; } } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.UsePluginOldStyleLoad", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.UsePluginOldStyleLoad = blEnabled; } } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.private.options.enablePluginDebugging", true) == 0 && objSender == this) { bool blEnabled = false; if (bool.TryParse(lstWords[1], out blEnabled) == true) { this.OptionsSettings.EnablePluginDebugging = blEnabled; } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.notification.write", true) == 0 && objSender is PRoConClient) { bool blError = false; if (lstWords.Count >= 4 && bool.TryParse(lstWords[3], out blError) == true) { if (this.ShowNotification != null) { this.ShowNotification(2000, lstWords[1], lstWords[2], blError); } } else { if (this.ShowNotification != null) { this.ShowNotification(2000, lstWords[1], lstWords[2], false); } } } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.playsound", true) == 0 && objSender is PRoConClient) { int iRepeat = 0; string blah = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Media"), lstWords[1]); if (int.TryParse(lstWords[2], out iRepeat) == true && iRepeat > 0 && File.Exists(Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Media"), lstWords[1])) == true) { //this.Invoke(new DispatchProconProtectedPlaySound(this.PlaySound), new object[] { lstWords[1], iRepeat }); ((PRoConClient)objSender).PlaySound(lstWords[1], iRepeat); } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.stopsound", true) == 0 && objSender is PRoConClient) { //this.Invoke(new DispatchProconProtectedStopSound(this.StopSound), new object[] { default(SPlaySound) }); ((PRoConClient)objSender).StopSound(default(PRoConClient.SPlaySound)); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.events.captures", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); ((PRoConClient)objSender).EventsLogging.Settings = lstWords; } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.playerlist.settings", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); ((PRoConClient)objSender).PlayerListSettings.Settings = lstWords; } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.chat.settings", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); ((PRoConClient)objSender).ChatConsole.Settings = lstWords; } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.lists.settings", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); ((PRoConClient)objSender).ListSettings.Settings = lstWords; } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.console.settings", true) == 0 && objSender is PRoConClient) { lstWords.RemoveAt(0); ((PRoConClient)objSender).Console.Settings = lstWords; } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.timezone_UTCoffset", true) == 0 && objSender is PRoConClient) { double UTCoffset; if (double.TryParse(lstWords[1], out UTCoffset) == true) { ((PRoConClient)objSender).Game.UtcOffset = UTCoffset; } else { ((PRoConClient)objSender).Game.UtcOffset = 0; } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.tasks.clear", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedTasksClear(); } else if (lstWords.Count >= 2 && String.Compare(lstWords[0], "procon.protected.tasks.remove", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedTasksRemove(lstWords[1]); } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.tasks.list", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).ProconProtectedTasksList(); } else if (lstWords.Count >= 4 && String.Compare(lstWords[0], "procon.protected.tasks.add", true) == 0 && objSender is PRoConClient) { int iDelay = 0, iInterval = 1, iRepeat = -1; string strTaskName = String.Empty; if (int.TryParse(lstWords[1], out iDelay) == true && int.TryParse(lstWords[2], out iInterval) == true && int.TryParse(lstWords[3], out iRepeat) == true) { lstWords.RemoveRange(0, 4); ((PRoConClient)objSender).ProconProtectedTasksAdd(String.Empty, lstWords, iDelay, iInterval, iRepeat); } else if (lstWords.Count >= 5 && int.TryParse(lstWords[2], out iDelay) == true && int.TryParse(lstWords[3], out iInterval) == true && int.TryParse(lstWords[4], out iRepeat) == true) { strTaskName = lstWords[1]; lstWords.RemoveRange(0, 5); ((PRoConClient)objSender).ProconProtectedTasksAdd(strTaskName, lstWords, iDelay, iInterval, iRepeat); } } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.vars.list", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Console.Write("Local Variables: [Variable] [Value]"); foreach (Variable kvpVariable in ((PRoConClient)objSender).Variables) { ((PRoConClient)objSender).Console.Write(String.Format("{0} \"{1}\"", kvpVariable.Name, kvpVariable.Value)); } ((PRoConClient)objSender).Console.Write(String.Format("End of Local Variables List ({0} Variables)", ((PRoConClient)objSender).Variables.Count)); } else if (lstWords.Count >= 1 && String.Compare(lstWords[0], "procon.protected.sv_vars.list", true) == 0 && objSender is PRoConClient) { ((PRoConClient)objSender).Console.Write("Server Variables: [Variable] [Value]"); foreach (Variable kvpVariable in ((PRoConClient)objSender).SV_Variables) { ((PRoConClient)objSender).Console.Write(String.Format("{0} \"{1}\"", kvpVariable.Name, kvpVariable.Value)); } ((PRoConClient)objSender).Console.Write(String.Format("End of Server Variables List ({0} Variables)", ((PRoConClient)objSender).SV_Variables.Count)); } else if (lstWords.Count >= 3 && String.Compare(lstWords[0], "procon.protected.plugins.call", true) == 0 && objSender is PRoConClient) { if (((PRoConClient)objSender).PluginsManager != null) { if (((PRoConClient)objSender).PluginsManager.Plugins.LoadedClassNames.Contains(lstWords[1]) == true) { string[] strParams = null; if (lstWords.Count - 3 > 0) { strParams = new string[lstWords.Count - 3]; lstWords.CopyTo(3, strParams, 0, lstWords.Count - 3); } ((PRoConClient)objSender).PluginsManager.InvokeOnEnabled(lstWords[1], lstWords[2], strParams); } } } else if (lstWords.Count >= 6 && String.Compare(lstWords[0], "procon.private.tcadmin.enableLayer", true) == 0 && objSender == this) { if (this.Connections.Contains(String.Format("{0}:{1}", lstWords[1], lstWords[2])) == true) { UInt16 ui16Port = 0; UInt16.TryParse(lstWords[4], out ui16Port); this.Connections[String.Format("{0}:{1}", lstWords[1], lstWords[2])].ProconProtectedLayerEnable(true, ui16Port, lstWords[3], lstWords[5]); } } else if (lstWords.Count >= 5 && String.Compare(lstWords[0], "procon.private.tcadmin.setPrivileges", true) == 0 && objSender == this) { if (this.Connections.Contains(String.Format("{0}:{1}", lstWords[1], lstWords[2])) == true) { CPrivileges sprPrivs = new CPrivileges(); UInt32 ui32Privileges = 0; if (UInt32.TryParse(lstWords[4], out ui32Privileges) == true && this.AccountsList.Contains(lstWords[3]) == true) { sprPrivs.PrivilegesFlags = ui32Privileges; this.Connections[String.Format("{0}:{1}", lstWords[1], lstWords[2])].ProconProtectedLayerSetPrivileges(this.AccountsList[lstWords[3]], sprPrivs); } } } }
public void sender_ProconPrivileges(PRoConClient sender, CPrivileges spPrivs) { this.InvokeIfRequired(() => { this.pnlSettingsPanels.Enabled = spPrivs.CanAlterServerSettings; }); }
public bool Has(Privileges flags) { bool hasPrivileges = false; CPrivileges cpriv = new CPrivileges((UInt32)flags); cpriv.SetLowestPrivileges(this); if ((cpriv.PrivilegesFlags & (UInt32)flags) == (UInt32)flags) { hasPrivileges = true; } return hasPrivileges; }
public void SetLowestPrivileges(CPrivileges spCompare) { Privileges newPrivilegesFlags = 0; newPrivilegesFlags |= (this.CanLogin && spCompare.CanLogin) ? Privileges.CanLogin : 0; newPrivilegesFlags |= (this.CanAlterServerSettings && spCompare.CanAlterServerSettings) ? Privileges.CanAlterServerSettings : 0; newPrivilegesFlags |= (this.CanUseMapFunctions && spCompare.CanUseMapFunctions) ? Privileges.CanUseMapFunctions : 0; newPrivilegesFlags |= (this.CannotPunishPlayers || spCompare.CannotPunishPlayers) ? Privileges.CannotPunishPlayers : 0; newPrivilegesFlags |= (this.CanKillPlayers && spCompare.CanKillPlayers) ? Privileges.CanKillPlayers : 0; newPrivilegesFlags |= (this.CanKickPlayers && spCompare.CanKickPlayers) ? Privileges.CanKickPlayers : 0; newPrivilegesFlags |= (this.CanTemporaryBanPlayers && spCompare.CanTemporaryBanPlayers) ? Privileges.CanTemporaryBanPlayers : 0; newPrivilegesFlags |= (this.CanPermanentlyBanPlayers && spCompare.CanPermanentlyBanPlayers) ? Privileges.CanPermanentlyBanPlayers : 0; newPrivilegesFlags |= (this.CanMovePlayers && spCompare.CanMovePlayers) ? Privileges.CanMovePlayers : 0; newPrivilegesFlags |= (this.CannotIssuePunkbusterCommands || spCompare.CannotIssuePunkbusterCommands) ? Privileges.CannotIssuePunkbusterCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedPunkbusterCommands && spCompare.CanIssueLimitedPunkbusterCommands) ? Privileges.CanIssueLimitedPunkbusterCommands : 0; newPrivilegesFlags |= (this.CanIssueAllPunkbusterCommands && spCompare.CanIssueAllPunkbusterCommands) ? Privileges.CanIssueAllPunkbusterCommands : 0; newPrivilegesFlags |= (this.CanEditBanList && spCompare.CanEditBanList) ? Privileges.CanEditBanList : 0; newPrivilegesFlags |= (this.CanEditMapList && spCompare.CanEditMapList) ? Privileges.CanEditMapList : 0; newPrivilegesFlags |= (this.CanEditReservedSlotsList && spCompare.CanEditReservedSlotsList) ? Privileges.CanEditReservedSlotsList : 0; newPrivilegesFlags |= (this.CannotIssueProconCommands || spCompare.CannotIssueProconCommands) ? Privileges.CannotIssueProconCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedProconPluginCommands && spCompare.CanIssueLimitedProconPluginCommands) ? Privileges.CanIssueLimitedProconPluginCommands : 0; newPrivilegesFlags |= (this.CanIssueLimitedProconCommands && spCompare.CanIssueLimitedProconCommands) ? Privileges.CanIssueLimitedProconCommands : 0; newPrivilegesFlags |= (this.CanIssueAllProconCommands && spCompare.CanIssueAllProconCommands) ? Privileges.CanIssueAllProconCommands : 0; newPrivilegesFlags |= (this.CanEditMapZones && spCompare.CanEditMapZones) ? Privileges.CanEditMapZones : 0; newPrivilegesFlags |= (this.CanEditTextChatModerationList && spCompare.CanEditTextChatModerationList) ? Privileges.CanEditTextChatModerationList : 0; newPrivilegesFlags |= (this.CanShutdownServer && spCompare.CanShutdownServer) ? Privileges.CanShutdownServer : 0; this.PrivilegesFlags = (UInt32)newPrivilegesFlags; }
public uscPlayerPunishPanel() { InitializeComponent(); this.cboTimeMultiplier.SelectedIndex = 0; this.m_spPrivileges = new CPrivileges(); this.m_spPrivileges.PrivilegesFlags = CPrivileges.FullPrivilegesFlags; }