/// <summary>
        /// Handles the avatar notes request.
        /// </summary>
        /// <param name='sender'>
        /// Sender.
        /// </param>
        /// <param name='method'>
        /// Method.
        /// </param>
        /// <param name='args'>
        /// Arguments.
        /// </param>
        public void NotesRequest(Object sender, string method, List <String> args)
        {
            UserProfileNotes note = new UserProfileNotes();

            if (!(sender is IClientAPI))
            {
                return;
            }

            IClientAPI remoteClient = (IClientAPI)sender;
            string     serverURI    = string.Empty;

            GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
            note.UserId = remoteClient.AgentId;
            UUID.TryParse(args[0], out note.TargetId);

            object Note = (object)note;

            if (!rpc.JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString()))
            {
                remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes);
                return;
            }
            note = (UserProfileNotes)Note;

            remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes);
        }
Пример #2
0
		///////////////////////////////////////////////////////////////////////////////////////////////
		//
		// Notes
		//

		// Request Note (method: avatarnotesrequest)
		public void HandleAvatarNotesRequest(Object sender, string method, List<String> args) 
		{
			if (!(sender is IClientAPI)) return;

			IClientAPI remoteClient = (IClientAPI)sender;

			Hashtable ReqHash = new Hashtable();

			ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
			ReqHash["target_id"] = args[0];
			
			// XMLRPC to profile.php
			Hashtable result = GenericXMLRPCRequest(ReqHash, method);

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

			// Anser from profile.php
			ArrayList dataArray = (ArrayList)result["data"];
			if (dataArray.Count==0)
			{
				remoteClient.SendAvatarNotesReply(new UUID(ReqHash["target_id"].ToString()), "");
				return;
			}

	   		Hashtable d = (Hashtable)dataArray[0];

			string notes = d["notes"].ToString();
			if (Enc!=null) notes = Enc.GetString(Convert.FromBase64String(notes));
			remoteClient.SendAvatarNotesReply(new UUID(d["target_id"].ToString()), notes);
		}
Пример #3
0
        public void HandleAvatarNotesRequest(Object sender, string method, List <String> args)
        {
            if (!(sender is IClientAPI))
            {
                return;
            }

            IClientAPI remoteClient   = (IClientAPI)sender;
            UUID       avatarID       = remoteClient.AgentId;
            UUID       targetAvatarID = new UUID(args[0]);

            using (ISimpleDB db = _connFactory.GetConnection())
            {
                Dictionary <string, object> parms = new Dictionary <string, object>();
                parms.Add("?avatarID", avatarID);
                parms.Add("?targetID", targetAvatarID);

                string query = "SELECT notes from usernotes where useruuid=?avatarID AND targetuuid=?targetID";
                List <Dictionary <string, string> > notesResult = db.QueryWithResults(query, parms);

                string notes = String.Empty;
                if (notesResult.Count > 0)
                {
                    notes = notesResult[0]["notes"];
                }
                if (notes == LEGACY_EMPTY)  // filter out the old text that said there was no text. ;)
                {
                    notes = String.Empty;
                }

                remoteClient.SendAvatarNotesReply(targetAvatarID, notes);
            }
        }
Пример #4
0
        public void HandleAvatarNotesRequest(object sender, string method, List <string> args)
        {
            if (!(sender is IClientAPI))
            {
                MainConsole.Instance.Debug("sender isn't IClientAPI");
                return;
            }

            IClientAPI       remoteClient = (IClientAPI)sender;
            IUserProfileInfo UPI          = ProfileFrontend.GetUserProfile(remoteClient.AgentId);

            if (UPI == null)
            {
                return;
            }

            OSD    notes           = "";
            string targetNotesUUID = args [0];

            if (!UPI.Notes.TryGetValue(targetNotesUUID, out notes))
            {
                notes = "";
            }

            remoteClient.SendAvatarNotesReply(new UUID(targetNotesUUID), notes.AsString());
        }
Пример #5
0
        // Notes Handler

        public void HandleAvatarNotesRequest(Object sender, string method, List <String> args)
        {
            if (!(sender is IClientAPI))
            {
                return;
            }

            IClientAPI remoteClient = (IClientAPI)sender;

            Hashtable ReqHash = new Hashtable();

            ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
            ReqHash["uuid"]      = args[0];

            Hashtable result = GenericXMLRPCRequest(ReqHash,
                                                    method);

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

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

            if (dataArray != null && dataArray[0] != null)
            {
                Hashtable d = (Hashtable)dataArray[0];

                remoteClient.SendAvatarNotesReply(
                    new UUID(d["targetid"].ToString()),
                    d["notes"].ToString());
            }
            else
            {
                remoteClient.SendAvatarNotesReply(
                    new UUID(ReqHash["uuid"].ToString()),
                    "");
            }
        }
Пример #6
0
        // Notes Handler

        public void HandleAvatarNotesRequest(Object sender, string method, List <String> args)
        {
            IClientAPI remoteClient = (IClientAPI)sender;

            if (m_Debug)
            {
                m_log.DebugFormat("[{0}] HandleAvatarNotesRequest for {1} with method {2}", m_moduleName, remoteClient.AgentId.ToString(), method);
            }
            string targetid;
            string notes = "";

            if (!(sender is IClientAPI))
            {
                if (m_Debug)
                {
                    m_log.DebugFormat("[{0}] HandleAvatarNotesRequest for (!(sender {1} is IClientAPI {2}))", m_moduleName, sender.ToString(), remoteClient.AgentId.ToString());
                }
                return;
            }


            Hashtable ReqHash = new Hashtable();

            ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
            ReqHash["uuid"]      = args[0];

            Hashtable result = GenericXMLRPCRequest(ReqHash, method);

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

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

            if (dataArray != null && dataArray[0] != null)
            {
                Hashtable d = (Hashtable)dataArray[0];

                targetid = d["targetid"].ToString();
                if (d["notes"] != null)
                {
                    notes = d["notes"].ToString();
                }

                remoteClient.SendAvatarNotesReply(new UUID(targetid), notes);
            }
        }
Пример #7
0
        // Notes Handler
        public void HandleAvatarNotesRequest(Object sender, string method, List <String> args)
        {
            string targetid;
            string notes = "";

            if (!(sender is IClientAPI))
            {
                return;
            }

            IClientAPI remoteClient = (IClientAPI)sender;

            Hashtable ReqHash = new Hashtable();

            ReqHash["avatar_id"] = remoteClient.AgentId.ToString();
            ReqHash["uuid"]      = args[0];

            string serverURI = string.Empty;

            GetUserProfileServerURI(remoteClient.AgentId, out serverURI);

            Hashtable result = GenericXMLRPCRequest(ReqHash,
                                                    method, serverURI);

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

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

            if (dataArray != null && dataArray[0] != null)
            {
                Hashtable d = (Hashtable)dataArray[0];

                targetid = d["targetid"].ToString();
                if (d["notes"] != null)
                {
                    notes = d["notes"].ToString();
                }

                remoteClient.SendAvatarNotesReply(new UUID(targetid), notes);
            }
        }
Пример #8
0
        private void HandleAvatarNotesRequest(Object sender, string method, List <String> args)
        {
            if (!(sender is IClientAPI))
            {
                return;
            }
            IClientAPI client = (IClientAPI)sender;

            UUID targetAvatarID;

            if (args.Count < 1 || !UUID.TryParse(args[0], out targetAvatarID))
            {
                m_log.Error("[SIMIAN PROFILES]: Unrecognized arguments for " + method);
                return;
            }

            // FIXME: Fetch this
            client.SendAvatarNotesReply(targetAvatarID, String.Empty);
        }