public void Objects_OnObjectUpdated1(Simulator simulator, Primitive objectUpdated, ObjectMovementUpdate update, ulong regionHandle, ushort timeDilation) { if (!IsMaster(simulator)) { return; } if (objectUpdated != null) { //lock (objectUpdated) { // other OMV code already updated the Primitive // updateToPrim(prim, update); if (objectUpdated.Properties != null) { //CalcStats(objectUpdated); DeclareProperties(objectUpdated, objectUpdated.Properties, simulator); describePrimToAI(objectUpdated, simulator); } else { EnsureSelected(objectUpdated, simulator); } // Make a Last Object Update from the Primitive if we knew nothing about it if (MaintainObjectUpdates) { SimObject simObject = GetSimObject(objectUpdated, simulator); if (simObject != null) { lock (LastObjectUpdate) if (!LastObjectUpdate.ContainsKey(simObject)) { LastObjectUpdate[simObject] = updatFromSimObject(simObject); } if (m_TheSimAvatar != null) { //double dist = simObject.Distance(TheSimAvatar); //if (dist > 30 && !update.Avatar) return; } // Make a "diff" from previous ObjectMovementUpdate up; lock (LastObjectUpdate) up = LastObjectUpdate[simObject]; Object diffO = notifyUpdate(simObject, up, update, InformUpdate); if (diffO != null) { ObjectMovementUpdate diff = (ObjectMovementUpdate)diffO; //if (lastObjectUpdateDiff.ContainsKey(objectUpdated.ID)) //{ // notifyUpdate(objectUpdated, lastObjectUpdateDiff[objectUpdated.ID], diff, InformUpdateDiff); //} lock (LastObjectUpdateDiff) LastObjectUpdateDiff[objectUpdated.ID] = diff; } else { // someThingElseNeedsUpdate(objectUpdated); // needsOsdDiff = true; } ObjectMovementUpdate TheDiff = default(ObjectMovementUpdate); lock (LastObjectUpdateDiff) { if (LastObjectUpdateDiff.ContainsKey(objectUpdated.ID)) { TheDiff = LastObjectUpdateDiff[objectUpdated.ID]; } else { LastObjectUpdateDiff[objectUpdated.ID] = TheDiff; } } simObject.UpdateObject(update, TheDiff); lock (LastObjectUpdate) LastObjectUpdate[simObject] = update; } } } } else { //WriteLine("missing Objects_OnObjectUpdated"); } }