#include <llcallingcard.h>
Public Types | |
typedef std::map< LLUUID, LLRelationship * > | buddy_map_t |
Public Member Functions | |
void | track (const LLUUID &avatar_id, const std::string &name) |
void | untrack (const LLUUID &avatar_id) |
bool | isTrackedAgentValid () |
void | setTrackedAgentValid (bool valid) |
void | findAgent () |
void | setTrackedCoarseLocation (const LLVector3d &global_pos) |
bool | haveTrackingInfo () |
void | getDegreesAndDist (F32 &rot, F64 &horiz_dist, F64 &vert_dist) |
LLVector3d | getGlobalPos () |
const LLString & | getName () |
const LLUUID & | getAvatarID () |
S32 | addBuddyList (const buddy_map_t &buddies) |
void | copyBuddyList (buddy_map_t &buddies) const |
void | terminateBuddy (const LLUUID &id) |
const LLRelationship * | getBuddyInfo (const LLUUID &id) const |
void | setBuddyOnline (const LLUUID &id, bool is_online) |
bool | isBuddyOnline (const LLUUID &id) const |
void | setBuddyEmpowered (const LLUUID &id, bool is_empowered) |
bool | isBuddyEmpowered (const LLUUID &id) const |
void | empowerList (const buddy_map_t &list, bool grant) |
void | empower (const LLUUID &id, bool grant) |
void | registerCallbacks (LLMessageSystem *msg) |
void | addObserver (LLFriendObserver *observer) |
void | removeObserver (LLFriendObserver *observer) |
void | notifyObservers () |
void | applyFunctor (LLRelationshipFunctor &f) |
LLAvatarTracker () | |
~LLAvatarTracker () | |
Static Public Member Functions | |
static LLAvatarTracker & | instance () |
static void | formFriendship (const LLUUID &friend_id) |
Protected Types | |
typedef std::vector < LLFriendObserver * > | observer_list_t |
Protected Member Functions | |
void | deleteTrackingData () |
void | agentFound (const LLUUID &prey, const LLVector3d &estimated_global_pos) |
void | processNotify (LLMessageSystem *msg, bool online) |
void | processChange (LLMessageSystem *msg) |
Static Protected Member Functions | |
static void | processAgentFound (LLMessageSystem *msg, void **) |
static void | processOnlineNotification (LLMessageSystem *msg, void **) |
static void | processOfflineNotification (LLMessageSystem *msg, void **) |
static void | processTerminateFriendship (LLMessageSystem *msg, void **) |
static void | processChangeUserRights (LLMessageSystem *msg, void **) |
Protected Attributes | |
LLTrackingData * | mTrackingData |
bool | mTrackedAgentValid |
U32 | mModifyMask |
buddy_map_t | mBuddyInfo |
observer_list_t | mObservers |
Static Protected Attributes | |
static LLAvatarTracker | sInstance |
Private Member Functions | |
LLAvatarTracker (const LLAvatarTracker &) | |
bool | operator== (const LLAvatarTracker &) |
Definition at line 84 of file llcallingcard.h.
typedef std::map<LLUUID, LLRelationship*> LLAvatarTracker::buddy_map_t |
Definition at line 115 of file llcallingcard.h.
typedef std::vector<LLFriendObserver*> LLAvatarTracker::observer_list_t [protected] |
Definition at line 181 of file llcallingcard.h.
LLAvatarTracker::LLAvatarTracker | ( | const LLAvatarTracker & | ) | [private] |
LLAvatarTracker::LLAvatarTracker | ( | ) |
---------------------------------------------------------------------------- Class LLAvatarTracker ----------------------------------------------------------------------------
Definition at line 125 of file llcallingcard.cpp.
LLAvatarTracker::~LLAvatarTracker | ( | ) |
Definition at line 134 of file llcallingcard.cpp.
References deleteTrackingData(), mBuddyInfo, and mObservers.
static LLAvatarTracker& LLAvatarTracker::instance | ( | ) | [inline, static] |
Definition at line 87 of file llcallingcard.h.
References sInstance.
Referenced by LLPanelFriends::addFriend(), agentFound(), LLPanelFriends::applyRightsToFriends(), LLFloaterWorldMap::buildAvatarIDList(), LLCallingCardBridge::buildContextMenu(), LLIMMgr::defaultIMTypeForAgent(), deliver_message(), LLWorldMapView::draw(), LLNetMap::draw(), LLTracker::drawHUDArrow(), LLFloaterWorldMap::flyToAvatar(), formFriendship(), LLFloaterWorldMap::friendsChanged(), LLAgent::friendsChanged(), LLCallingCardBridge::getIcon(), LLCallingCardBridge::getLabelSuffix(), LLTracker::getTrackedPositionGlobal(), handle_track_avatar(), LLBeginIMSession::handleEvent(), LLPanelFriends::handleRemove(), LLTrackingData::haveTrackingInfo(), idle_startup(), LLIMMgr::inviteToSession(), is_agent_friend(), is_agent_mappable(), LLCallingCardBridge::LLCallingCardBridge(), LLIMMgr::LLIMMgr(), LLPanelFriends::LLPanelFriends(), LLPanelFriends::modifyRightsConfirmation(), LLIMMgr::noteMutedUsers(), LLIMMgr::noteOfflineUsers(), LLFloaterWorldMap::observeFriends(), LLAgent::observeFriends(), LLFloaterWorldMap::onAvatarComboPrearrange(), LLPanelFriends::onClickIM(), LLPanelFriends::onClickProfile(), LLCallingCardBridge::openItem(), CoarseLocationUpdate::post(), processAgentFound(), processChangeUserRights(), processNotify(), processOfflineNotification(), processOnlineNotification(), processTerminateFriendship(), LLPanelFriends::refreshNames(), LLPanelFriends::refreshRightsChangeList(), LLTracker::render3D(), LLPanelAvatar::setAvatarID(), LLPanelAvatar::setOnlineStatus(), LLTracker::stopTrackingAvatar(), LLFloaterWorldMap::teleport(), LLFloaterWorldMap::teleportToAvatar(), LLTracker::trackAvatar(), LLViewerRegion::updateCoarseLocations(), LLCallingCardBridge::~LLCallingCardBridge(), LLIMMgr::~LLIMMgr(), and LLPanelFriends::~LLPanelFriends().
void LLAvatarTracker::track | ( | const LLUUID & | avatar_id, | |
const std::string & | name | |||
) |
Definition at line 141 of file llcallingcard.cpp.
References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_PreyID, _PREHASH_SessionID, _PREHASH_TargetData, _PREHASH_TrackAgent, LLMessageSystem::addUUIDFast(), deleteTrackingData(), findAgent(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, mTrackedAgentValid, mTrackingData, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLUUID::notNull(), and LLAgent::sendReliableMessage().
Referenced by handle_track_avatar(), and LLTracker::trackAvatar().
void LLAvatarTracker::untrack | ( | const LLUUID & | avatar_id | ) |
Definition at line 162 of file llcallingcard.cpp.
References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_PreyID, _PREHASH_SessionID, _PREHASH_TargetData, _PREHASH_TrackAgent, LLMessageSystem::addUUIDFast(), deleteTrackingData(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, LLTrackingData::mAvatarID, mTrackedAgentValid, mTrackingData, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLUUID::null, and LLAgent::sendReliableMessage().
Referenced by LLTracker::stopTrackingAvatar().
bool LLAvatarTracker::isTrackedAgentValid | ( | ) | [inline] |
void LLAvatarTracker::setTrackedAgentValid | ( | bool | valid | ) | [inline] |
Definition at line 92 of file llcallingcard.h.
References mTrackedAgentValid.
Referenced by agentFound().
void LLAvatarTracker::findAgent | ( | ) |
Definition at line 463 of file llcallingcard.cpp.
References _PREHASH_AgentBlock, _PREHASH_FindAgent, _PREHASH_GlobalX, _PREHASH_GlobalY, _PREHASH_Hunter, _PREHASH_LocationBlock, _PREHASH_Prey, _PREHASH_SpaceIP, LLMessageSystem::addF64Fast(), LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), gAgent, gAgentID, gMessageSystem, LLUUID::isNull(), LLTrackingData::mAvatarID, mTrackingData, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLAgent::sendReliableMessage().
Referenced by LLTrackingData::haveTrackingInfo(), and track().
void LLAvatarTracker::setTrackedCoarseLocation | ( | const LLVector3d & | global_pos | ) |
Definition at line 179 of file llcallingcard.cpp.
References mTrackingData, and LLTrackingData::setTrackedCoarseLocation().
Referenced by CoarseLocationUpdate::post(), and LLViewerRegion::updateCoarseLocations().
bool LLAvatarTracker::haveTrackingInfo | ( | ) |
Definition at line 187 of file llcallingcard.cpp.
References LLTrackingData::haveTrackingInfo(), and mTrackingData.
Referenced by LLTracker::getTrackedPositionGlobal(), LLTracker::render3D(), LLFloaterWorldMap::teleport(), and LLFloaterWorldMap::teleportToAvatar().
Definition at line 219 of file llcallingcard.cpp.
References LLViewerObjectList::findObject(), gAgent, LLAgent::getPositionGlobal(), gObjectList, LLViewerObject::isDead(), LLTrackingData::mAvatarID, LLVector3d::mdV, LLTrackingData::mGlobalPositionEstimate, mTrackingData, RAD_TO_DEG, VX, VY, and VZ.
LLVector3d LLAvatarTracker::getGlobalPos | ( | ) |
Definition at line 196 of file llcallingcard.cpp.
References LLViewerObjectList::findObject(), gObjectList, LLViewerObject::isDead(), LLTrackingData::mAvatarID, LLVector3d::mdV, LLTrackingData::mGlobalPositionEstimate, mTrackedAgentValid, mTrackingData, and VZ.
Referenced by LLTracker::getTrackedPositionGlobal(), LLTracker::render3D(), LLFloaterWorldMap::teleport(), and LLFloaterWorldMap::teleportToAvatar().
const LLString & LLAvatarTracker::getName | ( | void | ) |
Definition at line 243 of file llcallingcard.cpp.
References LLTrackingData::mName, mTrackingData, and LLStringBase< char >::null.
Referenced by LLTracker::render3D().
const LLUUID & LLAvatarTracker::getAvatarID | ( | ) |
Definition at line 255 of file llcallingcard.cpp.
References LLTrackingData::mAvatarID, mTrackingData, and LLUUID::null.
Referenced by LLFloaterWorldMap::friendsChanged(), LLFloaterWorldMap::onAvatarComboPrearrange(), LLTracker::render3D(), and LLTracker::stopTrackingAvatar().
S32 LLAvatarTracker::addBuddyList | ( | const buddy_map_t & | buddies | ) |
Definition at line 267 of file llcallingcard.cpp.
References LLFriendObserver::ADD, gCacheName, LLCacheName::getName(), LLRelationship::getRightsGrantedTo(), LLRelationship::isOnline(), lldebugs, llendl, llwarns, mBuddyInfo, mModifyMask, and notifyObservers().
Referenced by idle_startup().
void LLAvatarTracker::copyBuddyList | ( | buddy_map_t & | buddies | ) | const |
Definition at line 307 of file llcallingcard.cpp.
References mBuddyInfo.
Referenced by LLPanelFriends::refreshNames().
void LLAvatarTracker::terminateBuddy | ( | const LLUUID & | id | ) |
Definition at line 317 of file llcallingcard.cpp.
References LLMessageSystem::addUUID(), gAgent, get_ptr_in_map(), LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, lldebugs, llendl, mBuddyInfo, mModifyMask, LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), LLFriendObserver::REMOVE, and LLAgent::sendReliableMessage().
Referenced by LLPanelFriends::handleRemove().
const LLRelationship * LLAvatarTracker::getBuddyInfo | ( | const LLUUID & | id | ) | const |
Definition at line 336 of file llcallingcard.cpp.
References get_ptr_in_map(), mBuddyInfo, and NULL.
Referenced by LLPanelFriends::addFriend(), LLPanelFriends::applyRightsToFriends(), deliver_message(), LLFloaterWorldMap::friendsChanged(), LLPanelFriends::handleRemove(), LLPanelFriends::modifyRightsConfirmation(), LLIMMgr::noteMutedUsers(), LLIMMgr::noteOfflineUsers(), LLPanelFriends::onClickIM(), processNotify(), LLPanelFriends::refreshRightsChangeList(), LLTracker::render3D(), and LLPanelAvatar::setAvatarID().
void LLAvatarTracker::setBuddyOnline | ( | const LLUUID & | id, | |
bool | is_online | |||
) |
Definition at line 343 of file llcallingcard.cpp.
References get_ptr_in_map(), lldebugs, llendl, llwarns, mBuddyInfo, mModifyMask, LLFriendObserver::ONLINE, and LLRelationship::online().
Referenced by processNotify().
bool LLAvatarTracker::isBuddyOnline | ( | const LLUUID & | id | ) | const |
Definition at line 359 of file llcallingcard.cpp.
References get_ptr_in_map(), LLRelationship::isOnline(), and mBuddyInfo.
Referenced by LLCallingCardBridge::buildContextMenu(), LLCallingCardBridge::getIcon(), LLBeginIMSession::handleEvent(), LLPanelFriends::onClickProfile(), and LLCallingCardBridge::openItem().
void LLAvatarTracker::setBuddyEmpowered | ( | const LLUUID & | id, | |
bool | is_empowered | |||
) |
Definition at line 370 of file llcallingcard.cpp.
References get_ptr_in_map(), LLRelationship::GRANT_MODIFY_OBJECTS, LLRelationship::grantRights(), mBuddyInfo, mModifyMask, and LLFriendObserver::POWERS.
bool LLAvatarTracker::isBuddyEmpowered | ( | const LLUUID & | id | ) | const |
Definition at line 380 of file llcallingcard.cpp.
References get_ptr_in_map(), LLRelationship::GRANT_MODIFY_OBJECTS, LLRelationship::isRightGrantedTo(), and mBuddyInfo.
void LLAvatarTracker::empowerList | ( | const buddy_map_t & | list, | |
bool | grant | |||
) |
void LLAvatarTracker::empower | ( | const LLUUID & | id, | |
bool | grant | |||
) |
Definition at line 390 of file llcallingcard.cpp.
Referenced by LLPanelFriends::handleRemove().
void LLAvatarTracker::registerCallbacks | ( | LLMessageSystem * | msg | ) |
Definition at line 517 of file llcallingcard.cpp.
References _PREHASH_ChangeUserRights, _PREHASH_FindAgent, _PREHASH_OfflineNotification, _PREHASH_OnlineNotification, processAgentFound(), processChangeUserRights(), processOfflineNotification(), processOnlineNotification(), processTerminateFriendship(), LLMessageSystem::setHandlerFunc(), and LLMessageSystem::setHandlerFuncFast().
Referenced by idle_startup().
void LLAvatarTracker::addObserver | ( | LLFriendObserver * | observer | ) |
Definition at line 480 of file llcallingcard.cpp.
References mObservers.
Referenced by LLCallingCardBridge::LLCallingCardBridge(), LLIMMgr::LLIMMgr(), LLPanelFriends::LLPanelFriends(), LLFloaterWorldMap::observeFriends(), and LLAgent::observeFriends().
void LLAvatarTracker::removeObserver | ( | LLFriendObserver * | observer | ) |
Definition at line 488 of file llcallingcard.cpp.
References mObservers.
Referenced by LLCallingCardBridge::~LLCallingCardBridge(), LLIMMgr::~LLIMMgr(), and LLPanelFriends::~LLPanelFriends().
void LLAvatarTracker::notifyObservers | ( | ) |
Definition at line 495 of file llcallingcard.cpp.
References mModifyMask, mObservers, and LLFriendObserver::NONE.
Referenced by addBuddyList(), formFriendship(), LLPanelFriends::handleRemove(), processChange(), processNotify(), and processTerminateFriendship().
void LLAvatarTracker::applyFunctor | ( | LLRelationshipFunctor & | f | ) |
Definition at line 507 of file llcallingcard.cpp.
References mBuddyInfo.
Referenced by LLFloaterWorldMap::buildAvatarIDList(), and LLAgent::friendsChanged().
void LLAvatarTracker::formFriendship | ( | const LLUUID & | friend_id | ) | [static] |
Definition at line 696 of file llcallingcard.cpp.
References LLFriendObserver::ADD, get_ptr_in_map(), LLRelationship::GRANT_ONLINE_STATUS, instance(), mBuddyInfo, mModifyMask, and notifyObservers().
Referenced by friendship_offer_callback(), and process_improved_im().
void LLAvatarTracker::deleteTrackingData | ( | ) | [protected] |
Definition at line 455 of file llcallingcard.cpp.
References mTrackingData, and NULL.
Referenced by processNotify(), track(), untrack(), and ~LLAvatarTracker().
void LLAvatarTracker::agentFound | ( | const LLUUID & | prey, | |
const LLVector3d & | estimated_global_pos | |||
) | [protected] |
Definition at line 547 of file llcallingcard.cpp.
References LLTrackingData::agentFound(), instance(), mTrackingData, and setTrackedAgentValid().
Referenced by processAgentFound().
void LLAvatarTracker::processAgentFound | ( | LLMessageSystem * | msg, | |
void ** | ||||
) | [static, protected] |
Definition at line 531 of file llcallingcard.cpp.
References _PREHASH_AgentBlock, _PREHASH_GlobalX, _PREHASH_GlobalY, _PREHASH_Hunter, _PREHASH_LocationBlock, _PREHASH_Prey, agentFound(), LLMessageSystem::getF64Fast(), LLMessageSystem::getUUIDFast(), instance(), LLVector3d::mdV, VX, and VY.
Referenced by registerCallbacks().
void LLAvatarTracker::processOnlineNotification | ( | LLMessageSystem * | msg, | |
void ** | ||||
) | [static, protected] |
Definition at line 558 of file llcallingcard.cpp.
References instance(), lldebugs, llendl, and processNotify().
Referenced by registerCallbacks().
void LLAvatarTracker::processOfflineNotification | ( | LLMessageSystem * | msg, | |
void ** | ||||
) | [static, protected] |
Definition at line 565 of file llcallingcard.cpp.
References instance(), lldebugs, llendl, and processNotify().
Referenced by registerCallbacks().
void LLAvatarTracker::processTerminateFriendship | ( | LLMessageSystem * | msg, | |
void ** | ||||
) | [static, protected] |
Definition at line 714 of file llcallingcard.cpp.
References get_ptr_in_map(), LLMessageSystem::getUUID(), instance(), mBuddyInfo, mModifyMask, notifyObservers(), and LLFriendObserver::REMOVE.
Referenced by registerCallbacks().
void LLAvatarTracker::processChangeUserRights | ( | LLMessageSystem * | msg, | |
void ** | ||||
) | [static, protected] |
Definition at line 619 of file llcallingcard.cpp.
References instance(), lldebugs, llendl, and processChange().
Referenced by registerCallbacks().
void LLAvatarTracker::processNotify | ( | LLMessageSystem * | msg, | |
bool | online | |||
) | [protected] |
Definition at line 625 of file llcallingcard.cpp.
References _PREHASH_AgentBlock, _PREHASH_AgentID, LLInventoryModel::addChangedMask(), LLFloaterIMPanel::addHistoryLine(), LLInventoryObserver::CALLING_CARD, LLIMMgr::computeSessionID(), deleteTrackingData(), LLUIString::empty(), FALSE, LLIMMgr::findFloaterBySession(), gCacheName, LLControlGroup::getBOOL(), getBuddyInfo(), LLControlGroup::getColor4(), LLCacheName::getName(), LLMessageSystem::getNumberOfBlocksFast(), LLNotifyBox::getTemplateMessage(), LLMessageSystem::getUUIDFast(), gIMMgr, gInventory, gSavedSettings, i, IM_NOTHING_SPECIAL, instance(), lldebugs, llendl, llwarns, LLTrackingData::mAvatarID, mModifyMask, mTrackingData, LLInventoryModel::notifyObservers(), notifyObservers(), LLUUID::null, NULL, LLFriendObserver::ONLINE, S32, setBuddyOnline(), LLNotifyBox::showXml(), and TRUE.
Referenced by processOfflineNotification(), and processOnlineNotification().
void LLAvatarTracker::processChange | ( | LLMessageSystem * | msg | ) | [protected] |
Definition at line 571 of file llcallingcard.cpp.
References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_AgentRelated, _PREHASH_RelatedRights, _PREHASH_Rights, LLViewerWindow::alertXml(), gAgent, gCacheName, LLAgent::getID(), LLCacheName::getName(), LLMessageSystem::getNumberOfBlocksFast(), LLMessageSystem::getS32Fast(), LLMessageSystem::getUUIDFast(), LLRelationship::GRANT_MODIFY_OBJECTS, gViewerWindow, i, mBuddyInfo, mModifyMask, notifyObservers(), LLFriendObserver::POWERS, and S32.
Referenced by processChangeUserRights().
bool LLAvatarTracker::operator== | ( | const LLAvatarTracker & | ) | [private] |
LLAvatarTracker LLAvatarTracker::sInstance [static, protected] |
LLTrackingData* LLAvatarTracker::mTrackingData [protected] |
Definition at line 173 of file llcallingcard.h.
Referenced by agentFound(), deleteTrackingData(), findAgent(), getAvatarID(), getDegreesAndDist(), getGlobalPos(), getName(), haveTrackingInfo(), processNotify(), setTrackedCoarseLocation(), track(), and untrack().
bool LLAvatarTracker::mTrackedAgentValid [protected] |
Definition at line 174 of file llcallingcard.h.
Referenced by getGlobalPos(), isTrackedAgentValid(), setTrackedAgentValid(), track(), and untrack().
U32 LLAvatarTracker::mModifyMask [protected] |
Definition at line 175 of file llcallingcard.h.
Referenced by addBuddyList(), formFriendship(), notifyObservers(), processChange(), processNotify(), processTerminateFriendship(), setBuddyEmpowered(), setBuddyOnline(), and terminateBuddy().
buddy_map_t LLAvatarTracker::mBuddyInfo [protected] |
Definition at line 179 of file llcallingcard.h.
Referenced by addBuddyList(), applyFunctor(), copyBuddyList(), formFriendship(), getBuddyInfo(), isBuddyEmpowered(), isBuddyOnline(), processChange(), processTerminateFriendship(), setBuddyEmpowered(), setBuddyOnline(), terminateBuddy(), and ~LLAvatarTracker().
observer_list_t LLAvatarTracker::mObservers [protected] |
Definition at line 182 of file llcallingcard.h.
Referenced by addObserver(), notifyObservers(), removeObserver(), and ~LLAvatarTracker().