コード例 #1
0
        public override Task <GlobalResponse> SaveAccount(AccountProto request, ServerCallContext context)
        {
            var item   = _mapper.Map <Account>(request);
            var result = _accountRepository.SaveAccount(item);

            return(Task.FromResult(new GlobalResponse {
                Result = result
            }));
        }
コード例 #2
0
        /// <summary>Takes the remaining content of the stream and deserialze it into the instance.</summary>
        public static AccountProto.CAAuthAccountC Deserialize(Stream stream, AccountProto.CAAuthAccountC instance)
        {
            while (true)
            {
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    break;
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Platform = (AccountProto.AccountPlatform)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 2 LengthDelimited
                    case 18:
                        instance.Name = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 3 Varint
                    case 24:
                        instance.Uin = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 4 LengthDelimited
                    case 34:
                        instance.PasswdMd5 = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 5 Varint
                    case 40:
                        instance.Cpid = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 6 Varint
                    case 48:
                        instance.Appid = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 7 LengthDelimited
                    case 58:
                        instance.Sid = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #3
0
        /// <summary>Takes the remaining content of the stream and deserialze it into the instance.</summary>
        public static AccountProto.CARegAccountC Deserialize(Stream stream, AccountProto.CARegAccountC instance)
        {
            while (true)
            {
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    break;
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 LengthDelimited
                    case 10:
                        instance.Name = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 2 LengthDelimited
                    case 18:
                        instance.PasswdMd5 = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 3 LengthDelimited
                    case 26:
                        instance.Mail = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 4 LengthDelimited
                    case 34:
                        instance.Mobile = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #4
0
 /// <summary>Helper: put the buffer into a MemoryStream before deserializing</summary>
 public static AccountProto.CARegAccountC Deserialize(byte[] buffer, AccountProto.CARegAccountC instance)
 {
     using (var ms = new MemoryStream(buffer))
         Deserialize(ms, instance);
     return instance;
 }
コード例 #5
0
        /// <summary>Read the VarInt length prefix and the given number of bytes from the stream and deserialze it into the instance.</summary>
        public static AccountProto.CANewAccountS DeserializeLengthDelimited(Stream stream, AccountProto.CANewAccountS instance)
        {
            long limit = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
            limit += stream.Position;
            while (true)
            {
                if (stream.Position >= limit)
                {
                    if (stream.Position == limit)
                        break;
                    else
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Read past max limit");
                }
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    throw new System.IO.EndOfStreamException();
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Result = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 2 Varint
                    case 16:
                        instance.Uin = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 3 LengthDelimited
                    case 26:
                        instance.PasswdMd5 = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #6
0
        /// <summary>Takes the remaining content of the stream and deserialze it into the instance.</summary>
        public static AccountProto.GAVerifyBuyS Deserialize(Stream stream, AccountProto.GAVerifyBuyS instance)
        {
            while (true)
            {
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    break;
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Result = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 2 Varint
                    case 16:
                        instance.Uin = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 3 LengthDelimited
                    case 26:
                        instance.Itemid = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                    // Field 4 LengthDelimited
                    case 34:
                        instance.Receipt = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadString(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #7
0
 /// <summary>Helper: put the buffer into a MemoryStream before deserializing</summary>
 public static AccountProto.GAVerifyBuyS Deserialize(byte[] buffer, AccountProto.GAVerifyBuyS instance)
 {
     using (var ms = new MemoryStream(buffer))
         Deserialize(ms, instance);
     return instance;
 }
コード例 #8
0
        /// <summary>Read the given number of bytes from the stream and deserialze it into the instance.</summary>
        public static AccountProto.GAReportStatusC DeserializeLength(Stream stream, int length, AccountProto.GAReportStatusC instance)
        {
            long limit = stream.Position + length;
            while (true)
            {
                if (stream.Position >= limit)
                {
                    if (stream.Position == limit)
                        break;
                    else
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Read past max limit");
                }
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    throw new System.IO.EndOfStreamException();
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Nconn = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 2 Varint
                    case 16:
                        instance.Nlogin = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 3 Varint
                    case 24:
                        instance.Servertime = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt32(stream);
                        continue;
                    // Field 4 Varint
                    case 32:
                        instance.Memory = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 5 Varint
                    case 40:
                        instance.Cpu = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #9
0
        /// <summary>Takes the remaining content of the stream and deserialze it into the instance.</summary>
        public static AccountProto.CSReservedMsg Deserialize(Stream stream, AccountProto.CSReservedMsg instance)
        {
            while (true)
            {
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    break;
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Reserved = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }
コード例 #10
0
        /// <summary>Read the given number of bytes from the stream and deserialze it into the instance.</summary>
        public static AccountProto.CAServerListS DeserializeLength(Stream stream, int length, AccountProto.CAServerListS instance)
        {
            if (instance.DescArray == null)
                instance.DescArray = new List<AccountProto.CAServerDesc>();
            long limit = stream.Position + length;
            while (true)
            {
                if (stream.Position >= limit)
                {
                    if (stream.Position == limit)
                        break;
                    else
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Read past max limit");
                }
                int keyByte = stream.ReadByte();
                if (keyByte == -1)
                    throw new System.IO.EndOfStreamException();
                // Optimized reading of known fields with field ID < 16
                switch (keyByte)
                {
                    // Field 1 Varint
                    case 8:
                        instance.Version = (int)global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadUInt64(stream);
                        continue;
                    // Field 2 LengthDelimited
                    case 18:
                        // repeated
                        instance.DescArray.Add(AccountProto.CAServerDesc.DeserializeLengthDelimited(stream));
                        continue;
                }

                var key = global::SilentOrbit.ProtocolBuffers.ProtocolParser.ReadKey((byte)keyByte, stream);

                // Reading field ID > 16 and unknown field ID/wire type combinations
                switch (key.Field)
                {
                    case 0:
                        throw new global::SilentOrbit.ProtocolBuffers.ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    default:
                        global::SilentOrbit.ProtocolBuffers.ProtocolParser.SkipKey(stream, key);
                        break;
                }
            }

            return instance;
        }