Beispiel #1
0
        void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
        {
            uint tag;

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

                case 10: {
                    global::ChatServer.Transmissions.ServerJoinRequest subBuilder = new global::ChatServer.Transmissions.ServerJoinRequest();
                    if (requestCase_ == RequestOneofCase.ServerJoinRequest)
                    {
                        subBuilder.MergeFrom(ServerJoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ServerJoinRequest = subBuilder;
                    break;
                }

                case 18: {
                    global::ChatServer.Transmissions.ChatJoinRequest subBuilder = new global::ChatServer.Transmissions.ChatJoinRequest();
                    if (requestCase_ == RequestOneofCase.ChatJoinRequest)
                    {
                        subBuilder.MergeFrom(ChatJoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ChatJoinRequest = subBuilder;
                    break;
                }

                case 26: {
                    global::ChatServer.Transmissions.ChatLeaveRequest subBuilder = new global::ChatServer.Transmissions.ChatLeaveRequest();
                    if (requestCase_ == RequestOneofCase.ChatLeaveRequest)
                    {
                        subBuilder.MergeFrom(ChatLeaveRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ChatLeaveRequest = subBuilder;
                    break;
                }

                case 34: {
                    global::ChatServer.Transmissions.NameChangeRequest subBuilder = new global::ChatServer.Transmissions.NameChangeRequest();
                    if (requestCase_ == RequestOneofCase.NameChangeRequest)
                    {
                        subBuilder.MergeFrom(NameChangeRequest);
                    }
                    input.ReadMessage(subBuilder);
                    NameChangeRequest = subBuilder;
                    break;
                }
                }
            }
        }
Beispiel #2
0
        public void MergeFrom(Request other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.RequestCase)
            {
            case RequestOneofCase.ServerJoinRequest:
                if (ServerJoinRequest == null)
                {
                    ServerJoinRequest = new global::ChatServer.Transmissions.ServerJoinRequest();
                }
                ServerJoinRequest.MergeFrom(other.ServerJoinRequest);
                break;

            case RequestOneofCase.ChatJoinRequest:
                if (ChatJoinRequest == null)
                {
                    ChatJoinRequest = new global::ChatServer.Transmissions.ChatJoinRequest();
                }
                ChatJoinRequest.MergeFrom(other.ChatJoinRequest);
                break;

            case RequestOneofCase.ChatLeaveRequest:
                if (ChatLeaveRequest == null)
                {
                    ChatLeaveRequest = new global::ChatServer.Transmissions.ChatLeaveRequest();
                }
                ChatLeaveRequest.MergeFrom(other.ChatLeaveRequest);
                break;

            case RequestOneofCase.NameChangeRequest:
                if (NameChangeRequest == null)
                {
                    NameChangeRequest = new global::ChatServer.Transmissions.NameChangeRequest();
                }
                NameChangeRequest.MergeFrom(other.NameChangeRequest);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Beispiel #3
0
        public void MergeFrom(pb::CodedInputStream input)
        {
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
            input.ReadRawMessage(this);
    #else
            uint tag;
            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    global::ChatServer.Transmissions.ServerJoinRequest subBuilder = new global::ChatServer.Transmissions.ServerJoinRequest();
                    if (requestCase_ == RequestOneofCase.ServerJoinRequest)
                    {
                        subBuilder.MergeFrom(ServerJoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ServerJoinRequest = subBuilder;
                    break;
                }

                case 18: {
                    global::ChatServer.Transmissions.ChatJoinRequest subBuilder = new global::ChatServer.Transmissions.ChatJoinRequest();
                    if (requestCase_ == RequestOneofCase.ChatJoinRequest)
                    {
                        subBuilder.MergeFrom(ChatJoinRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ChatJoinRequest = subBuilder;
                    break;
                }

                case 26: {
                    global::ChatServer.Transmissions.ChatLeaveRequest subBuilder = new global::ChatServer.Transmissions.ChatLeaveRequest();
                    if (requestCase_ == RequestOneofCase.ChatLeaveRequest)
                    {
                        subBuilder.MergeFrom(ChatLeaveRequest);
                    }
                    input.ReadMessage(subBuilder);
                    ChatLeaveRequest = subBuilder;
                    break;
                }

                case 34: {
                    global::ChatServer.Transmissions.NameChangeRequest subBuilder = new global::ChatServer.Transmissions.NameChangeRequest();
                    if (requestCase_ == RequestOneofCase.NameChangeRequest)
                    {
                        subBuilder.MergeFrom(NameChangeRequest);
                    }
                    input.ReadMessage(subBuilder);
                    NameChangeRequest = subBuilder;
                    break;
                }
                }
            }
    #endif
        }