Example #1
0
        public uint Count(uint estateID, RegionFlags flags)
        {
            IEstateConnector estates = Framework.Utilities.DataManager.RequestPlugin <IEstateConnector>();

            if (estates == null)
            {
                return(0);
            }

            EstateSettings es = estates.GetEstateSettings((int)estateID);

            QueryFilter filter = new QueryFilter();

            filter.andBitfieldAndFilters["Flags"] = (uint)flags;

            List <GridRegion> query = ParseQuery(null, GD.Query(new string[] { "*" }, m_realm, filter, null, null, null));

            uint count = 0;

            query.ForEach(delegate(GridRegion region)
            {
                if (region.EstateOwner == es.EstateOwner &&
                    estates.GetEstateID(region.RegionID) == es.EstateID)
                {
                    ++count;
                }
            });

            return(count);
        }
Example #2
0
        public List <GridRegion> Get(RegionFlags flags)
        {
            QueryFilter filter = new QueryFilter();

            filter.andBitfieldAndFilters["Flags"] = (uint)flags;
            return(ParseQuery(null, GD.Query(new string[1] {
                "*"
            }, m_realm, filter, null, null, null)));
        }
Example #3
0
        public uint Count(RegionFlags includeFlags, RegionFlags excludeFlags)
        {
            QueryFilter filter = new QueryFilter();

            if (includeFlags > 0)
            {
                filter.andBitfieldAndFilters["Flags"] = (uint)includeFlags;
            }
            if (excludeFlags > 0)
            {
                filter.andBitfieldNandFilters["Flags"] = (uint)excludeFlags;
            }

            return(uint.Parse(GD.Query(new string[1] {
                "COUNT(*)"
            }, m_realm, filter, null, null, null)[0]));
        }
Example #4
0
        public List <GridRegion> Get(RegionFlags includeFlags, RegionFlags excludeFlags, uint?start, uint?count,
                                     Dictionary <string, bool> sort)
        {
            QueryFilter filter = new QueryFilter();

            if (includeFlags > 0)
            {
                filter.andBitfieldAndFilters["Flags"] = (uint)includeFlags;
            }
            if (excludeFlags > 0)
            {
                filter.andBitfieldNandFilters["Flags"] = (uint)excludeFlags;
            }

            return(ParseQuery(null, GD.Query(new string[1] {
                "*"
            }, m_realm, filter, sort, start, count)));
        }
Example #5
0
        public List <GridRegion> Get(uint start, uint count, uint estateID, RegionFlags flags,
                                     Dictionary <string, bool> sort)
        {
            List <GridRegion> resp    = new List <GridRegion>();
            IEstateConnector  estates = Framework.Utilities.DataManager.RequestPlugin <IEstateConnector>();

            if (count == 0 || estates == null)
            {
                return(resp);
            }

            EstateSettings es = estates.GetEstateSettings((int)estateID);

            QueryFilter filter = new QueryFilter();

            filter.andBitfieldAndFilters["Flags"] = (uint)flags;

            while (resp.Count < count)
            {
                uint limit = count - (uint)resp.Count;
                List <GridRegion> query = ParseQuery(null,
                                                     GD.Query(new string[] { "*" }, m_realm, filter, sort, start, count));

                if (query.Count == 0)
                {
                    break;
                }

                query.ForEach(delegate(GridRegion region)
                {
                    if (region.EstateOwner == es.EstateOwner &&
                        estates.GetEstateID(region.RegionID) == es.EstateID)
                    {
                        resp.Add(region);
                    }
                });

                start += limit;
            }

            return(resp);
        }
Example #6
0
 public List <GridRegion> Get(RegionFlags flags, Dictionary <string, bool> sort)
 {
     return(Get(flags, 0, null, null, sort));
 }