public void SetBankTabText(Character chr, byte tabId, string newText) { GuildMember guildMember = chr.GuildMember; if (guildMember == null) { return; } GuildRank rank = guildMember.Rank; if (rank == null || tabId < (byte)0 || (tabId >= (byte)6 || (int)tabId > this.Guild.PurchasedBankTabCount)) { return; } GuildBankTab record = this[(int)tabId]; if (record == null || !rank.BankTabRights[(int)tabId].Privileges .HasFlag((Enum)GuildBankTabPrivileges.UpdateText)) { return; } record.Text = newText.Length < 501 ? newText : newText.Substring(0, 500); record.UpdateLater(); this.Guild.Broadcast(GuildHandler.CreateBankTabTextPacket(tabId, newText)); }
public void SetBankTabText(Character chr, byte tabId, string newText) { var member = chr.GuildMember; if (member == null) { return; } var rank = member.Rank; if (rank == null) { return; } if (tabId < 0 || tabId >= GuildMgr.MAX_BANK_TABS) { return; } if (tabId > Guild.PurchasedBankTabCount) { return; } var tab = this[tabId]; if (tab == null) { return; } if (!rank.BankTabRights[tabId].Privileges.HasFlag(GuildBankTabPrivileges.UpdateText)) { return; } tab.Text = newText.Length < 501 ? newText : newText.Substring(0, 500); tab.UpdateLater(); Guild.Broadcast(GuildHandler.CreateBankTabTextPacket(tabId, newText)); }