public List<ProfilePickInfo> GetPicks(UUID ownerID)
        {
            object remoteValue = DoRemote(ownerID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<ProfilePickInfo>) remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["OwnerUUID"] = ownerID;

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

            List<ProfilePickInfo> picks = new List<ProfilePickInfo>();
            for (int i = 0; i < query.Count; i += 5)
            {
                ProfilePickInfo pick = new ProfilePickInfo();
                pick.FromOSD((OSDMap) OSDParser.DeserializeJson(query[i + 4]));
                picks.Add(pick);
            }
            return picks;
        }
        public bool AddPick(ProfilePickInfo pick)
        {
            object remoteValue = DoRemote(pick);
            if (remoteValue != null || m_doRemoteOnly)
                return remoteValue != null && (bool) remoteValue;

            if (GetUserProfile(pick.CreatorUUID) == null)
                return false;

            //It might be updating, delete the old
            QueryFilter filter = new QueryFilter();
            filter.andFilters["PickUUID"] = pick.PickUUID;
            GD.Delete("userpicks", filter);
            List<object> values = new List<object>
                                      {
                                          pick.Name,
                                          pick.SimName,
                                          pick.CreatorUUID,
                                          pick.PickUUID,
                                          OSDParser.SerializeJsonString(pick.ToOSD())
                                      };
            return GD.Insert("userpicks", values.ToArray());
        }
        public ProfilePickInfo GetPick(UUID queryPickID)
        {
            object remoteValue = DoRemote(queryPickID);
            if (remoteValue != null || m_doRemoteOnly)
                return (ProfilePickInfo) remoteValue;

            QueryFilter filter = new QueryFilter();
            filter.andFilters["PickUUID"] = queryPickID;

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

            if (query.Count < 5)
                return null;
            ProfilePickInfo pick = new ProfilePickInfo();
            pick.FromOSD((OSDMap) OSDParser.DeserializeJson(query[4]));
            return pick;
        }
        public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name,
                                   string desc, UUID snapshotID, int sortOrder, bool enabled, Vector3d globalPos)
        {
            IScenePresence p = remoteClient.Scene.GetScenePresence(remoteClient.AgentId);

            UUID parceluuid = p.CurrentParcelUUID;
            string user = "******";
            string OrigionalName = "(unknown)";

            Vector3 pos_global = new Vector3(globalPos);

            IParcelManagementModule parcelManagement =
                remoteClient.Scene.RequestModuleInterface<IParcelManagementModule>();
            if (parcelManagement != null)
            {
                ILandObject targetlandObj = parcelManagement.GetLandObject(pos_global.X/Constants.RegionSize,
                                                                           pos_global.Y/Constants.RegionSize);

                if (targetlandObj != null)
                {
                    UserAccount parcelOwner =
                        remoteClient.Scene.UserAccountService.GetUserAccount(remoteClient.AllScopeIDs,
                                                                             targetlandObj.LandData
                                                                                          .OwnerID);
                    if (parcelOwner != null)
                        user = parcelOwner.Name;

                    parceluuid = targetlandObj.LandData.GlobalID;

                    OrigionalName = targetlandObj.LandData.Name;
                }
            }

            ProfilePickInfo pick = new ProfilePickInfo
                                       {
                                           PickUUID = pickID,
                                           CreatorUUID = creatorID,
                                           TopPick = topPick ? 1 : 0,
                                           ParcelUUID = parceluuid,
                                           Name = name,
                                           Description = desc,
                                           SnapshotUUID = snapshotID,
                                           User = user,
                                           OriginalName = OrigionalName,
                                           SimName = remoteClient.Scene.RegionInfo.RegionName,
                                           GlobalPos = pos_global,
                                           SortOrder = sortOrder,
                                           Enabled = enabled ? 1 : 0
                                       };

            ProfileFrontend.AddPick(pick);
        }