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

Deserialize() public method

Deserialize the message
public Deserialize ( OSDMap map ) : void
map OSDMap An containing the data
return void
        public override void Deserialize(OSDMap map)
        {
            Method = map["method"].AsString();
            OSDArray agentsArray = (OSDArray)map["params"];

            AgentsBlock = new UUID[agentsArray.Count];

            for (int i = 0; i < agentsArray.Count; i++)
            {
                AgentsBlock[i] = agentsArray[i].AsUUID();
            }

            SessionID = map["session-id"].AsUUID();
        }
    }

Usage Example

        public void ChatSessionRequestStartConference()
        {
            ChatSessionRequestStartConference s = new ChatSessionRequestStartConference();
            s.SessionID = UUID.Random();
            s.AgentsBlock = new UUID[2];
            s.AgentsBlock[0] = UUID.Random();
            s.AgentsBlock[0] = UUID.Random();

            OSDMap map = s.Serialize();

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

            Assert.AreEqual(s.SessionID, t.SessionID);
            Assert.AreEqual(s.Method, t.Method);
            for (int i = 0; i < t.AgentsBlock.Length; i++)
            {
                Assert.AreEqual(s.AgentsBlock[i], t.AgentsBlock[i]);
            }
        }