コード例 #1
0
ファイル: PacketHeader.cs プロジェクト: hyz3203/AcFunDanmaku
 public void MergeFrom(PacketHeader other)
 {
     if (other == null)
     {
         return;
     }
     if (other.AppId != 0)
     {
         AppId = other.AppId;
     }
     if (other.Uid != 0L)
     {
         Uid = other.Uid;
     }
     if (other.InstanceId != 0L)
     {
         InstanceId = other.InstanceId;
     }
     if (other.Flags != 0)
     {
         Flags = other.Flags;
     }
     if (other.EncodingType != global::AcFunDanmu.PacketHeader.Types.EncodingType.KEncodingNone)
     {
         EncodingType = other.EncodingType;
     }
     if (other.DecodedPayloadLen != 0)
     {
         DecodedPayloadLen = other.DecodedPayloadLen;
     }
     if (other.EncryptionMode != global::AcFunDanmu.PacketHeader.Types.EncryptionMode.KEncryptionNone)
     {
         EncryptionMode = other.EncryptionMode;
     }
     if (other.tokenInfo_ != null)
     {
         if (tokenInfo_ == null)
         {
             TokenInfo = new global::AcFunDanmu.TokenInfo();
         }
         TokenInfo.MergeFrom(other.TokenInfo);
     }
     if (other.SeqId != 0L)
     {
         SeqId = other.SeqId;
     }
     features_.Add(other.features_);
     if (other.Kpn.Length != 0)
     {
         Kpn = other.Kpn;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
コード例 #2
0
ファイル: PacketHeader.cs プロジェクト: hyz3203/AcFunDanmaku
        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: {
                    AppId = input.ReadInt32();
                    break;
                }

                case 16: {
                    Uid = input.ReadInt64();
                    break;
                }

                case 24: {
                    InstanceId = input.ReadInt64();
                    break;
                }

                case 40: {
                    Flags = input.ReadUInt32();
                    break;
                }

                case 48: {
                    EncodingType = (global::AcFunDanmu.PacketHeader.Types.EncodingType)input.ReadEnum();
                    break;
                }

                case 56: {
                    DecodedPayloadLen = input.ReadUInt32();
                    break;
                }

                case 64: {
                    EncryptionMode = (global::AcFunDanmu.PacketHeader.Types.EncryptionMode)input.ReadEnum();
                    break;
                }

                case 74: {
                    if (tokenInfo_ == null)
                    {
                        TokenInfo = new global::AcFunDanmu.TokenInfo();
                    }
                    input.ReadMessage(TokenInfo);
                    break;
                }

                case 80: {
                    SeqId = input.ReadInt64();
                    break;
                }

                case 90:
                case 88: {
                    features_.AddEntriesFrom(input, _repeated_features_codec);
                    break;
                }

                case 98: {
                    Kpn = input.ReadString();
                    break;
                }
                }
            }
        }