Added more information to inspect and fixed some bugs in the eavesdropping detection

This commit is contained in:
phr0z3nt04st
2010-07-06 19:10:28 -05:00
parent c6a4f2570f
commit 067e6d2a83
5 changed files with 131 additions and 23 deletions

View File

@@ -512,15 +512,23 @@ void LLPanelActiveSpeakers::refreshSpeakers()
// <edit> // <edit>
if(!mShowTextChatters && !(speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) && speakerp->mID != gAgent.getID()) if(!mShowTextChatters && !(speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) && speakerp->mID != gAgent.getID())
{ {
// let us check to see if they are actually in the sim bool found = false;
LLViewerRegion* regionp = gAgent.getRegion(); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
if(regionp) iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{ {
if(regionp->mMapAvatarIDs.find(speakerp->mID) == -1) LLViewerRegion* regionp = *iter;
// let us check to see if they are actually in the sim
if(regionp)
{ {
name_cell->setColor(LLColor4::red); if(regionp->mMapAvatarIDs.find(speakerp->mID) != -1)
{
found = true;
break;
}
} }
} }
if(!found)
name_cell->setColor(LLColor4::red);
} }
// </edit> // </edit>

View File

@@ -212,7 +212,7 @@ void LLFloaterInspect::refresh()
{ {
LLSelectNode* obj = *iter; LLSelectNode* obj = *iter;
LLSD row; LLSD row;
std::string owner_name, creator_name, time; std::string owner_name, creator_name, time, last_owner_name;
if (obj->mCreationDate == 0) if (obj->mCreationDate == 0)
{ // Don't have valid information from the server, so skip this one { // Don't have valid information from the server, so skip this one
@@ -223,6 +223,9 @@ void LLFloaterInspect::refresh()
timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), time); timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), time);
gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name); gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name);
gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name);
// <edit>
gCacheName->getFullName(obj->mPermissions->getLastOwner(), last_owner_name);
// </edit>
row["id"] = obj->getObject()->getID(); row["id"] = obj->getObject()->getID();
row["columns"][0]["column"] = "object_name"; row["columns"][0]["column"] = "object_name";
row["columns"][0]["type"] = "text"; row["columns"][0]["type"] = "text";
@@ -236,15 +239,59 @@ void LLFloaterInspect::refresh()
{ {
row["columns"][0]["value"] = obj->mName; row["columns"][0]["value"] = obj->mName;
} }
row["columns"][1]["column"] = "owner_name"; // <edit>
row["columns"][1]["type"] = "text"; int i = 1;
row["columns"][1]["value"] = owner_name; row["columns"][i]["column"] = "owner_name";
row["columns"][2]["column"] = "creator_name"; row["columns"][i]["type"] = "text";
row["columns"][2]["type"] = "text"; row["columns"][i]["value"] = owner_name;
row["columns"][2]["value"] = creator_name; ++i;
row["columns"][3]["column"] = "creation_date"; row["columns"][i]["column"] = "last_owner_name";
row["columns"][3]["type"] = "text"; row["columns"][i]["type"] = "text";
row["columns"][3]["value"] = time; row["columns"][i]["value"] = last_owner_name;
++i;
row["columns"][i]["column"] = "creator_name";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = creator_name;
++i;
row["columns"][i]["column"] = "face_num";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = llformat("%d",obj->getObject()->getNumFaces());
++i;
row["columns"][i]["column"] = "vertex_num";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = llformat("%d",obj->getObject()->getNumVertices());
++i;
// inventory silliness
S32 scripts,total_inv;
std::map<LLUUID,std::pair<S32,S32> >::iterator itr = mInventoryNums.find(obj->getObject()->getID());
if(itr != mInventoryNums.end())
{
scripts = itr->second.first;
total_inv = itr->second.second;
}
else
{
scripts = 0;
total_inv = 0;
if(std::find(mQueue.begin(),mQueue.end(),obj->getObject()->getID()) == mQueue.end())
{
mQueue.push_back(obj->getObject()->getID());
registerVOInventoryListener(obj->getObject(),NULL);
requestVOInventory();
}
}
row["columns"][i]["column"] = "script_num";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = llformat("%d",scripts);
++i;
row["columns"][i]["column"] = "inv_num";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = llformat("%d",total_inv);
++i;
row["columns"][i]["column"] = "creation_date";
row["columns"][i]["type"] = "text";
row["columns"][i]["value"] = time;
// </edit>
mObjectList->addElement(row, ADD_TOP); mObjectList->addElement(row, ADD_TOP);
} }
if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index) if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)
@@ -258,7 +305,31 @@ void LLFloaterInspect::refresh()
onSelectObject(this, NULL); onSelectObject(this, NULL);
mObjectList->setScrollPos(pos); mObjectList->setScrollPos(pos);
} }
// <edit>
void LLFloaterInspect::inventoryChanged(LLViewerObject* viewer_object,
InventoryObjectList* inv,
S32,
void* q_id)
{
S32 scripts = 0;
std::vector<LLUUID>::iterator iter = std::find(mQueue.begin(),mQueue.end(),viewer_object->getID());
if (viewer_object && inv && iter != mQueue.end() )
{
InventoryObjectList::const_iterator it = inv->begin();
InventoryObjectList::const_iterator end = inv->end();
for ( ; it != end; ++it)
{
if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
{
scripts++;
}
}
mInventoryNums[viewer_object->getID()] = std::make_pair(scripts,inv->size());
mQueue.erase(iter);
mDirty = TRUE;
}
}
// </edit>
void LLFloaterInspect::onFocusReceived() void LLFloaterInspect::onFocusReceived()
{ {
LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance()); LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance());
@@ -269,6 +340,9 @@ void LLFloaterInspect::dirty()
{ {
if(sInstance) if(sInstance)
{ {
// <edit>
sInstance->mInventoryNums.clear();
sInstance->mQueue.clear();
sInstance->setDirty(); sInstance->setDirty();
} }
} }

View File

@@ -36,13 +36,14 @@
#define LL_LLFLOATERINSPECT_H #define LL_LLFLOATERINSPECT_H
#include "llfloater.h" #include "llfloater.h"
#include "llvoinventorylistener.h"
//class LLTool; //class LLTool;
class LLObjectSelection; class LLObjectSelection;
class LLScrollListCtrl; class LLScrollListCtrl;
class LLUICtrl; class LLUICtrl;
class LLFloaterInspect : public LLFloater class LLFloaterInspect : public LLFloater, public LLVOInventoryListener
{ {
public: public:
virtual ~LLFloaterInspect(void); virtual ~LLFloaterInspect(void);
@@ -63,12 +64,20 @@ protected:
LLFloaterInspect(); LLFloaterInspect();
void setDirty() { mDirty = TRUE; } void setDirty() { mDirty = TRUE; }
bool mDirty; bool mDirty;
// <edit>
/*virtual*/ void inventoryChanged(LLViewerObject* obj,
InventoryObjectList* inv,
S32 serial_num,
void* queue);
private: private:
// static data // static data
static LLFloaterInspect* sInstance; static LLFloaterInspect* sInstance;
LLSafeHandle<LLObjectSelection> mObjectSelection; LLSafeHandle<LLObjectSelection> mObjectSelection;
// <edit>
std::map<LLUUID,std::pair<S32,S32> > mInventoryNums; //<scripts,total>
std::vector<LLUUID> mQueue;
}; };
#endif //LL_LLFLOATERINSPECT_H #endif //LL_LLFLOATERINSPECT_H

View File

@@ -75,6 +75,10 @@
// for MD5 hash // for MD5 hash
#include "llmd5.h" #include "llmd5.h"
// <edit>
#include "llworld.h"
// </edit>
#define USE_SESSION_GROUPS 0 #define USE_SESSION_GROUPS 0
static bool sConnectingToAgni = false; static bool sConnectingToAgni = false;
@@ -4903,16 +4907,24 @@ LLVoiceClient::participantState *LLVoiceClient::sessionState::addParticipant(con
// <edit> // <edit>
if(nameFromsipURI(uri) != gVoiceClient->mAccountName) if(nameFromsipURI(uri) != gVoiceClient->mAccountName)
{ {
// let us check to see if they are actually in the sim bool found = true;
LLViewerRegion* regionp = gAgent.getRegion(); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
if(regionp) iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{ {
if(regionp->mMapAvatarIDs.find(id) == -1) LLViewerRegion* regionp = *iter;
// let us check to see if they are actually in the sim
if(regionp)
{ {
// They are not in my list of people in my sim, they must be a spy. if(regionp->mMapAvatarIDs.find(id) != -1)
gCacheName->getName(id, onAvatarNameLookup, NULL); {
found = true;
break;
}
} }
} }
if(!found)
// They are not in my list of people in my sims, they must be a spy.
gCacheName->getName(id, onAvatarNameLookup, NULL);
} }
// </edit> // </edit>

View File

@@ -9,7 +9,12 @@
top="-20"> top="-20">
<column dynamicwidth="true" label="Object Name" name="object_name" /> <column dynamicwidth="true" label="Object Name" name="object_name" />
<column dynamicwidth="true" label="Owner Name" name="owner_name" /> <column dynamicwidth="true" label="Owner Name" name="owner_name" />
<column dynamicwidth="true" label="Last Owner Name" name="last_owner_name" />
<column dynamicwidth="true" label="Creator Name" name="creator_name" /> <column dynamicwidth="true" label="Creator Name" name="creator_name" />
<column label="Faces" name="face_num" width="35" />
<column label="Vertices" name="vertex_num" width="35" />
<column label="Scripts" name="script_num" width="35" />
<column label="Inv Total" name="inv_num" width="35" />
<column label="Creation Date" name="creation_date" width="150" /> <column label="Creation Date" name="creation_date" width="150" />
</scroll_list> </scroll_list>
<button bottom="5" follows="left|bottom" font="SansSerif" halign="center" height="20" <button bottom="5" follows="left|bottom" font="SansSerif" halign="center" height="20"