From 3f25128e77af2a53e765436454b8fddeb8f88894 Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 18 Feb 2009 01:49:18 +0000 Subject: Adds support for preserving animations on region crossings and TPs. Known issue: after TP, the self client doesn't see the animations going, but others can see them. So there's a bug there (TPs only, crossings seem to be all fine). Untested: did not test animation overriders; only tested playing animations from the viewer. --- OpenSim/Region/Framework/Scenes/Animation.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Animation.cs') diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs index 6f0681c..7c3e010 100644 --- a/OpenSim/Region/Framework/Scenes/Animation.cs +++ b/OpenSim/Region/Framework/Scenes/Animation.cs @@ -26,6 +26,7 @@ */ using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Region.Framework.Scenes { @@ -62,5 +63,30 @@ namespace OpenSim.Region.Framework.Scenes this.sequenceNum = sequenceNum; this.objectID = objectID; } + + public Animation(OSDMap args) + { + UnpackUpdateMessage(args); + } + + public OSDMap PackUpdateMessage() + { + OSDMap anim = new OSDMap(); + anim["animation"] = OSD.FromUUID(animID); + anim["object_id"] = OSD.FromUUID(objectID); + anim["seq_num"] = OSD.FromInteger(sequenceNum); + return anim; + } + + public void UnpackUpdateMessage(OSDMap args) + { + if (args["animation"] != null) + animID = args["animation"].AsUUID(); + if (args["object_id"] != null) + objectID = args["object_id"].AsUUID(); + if (args["seq_num"] != null) + sequenceNum = args["seq_num"].AsInteger(); + } + } } -- cgit v1.1