Issue Details (XML | Word | Printable)

Key: LIBOMV-367
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Jim Radford
Reporter: Blue Backbite
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
libopenmetaverse

client.Objects.OnObjectUpdated Bug

Created: 28/Aug/08 07:52 PM   Updated: 05/Sep/08 08:50 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.6.0

Issue Links:
Blocks
 

Environment: .NET / Windows32
Steps to Reproduce:

use
client.Objects.OnObjectUpdated += new ObjectManager.ObjectUpdatedCallback(Objects_OnObjectUpdated);

And Login to an enviornment with active physical objects or moving avatars.



 Description  « Hide
Object reference not set to an instance of
an object.
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at OpenMetaverse.Primitive.op_Equality(Primitive lhs, Primitive rhs) in D:\LI
BSL\OpenMetaverse\Primitives\Primitive.cs:line 1271
at DebugClient.ServerAPP.Objects_OnObjectUpdated(Simulator simulator, ObjectU
pdate update, UInt64 regionHandle, UInt16 timeDilation) in D:\LIBSL\DebugClient\
SeAPP.cs:line 719
at OpenMetaverse.ObjectManager.FireOnObjectUpdated(Simulator simulator, Objec
tUpdate update, UInt64 RegionHandle, UInt16 TimeDilation) in D:\LIBSL\OpenMetave
rse\ObjectManager.cs:line 2355

Error encountered whenever an object update is received. (Objects_OnObjectUpdated functions don't seem to work)



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dirty McLean added a comment - 28/Aug/08 08:13 PM
Code context would be helpful. Even if this issue is resolved so that it prints the exception in console instead of crashing, I believe you might be doing a comparison on a null object which is the real source of your troubles. I could be mistaken, but without seeing the code, it is hard to say.

Blue Backbite added a comment - 28/Aug/08 08:20 PM - edited
Contents of my Objects_OnObjectUpdated

private static void Objects_OnObjectUpdated(Simulator simulator, ObjectUpdate update, ulong regionHandle, ushort timeDilation) //Callback for object updates in simulator
{
if (!update.Avatar) { return; }//Exit this event if it's not an avatar update
Avatar av;//Objects.TryGetAvatar(update.LocalID, out av);
client.Network.CurrentSim.ObjectsAvatars.TryGetValue(update.LocalID, out av);
string GroupIDS = av.GroupName;
if (av == null) return;

if (follow != null)
{
if (av.Name == follow)
{
if (Vector3.Distance(av.Position, client.Self.SimPosition) > 3)

{ Vector3 post = av.Position; client.Self.AutoPilotLocal(Convert.ToInt32(post.X), Convert.ToInt32(post.Y), post.Z); }

else

{ client.Self.AutoPilotCancel(); }

}
}
}


Jim Radford added a comment - 03/Sep/08 02:13 PM
I believe this patch is intended to correct this bad behaviour