summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorAndrew Meadows <andrew@lindenlab.com>2012-12-13 15:43:10 -0800
committerAndrew Meadows <andrew@lindenlab.com>2012-12-13 15:43:10 -0800
commit834a956a70bb49f1a242681bd611df4bbb7e4cc8 (patch)
treecaf50fa7cb6ce96c1969694cfa2cdd65a171c496 /indra/newview/llviewermessage.cpp
parent0270ce079c2090cd25244516648ac1691db00a0d (diff)
We now handle local_id=0 in KillObject as a prefix to deleted local_id's.
This is the real viewer-side work that was the motivation for MAINT-2123. Reviewed with Bao.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp80
1 files changed, 39 insertions, 41 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 67d400af2d..62d4e779d0 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4483,40 +4483,42 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_
static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Kill Objects");
+const U32 KILLOBJECT_DELETE_OPCODE = 0;
+
void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
{
LLFastTimer t(FTM_PROCESS_OBJECTS);
- LLUUID id;
- U32 local_id;
- S32 i = 0;
- S32 num_objects;
-
- num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
+ LLUUID id;
- mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
+ U32 ip = mesgsys->getSenderIP();
+ U32 port = mesgsys->getSenderPort();
LLViewerRegion* regionp = NULL;
- bool remove_from_cache = !local_id; //if the first local id is 0, physically remove all objects from VO cache.
- if(remove_from_cache)
{
- i++;
-
- LLHost host(gMessageSystem->getSenderIP(), gMessageSystem->getSenderPort());
+ LLHost host(ip, port);
regionp = LLWorld::getInstance()->getRegion(host);
}
- for (; i < num_objects; i++)
+
+ bool delete_object = false;
+ S32 num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
+ for (S32 i = 0; i < num_objects; ++i)
{
+ U32 local_id;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
+ if (local_id == KILLOBJECT_DELETE_OPCODE)
+ {
+ // This local_id is invalid, but was sent by the server to flag
+ // all subsequent local_id's as objects that were actually deleted
+ // rather than unsubscribed from interestlist.
+ delete_object = true;
+ continue;
+ }
- LLViewerObjectList::getUUIDFromLocal(id,
- local_id,
- gMessageSystem->getSenderIP(),
- gMessageSystem->getSenderPort());
+ LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port);
if (id == LLUUID::null)
{
LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL;
- gObjectList.mNumUnknownKills++;
continue;
}
else
@@ -4524,39 +4526,35 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
LL_DEBUGS("Messaging") << "Kill message for local " << local_id << LL_ENDL;
}
- // ...don't kill the avatar
- if (!(id == gAgentID))
+ if (id == gAgentID)
{
- LLViewerObject *objectp = gObjectList.findObject(id);
- if (objectp)
- {
- // Display green bubble on kill
- if ( gShowObjectUpdates )
- {
- LLColor4 color(0.f,1.f,0.f,1.f);
- gPipeline.addDebugBlip(objectp->getPositionAgent(), color);
- }
-
- // Do the kill
- gObjectList.killObject(objectp);
- }
- //else
- //{
- // LL_WARNS("Messaging") << "Object in UUID lookup, but not on object list in kill!" << LL_ENDL;
- // gObjectList.mNumUnknownKills++;
- //}
+ // never kill our avatar
+ continue;
+ }
- if(remove_from_cache)
+ LLViewerObject *objectp = gObjectList.findObject(id);
+ if (objectp)
+ {
+ // Display green bubble on kill
+ if ( gShowObjectUpdates )
{
- regionp->killCacheEntry(local_id);
+ LLColor4 color(0.f,1.f,0.f,1.f);
+ gPipeline.addDebugBlip(objectp->getPositionAgent(), color);
}
+
+ // Do the kill
+ gObjectList.killObject(objectp);
+ }
+
+ if(delete_object)
+ {
+ regionp->killCacheEntry(local_id);
}
// We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab,
// which is using the object, release the mouse capture correctly when the object dies.
// See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical().
LLSelectMgr::getInstance()->removeObjectFromSelections(id);
-
}
}