Beispiel #1
0
 public bool IsAddLimited(OnlineGuildMember member, string itemclass, int slotNo, int amount, int targetTab)
 {
     if (member.GuildMember.Rank > GuildMemberRank.Member)
     {
         member.SendOperationFailedDialog("GuildStorageFail_RankLimited");
         return(true);
     }
     if (itemclass == "gold")
     {
         int num = FeatureMatrix.GetInteger("GuildStorageGoldHoldingLimit");
         if (num == 0)
         {
             num = int.MaxValue;
         }
         if (this.GoldHolding > num - amount)
         {
             member.SendOperationFailedDialog("GuildStorageFail_GoldAddLimit");
             return(true);
         }
         return(false);
     }
     else
     {
         int num2 = (int)(this.AccessLimitTag >> targetTab * this.GuildStorageSettingFlagBitsPerTab & (long)this.GuildStorageSettingMask);
         if (num2 != 0 && member.GuildMember.Rank > (GuildMemberRank)num2)
         {
             member.SendOperationFailedDialog("GuildStorageFail_RankLimited");
             return(true);
         }
         return(false);
     }
 }
Beispiel #2
0
 public bool IsPickLimited(OnlineGuildMember member, string itemclass, int slotNo, int amount)
 {
     if (member.GuildMember.Rank > GuildMemberRank.Member)
     {
         member.SendOperationFailedDialog("GuildStorageFail_RankLimited");
         return(true);
     }
     if (itemclass == "gold")
     {
         if (this.GoldHolding - amount < this.GoldPickLimit)
         {
             member.SendOperationFailedDialog("GuildStorageFail_GoldPickLimitBySetting");
             return(true);
         }
         int integer = FeatureMatrix.GetInteger("GuildStorageGoldDailyLimit");
         if (integer == 0)
         {
             return(false);
         }
         int num = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
         foreach (GuildStorageBriefLogElement guildStorageBriefLogElement in this.BriefTodayLogs)
         {
             if (guildStorageBriefLogElement.Datestamp == num && guildStorageBriefLogElement.CharacterName == member.CharacterName && guildStorageBriefLogElement.OperationType == GuildStorageOperationType.Gold)
             {
                 if (guildStorageBriefLogElement.PickCount + amount - guildStorageBriefLogElement.AddCount > integer)
                 {
                     member.SendOperationFailedDialog("GuildStorageFail_GoldPickDailyLimit");
                     return(true);
                 }
                 return(false);
             }
         }
         if (amount > integer)
         {
             member.SendOperationFailedDialog("GuildStorageFail_GoldPickDailyLimit");
             return(true);
         }
         return(false);
     }
     else
     {
         int num2 = slotNo / this.GuildStorageSlotsPerTab;
         int num3 = (int)(this.AccessLimitTag >> num2 * this.GuildStorageSettingFlagBitsPerTab & (long)this.GuildStorageSettingMask);
         if (num3 != 0 && member.GuildMember.Rank > (GuildMemberRank)num3)
         {
             member.SendOperationFailedDialog("GuildStorageFail_RankLimited");
             return(true);
         }
         return(false);
     }
 }