void LLAvatarPropertiesProcessor::processPickInfoReply(LLMessageSystem* msg, void**)
{
	LLPickData pick_data;

	// Extract the agent id and verify the message is for this
	// client.
	msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, pick_data.agent_id );
	msg->getUUID(_PREHASH_Data, _PREHASH_PickID, pick_data.pick_id);
	msg->getUUID(_PREHASH_Data, _PREHASH_CreatorID, pick_data.creator_id);

	// ** top_pick should be deleted, not being used anymore - angela
	msg->getBOOL(_PREHASH_Data, _PREHASH_TopPick, pick_data.top_pick);
	msg->getUUID(_PREHASH_Data, _PREHASH_ParcelID, pick_data.parcel_id);
	msg->getString(_PREHASH_Data, _PREHASH_Name, pick_data.name);
	msg->getString(_PREHASH_Data, _PREHASH_Desc, pick_data.desc);
	msg->getUUID(_PREHASH_Data, _PREHASH_SnapshotID, pick_data.snapshot_id);

	msg->getString(_PREHASH_Data, _PREHASH_User, pick_data.user_name);
	msg->getString(_PREHASH_Data, _PREHASH_OriginalName, pick_data.original_name);
	msg->getString(_PREHASH_Data, _PREHASH_SimName, pick_data.sim_name);
	msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, pick_data.pos_global);

	msg->getS32(_PREHASH_Data, _PREHASH_SortOrder, pick_data.sort_order);
	msg->getBOOL(_PREHASH_Data, _PREHASH_Enabled, pick_data.enabled);

	LLAvatarPropertiesProcessor* self = getInstance();
	// don't need to remove pending request as we don't track pick info
	self->notifyObservers(pick_data.creator_id, &pick_data, APT_PICK_INFO);
}
void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**)
{
	LLAvatarData avatar_data;

	msg->getUUIDFast(	_PREHASH_AgentData,			_PREHASH_AgentID, 		avatar_data.agent_id);
	msg->getUUIDFast(	_PREHASH_AgentData,			_PREHASH_AvatarID, 		avatar_data.avatar_id);
	msg->getUUIDFast(  	_PREHASH_PropertiesData,	_PREHASH_ImageID,		avatar_data.image_id);
	msg->getUUIDFast(  	_PREHASH_PropertiesData,	_PREHASH_FLImageID,		avatar_data.fl_image_id);
	msg->getUUIDFast(	_PREHASH_PropertiesData,	_PREHASH_PartnerID,		avatar_data.partner_id);
	msg->getStringFast(	_PREHASH_PropertiesData,	_PREHASH_AboutText,		avatar_data.about_text);
	msg->getStringFast(	_PREHASH_PropertiesData,	_PREHASH_FLAboutText,	avatar_data.fl_about_text);
	msg->getStringFast(	_PREHASH_PropertiesData,	_PREHASH_BornOn,		avatar_data.born_on);
	msg->getString(		_PREHASH_PropertiesData,	_PREHASH_ProfileURL,	avatar_data.profile_url);
	msg->getU32Fast(	_PREHASH_PropertiesData,	_PREHASH_Flags,			avatar_data.flags);


	avatar_data.caption_index = 0;

	S32 charter_member_size = 0;
	charter_member_size = msg->getSize(_PREHASH_PropertiesData, _PREHASH_CharterMember);
	if(1 == charter_member_size)
	{
		msg->getBinaryData(_PREHASH_PropertiesData, _PREHASH_CharterMember, &avatar_data.caption_index, 1);
	}
	else if(1 < charter_member_size)
	{
		msg->getString(_PREHASH_PropertiesData, _PREHASH_CharterMember, avatar_data.caption_text);
	}
	LLAvatarPropertiesProcessor* self = getInstance();
	// Request processed, no longer pending
	self->removePendingRequest(avatar_data.avatar_id, APT_PROPERTIES);
	self->notifyObservers(avatar_data.avatar_id,&avatar_data,APT_PROPERTIES);
}
void LLAvatarPropertiesProcessor::processClassifiedInfoReply(LLMessageSystem* msg, void**)
{
	LLAvatarClassifiedInfo c_info;

	msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, c_info.agent_id);

	msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, c_info.classified_id);
	msg->getUUID(_PREHASH_Data, _PREHASH_CreatorID, c_info.creator_id);
	msg->getU32(_PREHASH_Data, _PREHASH_CreationDate, c_info.creation_date);
	msg->getU32(_PREHASH_Data, _PREHASH_ExpirationDate, c_info.expiration_date);
	msg->getU32(_PREHASH_Data, _PREHASH_Category, c_info.category);
	msg->getString(_PREHASH_Data, _PREHASH_Name, c_info.name);
	msg->getString(_PREHASH_Data, _PREHASH_Desc, c_info.description);
	msg->getUUID(_PREHASH_Data, _PREHASH_ParcelID, c_info.parcel_id);
	msg->getU32(_PREHASH_Data, _PREHASH_ParentEstate, c_info.parent_estate);
	msg->getUUID(_PREHASH_Data, _PREHASH_SnapshotID, c_info.snapshot_id);
	msg->getString(_PREHASH_Data, _PREHASH_SimName, c_info.sim_name);
	msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, c_info.pos_global);
	msg->getString(_PREHASH_Data, _PREHASH_ParcelName, c_info.parcel_name);
	msg->getU8(_PREHASH_Data, _PREHASH_ClassifiedFlags, c_info.flags);
	msg->getS32(_PREHASH_Data, _PREHASH_PriceForListing, c_info.price_for_listing);

	LLAvatarPropertiesProcessor* self = getInstance();
	// Request processed, no longer pending
	self->removePendingRequest(c_info.creator_id, APT_CLASSIFIED_INFO);
	self->notifyObservers(c_info.creator_id, &c_info, APT_CLASSIFIED_INFO);
}
void LLAvatarPropertiesProcessor::processAvatarClassifiedsReply(LLMessageSystem* msg, void**)
{
	LLAvatarClassifieds classifieds;

	msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, classifieds.agent_id);
	msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, classifieds.target_id);

	S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data);

	for(int n = 0; n < block_count; ++n)
	{
		LLAvatarClassifieds::classified_data data;

		msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, data.classified_id, n);
		msg->getString(_PREHASH_Data, _PREHASH_Name, data.name, n);

		classifieds.classifieds_list.push_back(data);
	}

	LLAvatarPropertiesProcessor* self = getInstance();
	// Request processed, no longer pending
	self->removePendingRequest(classifieds.target_id, APT_CLASSIFIEDS);
	self->notifyObservers(classifieds.target_id,&classifieds,APT_CLASSIFIEDS);
	//LLPanelAvatarClassified => LLPanelAvatar
}
Esempio n. 5
0
void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* msg, void**)
{
/*
	AvatarInterestsReply is automatically sent by the server in response to the 
	AvatarPropertiesRequest sent when the panel is opened (in addition to the AvatarPropertiesReply message). 
	If the interests panel is no longer part of the design (?) we should just register the message 
	to a handler function that does nothing. 
	That will suppress the warnings and be compatible with old server versions.
	WARNING: LLTemplateMessageReader::decodeData: Message from 216.82.37.237:13000 with no handler function received: AvatarInterestsReply
*/
//<FS:KC legacy profiles>
    FSInterestsData interests_data;
    
    msg->getUUIDFast(   _PREHASH_AgentData,         _PREHASH_AgentID,       interests_data.agent_id );
    msg->getUUIDFast(   _PREHASH_AgentData,         _PREHASH_AvatarID,      interests_data.avatar_id );
    msg->getU32Fast(    _PREHASH_PropertiesData,	_PREHASH_WantToMask,    interests_data.want_to_mask );
    msg->getStringFast( _PREHASH_PropertiesData,    _PREHASH_WantToText,    interests_data.want_to_text );
    msg->getU32Fast(    _PREHASH_PropertiesData,	_PREHASH_SkillsMask,    interests_data.skills_mask );
    msg->getStringFast( _PREHASH_PropertiesData,    _PREHASH_SkillsText,    interests_data.skills_text );
    msg->getString(     _PREHASH_PropertiesData,    _PREHASH_LanguagesText, interests_data.languages_text );
    
    LLAvatarPropertiesProcessor* self = getInstance();
    // Request processed, no longer pending
    self->removePendingRequest(interests_data.avatar_id, APT_INTERESTS_INFO);
    self->notifyObservers(interests_data.avatar_id, &interests_data, APT_INTERESTS_INFO);  
//</FS:KC legacy profiles>
}
void LLAvatarListItem::updateAvatarProperties()
{
    // NOTE: typically we request these once on creation to avoid excess traffic/processing.
    //This means updates to these properties won't typically be seen while target is in nearby range.
    LLAvatarPropertiesProcessor* processor = LLAvatarPropertiesProcessor::getInstance();
    processor->addObserver(mAvatarId, this);
    processor->sendAvatarPropertiesRequest(mAvatarId);
}
	// If the inspector closes it will delete the pending request object, so the
	// inspector pointer will be valid for the lifetime of this object
	LLFetchAvatarData(const LLUUID& avatar_id, LLInspectAvatar* inspector)
	:	mAvatarID(avatar_id),
		mInspector(inspector)
	{
		LLAvatarPropertiesProcessor* processor = 
			LLAvatarPropertiesProcessor::getInstance();
		// register ourselves as an observer
		processor->addObserver(mAvatarID, this);
		// send a request (duplicates will be suppressed inside the avatar
		// properties processor)
		processor->sendAvatarPropertiesRequest(mAvatarID);
	}
void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, void**)
{
	LLAvatarNotes avatar_notes;

	msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_notes.agent_id);
	msg->getUUID(_PREHASH_Data, _PREHASH_TargetID, avatar_notes.target_id);
	msg->getString(_PREHASH_Data, _PREHASH_Notes, avatar_notes.notes);

	LLAvatarPropertiesProcessor* self = getInstance();
	// Request processed, no longer pending
	self->removePendingRequest(avatar_notes.target_id, APT_NOTES);
	self->notifyObservers(avatar_notes.target_id,&avatar_notes,APT_NOTES);
}
void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* msg, void**)
{
	LLAvatarInterestsInfo avatar_interests;
	
	msg->getUUIDFast(	_PREHASH_AgentData, 		_PREHASH_AgentID,		avatar_interests.agent_id);
	msg->getUUIDFast(	_PREHASH_AgentData, 		_PREHASH_AvatarID,		avatar_interests.avatar_id );
	
	msg->getU32Fast(	_PREHASH_PropertiesData,	_PREHASH_WantToMask,	avatar_interests.want_to_mask );
	msg->getStringFast(	_PREHASH_PropertiesData,	_PREHASH_WantToText,	avatar_interests.want_to_text );
	msg->getU32Fast(	_PREHASH_PropertiesData,	_PREHASH_SkillsMask,	avatar_interests.skills_mask );
	msg->getStringFast(	_PREHASH_PropertiesData, 	_PREHASH_SkillsText,	avatar_interests.skills_text );
	msg->getString(		_PREHASH_PropertiesData, 	_PREHASH_LanguagesText,	avatar_interests.languages_text );

	LLAvatarPropertiesProcessor* self = getInstance();
	//This message isn't requested.. it just comes as a consequence of AvatarPropertiesRequest.
	//self->removePendingRequest(avatar_interests.avatar_id, APT_INTERESTS);
	self->notifyObservers(avatar_interests.avatar_id,&avatar_interests,APT_INTERESTS);
}
//virtual
void LLAvatarIconCtrl::setValue(const LLSD& value)
{
	if (value.isUUID())
	{
		LLAvatarPropertiesProcessor* app =
			LLAvatarPropertiesProcessor::getInstance();
		if (mAvatarId.notNull())
		{
			app->removeObserver(mAvatarId, this);
		}

		if (mAvatarId != value.asUUID())
		{
			mAvatarId = value.asUUID();

			// *BUG: This will return stale icons if a user changes their
			// profile picture. However, otherwise we send too many upstream
			// AvatarPropertiesRequest messages.

			// to get fresh avatar icon use
			// LLAvatarIconIDCache::getInstance()->remove(avatar_id);

			// Check if cache already contains image_id for that avatar
			if (!updateFromCache())
			{
				// *TODO: Consider getting avatar icon/badge directly from 
				// People API, rather than sending AvatarPropertyRequest
				// messages.  People API already hits the user table.
				LLIconCtrl::setValue(mDefaultIconName);
				app->addObserver(mAvatarId, this);
				app->sendAvatarPropertiesRequest(mAvatarId);
			}
		}
	}
	else
	{
		LLIconCtrl::setValue(value);
	}

	LLAvatarNameCache::get(mAvatarId,
		boost::bind(&LLAvatarIconCtrl::onAvatarNameCache, 
			this, _1, _2));
}
Esempio n. 11
0
//virtual
void LLAvatarIconCtrl::setValue(const LLSD& value)
{
	if (value.isUUID())
	{
		LLAvatarPropertiesProcessor* app =
			LLAvatarPropertiesProcessor::getInstance();
		if (mAvatarId.notNull())
		{
			app->removeObserver(mAvatarId, this);
		}

		if (mAvatarId != value.asUUID())
		{
			mAvatarId = value.asUUID();

			// *BUG: This will return stale icons if a user changes their
			// profile picture. However, otherwise we send too many upstream
			// AvatarPropertiesRequest messages.

			// to get fresh avatar icon use
			// LLAvatarIconIDCache::getInstance()->remove(avatar_id);

			// Check if cache already contains image_id for that avatar
			if (!updateFromCache())
			{
				LLIconCtrl::setValue(mDefaultIconName);
				app->addObserver(mAvatarId, this);
				app->sendAvatarPropertiesRequest(mAvatarId);
			}
		}
	}
	else
	{
		LLIconCtrl::setValue(value);
	}

	if  (gCacheName)
	{
		gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4));
	}
}
void LLAvatarPropertiesProcessor::processAvatarPicksReply(LLMessageSystem* msg, void**)
{
	LLAvatarPicks avatar_picks;
	msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_picks.target_id);
	msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, avatar_picks.target_id);

	S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data);
	for (int block = 0; block < block_count; ++block)
	{
		LLUUID pick_id;
		std::string pick_name;

		msg->getUUID(_PREHASH_Data, _PREHASH_PickID, pick_id, block);
		msg->getString(_PREHASH_Data, _PREHASH_PickName, pick_name, block);

		avatar_picks.picks_list.push_back(std::make_pair(pick_id,pick_name));
	}
	LLAvatarPropertiesProcessor* self = getInstance();
	// Request processed, no longer pending
	self->removePendingRequest(avatar_picks.target_id, APT_PICKS);
	self->notifyObservers(avatar_picks.target_id,&avatar_picks,APT_PICKS);
}
void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg, void**)
{
	LLAvatarGroups avatar_groups;
	msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, avatar_groups.agent_id );
	msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_groups.avatar_id );

	S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData);
	for(S32 i = 0; i < group_count; ++i)
	{
		LLAvatarGroups::LLGroupData group_data;

		msg->getU64(    _PREHASH_GroupData, _PREHASH_GroupPowers,	group_data.group_powers, i );
		msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupTitle,	group_data.group_title, i );
		msg->getUUIDFast(  _PREHASH_GroupData, _PREHASH_GroupID,	group_data.group_id, i);
		msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupName,	group_data.group_name, i );
		msg->getUUIDFast(  _PREHASH_GroupData, _PREHASH_GroupInsigniaID, group_data.group_insignia_id, i );

		avatar_groups.group_list.push_back(group_data);
	}

	LLAvatarPropertiesProcessor* self = getInstance();
	self->removePendingRequest(avatar_groups.avatar_id, APT_GROUPS);
	self->notifyObservers(avatar_groups.avatar_id,&avatar_groups,APT_GROUPS);
}