Exemplo n.º 1
0
 public void MergeFrom(StreamConfig other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Protocol != 0)
     {
         Protocol = other.Protocol;
     }
     if (other.ProtocolName.Length != 0)
     {
         ProtocolName = other.ProtocolName;
     }
     transportSettings_.Add(other.transportSettings_);
     if (other.SecurityType.Length != 0)
     {
         SecurityType = other.SecurityType;
     }
     securitySettings_.Add(other.securitySettings_);
     if (other.socketSettings_ != null)
     {
         if (socketSettings_ == null)
         {
             socketSettings_ = new global::V2Ray.Core.Transport.Internet.SocketConfig();
         }
         SocketSettings.MergeFrom(other.SocketSettings);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemplo n.º 2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 8: {
                    protocol_ = (global::V2Ray.Core.Transport.Internet.TransportProtocol)input.ReadEnum();
                    break;
                }

                case 18: {
                    transportSettings_.AddEntriesFrom(input, _repeated_transportSettings_codec);
                    break;
                }

                case 26: {
                    SecurityType = input.ReadString();
                    break;
                }

                case 34: {
                    securitySettings_.AddEntriesFrom(input, _repeated_securitySettings_codec);
                    break;
                }

                case 42: {
                    ProtocolName = input.ReadString();
                    break;
                }

                case 50: {
                    if (socketSettings_ == null)
                    {
                        socketSettings_ = new global::V2Ray.Core.Transport.Internet.SocketConfig();
                    }
                    input.ReadMessage(socketSettings_);
                    break;
                }
                }
            }
        }