public void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags)
        {
            List <DirPopularReplyData> ReturnValues =
                directoryService.FindPopularPlaces(queryFlags, remoteClient.ScopeID);

            remoteClient.SendDirPopularReply(queryID, ReturnValues.ToArray());
        }
Example #2
0
        // not used ?
        public void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags)
        {
            Hashtable ReqHash = new Hashtable();

            ReqHash["flags"] = queryFlags.ToString();

            Hashtable result = GenericXMLRPCRequest(ReqHash, "dir_popular_query");

            if (!Convert.ToBoolean(result["success"]))
            {
                remoteClient.SendAgentAlertMessage(result["errorMessage"].ToString(), false);
                return;
            }

            ArrayList dataArray = (ArrayList)result["data"];

            int count = dataArray.Count;

            if (count > 100)
            {
                count = 101;
            }

            DirPopularReplyData[] data = new DirPopularReplyData[count];

            int i = 0;

            foreach (Object o in dataArray)
            {
                Hashtable d = (Hashtable)o;

                string name = d["name"].ToString();
                if (Enc != null)
                {
                    name = Enc.GetString(Convert.FromBase64String(name));
                }

                data[i]          = new DirPopularReplyData();
                data[i].parcelID = new UUID(d["parcel_id"].ToString());
                data[i].name     = name;
                data[i].dwell    = Convert.ToSingle(d["dwell"]);
                i++;
                if (i >= count)
                {
                    break;
                }
            }

            remoteClient.SendDirPopularReply(queryID, data);
        }
        public void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags)
        {
            Hashtable ReqHash = new Hashtable();
            ReqHash["flags"] = queryFlags.ToString();

            Hashtable result = GenericXMLRPCRequest(ReqHash,
                    "dir_popular_query");

            if (!Convert.ToBoolean(result["success"]))
            {
                remoteClient.SendAgentAlertMessage(
                        result["errorMessage"].ToString(), false);
                return;
            }

            ArrayList dataArray = (ArrayList)result["data"];

            int count = dataArray.Count;
            if (count > 100)
                count = 101;

            DirPopularReplyData[] data = new DirPopularReplyData[count];

            int i = 0;

            foreach (Object o in dataArray)
            {
                Hashtable d = (Hashtable)o;

                data[i] = new DirPopularReplyData();
                data[i].parcelID = new UUID(d["parcel_id"].ToString());
                data[i].name = d["name"].ToString();
                data[i].dwell = Convert.ToSingle(d["dwell"]);

                if (++i >= count)
                    break;
            }

            remoteClient.SendDirPopularReply(queryID, data);
        }