OpenMetaverse.Messages.Linden.TeleportFinishMessage.Deserialize C# (CSharp) Method

Deserialize() public method

Deserialize the message
public Deserialize ( OSDMap map ) : void
map OSDMap An containing the data
return void
        public void Deserialize(OSDMap map)
        {
            OSDArray array = (OSDArray)map["Info"];
            OSDMap blockMap = (OSDMap)array[0];

            AgentID = blockMap["AgentID"].AsUUID();
            LocationID = blockMap["LocationID"].AsInteger();
            RegionHandle = blockMap["RegionHandle"].AsULong();
            SeedCapability = blockMap["SeedCapability"].AsUri();
            SimAccess = (SimAccess)blockMap["SimAccess"].AsInteger();
            IP = MessageUtils.ToIP(blockMap["SimIP"]);
            Port = blockMap["SimPort"].AsInteger();
            Flags = (TeleportFlags)blockMap["TeleportFlags"].AsUInteger();
        }
    }

Usage Example

        public void TeleportFinishMessage()
        {
            TeleportFinishMessage s = new TeleportFinishMessage();
            s.AgentID = UUID.Random();
            s.Flags = TeleportFlags.ViaLocation | TeleportFlags.IsFlying;
            s.IP = testIP;
            s.LocationID = 32767;
            s.Port = 3000;
            s.RegionHandle = testHandle;
            s.SeedCapability = testURI;
            s.SimAccess = SimAccess.Mature;

            OSDMap map = s.Serialize();

            TeleportFinishMessage t = new TeleportFinishMessage();
            t.Deserialize(map);

            Assert.AreEqual(s.AgentID, t.AgentID);
            Assert.AreEqual(s.Flags, t.Flags);
            Assert.AreEqual(s.IP, t.IP);
            Assert.AreEqual(s.LocationID, t.LocationID);
            Assert.AreEqual(s.Port, t.Port);
            Assert.AreEqual(s.RegionHandle, t.RegionHandle);
            Assert.AreEqual(s.SeedCapability, t.SeedCapability);
            Assert.AreEqual(s.SimAccess, t.SimAccess);
        }
TeleportFinishMessage