Exemplo n.º 1
0
 /// <summary>
 /// Deserializes this object.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public void Deserialize(IMDSDeserializer deserializer)
 {
     Name      = deserializer.ReadStringUTF8();
     IpAddress = deserializer.ReadStringUTF8();
     Port      = deserializer.ReadInt32();
     Adjacents = deserializer.ReadStringUTF8();
     Location  = deserializer.ReadStringUTF8();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Reads and constructs a MDSMessage according to the protocol rules.
        /// </summary>
        /// <param name="deserializer">Deserializer to read message</param>
        /// <returns>MDSMessage object that is read</returns>
        public MDSMessage ReadMessage(IMDSDeserializer deserializer)
        {
            //Read protocol type
            var protocolType = deserializer.ReadUInt32();
            if (protocolType != MDSDefaultProtocolType)
            {
                throw new MDSException("Wrong protocol type: " + protocolType + ".");
            }

            //Read message type
            var messageTypeId = deserializer.ReadInt32();

            //Read and return message
            return deserializer.ReadObject(() => MDSMessageFactory.CreateMessageByTypeId(messageTypeId));
        }
        /// <summary>
        /// Reads and constructs a MDSMessage according to the protocol rules.
        /// </summary>
        /// <param name="deserializer">Deserializer to read message</param>
        /// <returns>MDSMessage object that is read</returns>
        public MDSMessage ReadMessage(IMDSDeserializer deserializer)
        {
            //Read protocol type
            var protocolType = deserializer.ReadUInt32();

            if (protocolType != MDSDefaultProtocolType)
            {
                throw new MDSException("Wrong protocol type: " + protocolType + ".");
            }

            //Read message type
            var messageTypeId = deserializer.ReadInt32();

            //Read and return message
            return(deserializer.ReadObject(() => MDSMessageFactory.CreateMessageByTypeId(messageTypeId)));
        }
 /// <summary>
 /// Deserializes this message.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public void Deserialize(IMDSDeserializer deserializer)
 {
     Name = deserializer.ReadStringUTF8();
     CommunicatorCount = deserializer.ReadInt32();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Deserializes this message.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public void Deserialize(IMDSDeserializer deserializer)
 {
     Name = deserializer.ReadStringUTF8();
     CommunicatorCount = deserializer.ReadInt32();
     MessageCount      = deserializer.ReadInt32();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Deserializes this object.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public void Deserialize(IMDSDeserializer deserializer)
 {
     Name = deserializer.ReadStringUTF8();
     IpAddress = deserializer.ReadStringUTF8();
     Port = deserializer.ReadInt32();
     Adjacents = deserializer.ReadStringUTF8();
     Location = deserializer.ReadStringUTF8();
 }
 /// <summary>
 /// Deserializes this message.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public override void Deserialize(IMDSDeserializer deserializer)
 {
     base.Deserialize(deserializer);
     Name = deserializer.ReadStringUTF8();
     CommunicatorCount = deserializer.ReadInt32();
 }
Exemplo n.º 8
0
 public override void Deserialize(IMDSDeserializer deserializer)
 {
     base.Deserialize(deserializer);
     ControllerMessageTypeId = deserializer.ReadInt32();
     MessageData = deserializer.ReadByteArray();
 }
Exemplo n.º 9
0
 public override void Deserialize(IMDSDeserializer deserializer)
 {
     base.Deserialize(deserializer);
     ControllerMessageTypeId = deserializer.ReadInt32();
     MessageData             = deserializer.ReadByteArray();
 }
 /// <summary>
 /// Deserializes this message.
 /// </summary>
 /// <param name="deserializer">Deserializer used to deserialize objects</param>
 public override void Deserialize(IMDSDeserializer deserializer)
 {
     base.Deserialize(deserializer);
     Name = deserializer.ReadStringUTF8();
     CommunicatorCount = deserializer.ReadInt32();
 }