OpenMetaverse.Messages.Linden.EstablishAgentCommunicationMessage.Serialize C# (CSharp) Method

Serialize() public method

Serialize the object
public Serialize ( ) : OSDMap
return OSDMap
        public OSDMap Serialize()
        {
            OSDMap map = new OSDMap(3);
            map["agent-id"] = OSD.FromUUID(AgentID);
            map["sim-ip-and-port"] = OSD.FromString(String.Format("{0}:{1}", Address, Port));
            map["seed-capability"] = OSD.FromUri(SeedCapability);
            return map;
        }

Usage Example

        public void EstablishAgentCommunicationMessage()
        {
            EstablishAgentCommunicationMessage s = new EstablishAgentCommunicationMessage();
            s.Address = testIP;
            s.AgentID = UUID.Random();
            s.Port = 3000;
            s.SeedCapability = testURI;

            OSDMap map = s.Serialize();

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

            Assert.AreEqual(s.Address, t.Address);
            Assert.AreEqual(s.AgentID, t.AgentID);
            Assert.AreEqual(s.Port, t.Port);
            Assert.AreEqual(s.SeedCapability, t.SeedCapability);
        }
All Usage Examples Of OpenMetaverse.Messages.Linden.EstablishAgentCommunicationMessage::Serialize
EstablishAgentCommunicationMessage