public List<uint> GetAgentRecentTransactions(UUID agentID)
{
QueryFilter filter = new QueryFilter();
filter.andFilters["PrincipalID"] = agentID;
DateTime now = DateTime.Now;
RepeatType runevertype = (RepeatType)Enum.Parse(typeof(RepeatType), m_config.MaxAmountPurchasableEveryType);
switch (runevertype)
{
case RepeatType.second:
now = now.AddSeconds(-m_config.MaxAmountPurchasableEveryAmount);
break;
case RepeatType.minute:
now = now.AddMinutes(-m_config.MaxAmountPurchasableEveryAmount);
break;
case RepeatType.hours:
now = now.AddHours(-m_config.MaxAmountPurchasableEveryAmount);
break;
case RepeatType.days:
now = now.AddDays(-m_config.MaxAmountPurchasableEveryAmount);
break;
case RepeatType.weeks:
now = now.AddDays(-m_config.MaxAmountPurchasableEveryAmount * 7);
break;
case RepeatType.months:
now = now.AddMonths(-m_config.MaxAmountPurchasableEveryAmount);
break;
case RepeatType.years:
now = now.AddYears(-m_config.MaxAmountPurchasableEveryAmount);
break;
}
filter.andGreaterThanEqFilters["Created"] = Utils.DateTimeToUnixTime(now);//Greater than the time that we are checking against
filter.andLessThanEqFilters["Created"] = Utils.GetUnixTime();//Less than now
List<string> query = GD.Query(new string[] { "Amount" }, _REALMPURCHASE, filter, null, null, null);
if (query == null)
return new List<uint> ();
return query.ConvertAll<uint> (s => uint.Parse (s));
}