当前位置: 首页>>代码示例>>C#>>正文


C# MessageReader.ReadInt32方法代码示例

本文整理汇总了C#中MessageReader.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# MessageReader.ReadInt32方法的具体用法?C# MessageReader.ReadInt32怎么用?C# MessageReader.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageReader的用法示例。


在下文中一共展示了MessageReader.ReadInt32方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadGroup

 static UnknownFieldCollection ReadGroup(MessageTag startTag, MessageReader reader)
 {
     var group = new UnknownFieldCollection();
     for(int stop = startTag.WithWireType(WireType.EndGroup), tag = reader.ReadInt32(); tag != stop; tag = reader.ReadInt32())
         group.Add(new MessageTag(tag), reader);
     return group;
 }
开发者ID:drunkcod,项目名称:ProtoSharp,代码行数:7,代码来源:UnknownFieldGroup.cs

示例2: ReadCommand

        /// <summary>
        /// Reads the <see cref="MoveVillageObjectCommand"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="MoveVillageObjectCommand"/>.
        /// </param>
        public override void ReadCommand(MessageReader reader)
        {
            MoveData = new MoveVillageObjectData();
            MoveData.X = reader.ReadInt32();
            MoveData.Y = reader.ReadInt32();
            MoveData.VillageObjectGameIndex = reader.ReadInt32();

            Unknown1 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:15,代码来源:MoveVillageObjectCommand.cs

示例3: ReadMessage

        /// <summary>
        /// Reads the <see cref="OwnHomeDataMessage"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="OwnHomeDataMessage"/>.
        /// </param>
        public override void ReadMessage(MessageReader reader)
        {
            LastVisit = TimeSpan.FromSeconds(reader.ReadInt32());
            Unknown1 = reader.ReadInt32(); // -1
            Timestamp = DateTimeConverter.FromUnixTimestamp(reader.ReadInt32());

            OwnAvatarData = new AvatarData();
            OwnAvatarData.Read(reader);
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:15,代码来源:OwnHomeDataMessage.cs

示例4: ReadCommand

        /// <summary>
        /// Reads the <see cref="ClearObstacleCommand"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="ClearObstacleCommand"/>.
        /// </param>
        public override void ReadCommand(MessageReader reader)
        {
            var gameID = reader.ReadInt32();
            if (!Obstacle.ValidGameID(gameID))
                throw new InvalidCommandException("Unexpected game ID: " + gameID, this);

            ObstacleGameIndex = Obstacle.GameIDToIndex(gameID);

            Unknown1 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:16,代码来源:ClearObstacleCommand.cs

示例5: ReadCommand

        /// <summary>
        /// Reads the <see cref="UpgradeBuildingCommand"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="UpgradeBuildingCommand"/>.
        /// </param>
        public override void ReadCommand(MessageReader reader)
        {
            var gameID = reader.ReadInt32();
            if (!Building.ValidGameID(gameID))
                throw new InvalidCommandException("Unexpected data ID: " + gameID, this);

            BuildingGameIndex = Building.GameIDToIndex(gameID);

            Unknown1 = reader.ReadByte();
            Unknown2 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:17,代码来源:UpgradeBuildingCommand.cs

示例6: ReadCommand

        /// <summary>
        /// Reads the <see cref="BuyBuildingCommand"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="BuyBuildingCommand"/>.
        /// </param>
        public override void ReadCommand(MessageReader reader)
        {
            X = reader.ReadInt32();
            Y = reader.ReadInt32();

            var dataID = reader.ReadInt32();
            if (!Building.ValidDataID(dataID))
                throw new InvalidCommandException("Unexpected data ID: " + dataID, this);

            BuildingDataIndex = Building.DataIDToIndex(dataID);

            Unknown1 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:19,代码来源:BuyBuildingCommand.cs

示例7: ReadMessage

 /// <summary>
 /// Reads the <see cref="ChatMessageServerMessage"/> from the specified <see cref="MessageReader"/>.
 /// </summary>
 /// <param name="reader">
 /// <see cref="MessageReader"/> that will be used to read the <see cref="ChatMessageServerMessage"/>.
 /// </param>
 public override void ReadMessage(MessageReader reader)
 {
     Message = reader.ReadString();
     Name = reader.ReadString();
     Level = reader.ReadInt32();
     League = reader.ReadInt32();
     UserID = reader.ReadInt64();
     CurrentUserID = reader.ReadInt64();
     
     if (reader.ReadBoolean())
     {
         Clan.ID = reader.ReadInt64();
         Clan.Name = reader.ReadString();
         Clan.Badge = reader.ReadInt32();
     }
 }
开发者ID:circa94,项目名称:CoCSharp,代码行数:22,代码来源:ChatMessageServerMessage.cs

示例8: ReadCommand

        /// <summary>
        /// Reads the <see cref="MoveVillageObjectCommand"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="MoveVillageObjectCommand"/>.
        /// </param>
        public override void ReadCommand(MessageReader reader)
        {
            var count = reader.ReadInt32();
            if (count < 0)
                throw new InvalidCommandException("Number of MovesData cannot be less than 0.", this);
            MovesData = new MoveVillageObjectData[count];
            for (int i = 0; i < count; i++)
            {
                var data = new MoveVillageObjectData();
                data.X = reader.ReadInt32();
                data.Y = reader.ReadInt32();
                data.VillageObjectGameIndex = reader.ReadInt32();

                MovesData[i] = data;
            }

            Unknown1 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:24,代码来源:MoveMultipleVillageObjectCommand.cs

示例9: ReadMessage

        /// <summary>
        /// Reads the <see cref="CommandMessage"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="CommandMessage"/>.
        /// </param>
        /// <exception cref="InvalidMessageException">Number of embedded commands is less than 0.</exception>
        public override void ReadMessage(MessageReader reader)
        {
            Subtick = reader.ReadInt32();
            Checksum = reader.ReadInt32();

            var length = reader.ReadInt32();
            if (length < 0)
                throw new InvalidMessageException("Number of embedded commands cannot be less than 0.");

            Commands = new Command[length];

            for (int i = 0; i < length; i++)
            {
                var cmd = (Command)null;
                var cmdID = reader.ReadInt32();
                if (!CommandFactory.TryCreate(cmdID, out cmd))
                    break; // just not to mess the stream up

                cmd.ReadCommand(reader);
                Commands[i] = cmd;
            }
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:29,代码来源:CommandMessage.cs

示例10: ReadMessage

 /// <summary>
 /// Reads the <see cref="NewClientEncryptionMessage"/> from the specified <see cref="MessageReader"/>.
 /// </summary>
 /// <param name="reader">
 /// <see cref="MessageReader"/> that will be used to read the <see cref="NewClientEncryptionMessage"/>.
 /// </param>
 public override void ReadMessage(MessageReader reader)
 {
     Unknown1 = reader.ReadInt32();
     Unknown2 = reader.ReadInt32();
     MajorVersion = reader.ReadInt32();
     Unknown4 = reader.ReadInt32();
     MinorVersion = reader.ReadInt32();
     Hash = reader.ReadString();
     Unknown6 = reader.ReadInt32();
     Unknown7 = reader.ReadInt32();
 }
开发者ID:circa94,项目名称:CoCSharp,代码行数:17,代码来源:NewClientEncryptionMessage.cs

示例11: ReadMessage

 /// <summary>
 /// Reads the <see cref="EncryptionMessage"/> from the specified <see cref="MessageReader"/>.
 /// </summary>
 /// <param name="reader">
 /// <see cref="MessageReader"/> that will be used to read the <see cref="EncryptionMessage"/>.
 /// </param>
 public override void ReadMessage(MessageReader reader)
 {
     ServerRandom = reader.ReadBytes();
     ScramblerVersion = reader.ReadInt32();
 }
开发者ID:circa94,项目名称:CoCSharp,代码行数:11,代码来源:EncryptionMessage.cs

示例12: ReadMessage

        /// <summary>
        /// Reads the <see cref="LoginRequestMessage"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="LoginRequestMessage"/>.
        /// </param>
        public override void ReadMessage(MessageReader reader)
        {
            SessionKey = reader.ReadBytes(CoCKeyPair.NonceLength);
            Nonce = reader.ReadBytes(CoCKeyPair.NonceLength);

            UserID = reader.ReadInt64();
            UserToken = reader.ReadString();
            ClientMajorVersion = reader.ReadInt32();
            ClientContentVersion = reader.ReadInt32();
            ClientMinorVersion = reader.ReadInt32();
            FingerprintHash = reader.ReadString();

            Unknown1 = reader.ReadString();

            OpenUDID = reader.ReadString();
            MacAddress = reader.ReadString();
            DeviceModel = reader.ReadString();
            LocaleKey = reader.ReadInt32();
            Language = reader.ReadString();
            AdvertisingGUID = reader.ReadString();
            OSVersion = reader.ReadString();

            Unknown2 = reader.ReadByte();
            Unknown3 = reader.ReadString();

            AndroidDeviceID = reader.ReadString();
            FacebookDistributionID = reader.ReadString();
            IsAdvertisingTrackingEnabled = reader.ReadBoolean();
            VendorGUID = reader.ReadString();
            Seed = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:37,代码来源:LoginRequestMessage.cs

示例13: ReadMessage

        /// <summary>
        /// Reads the <see cref="LoginSuccessMessage"/> from the specified <see cref="MessageReader"/>.
        /// </summary>
        /// <param name="reader">
        /// <see cref="MessageReader"/> that will be used to read the <see cref="LoginSuccessMessage"/>.
        /// </param>
        public override void ReadMessage(MessageReader reader)
        {
            Nonce = reader.ReadBytes(CoCKeyPair.NonceLength);
            PublicKey = reader.ReadBytes(CoCKeyPair.KeyLength);

            UserID = reader.ReadInt64();
            UserID1 = reader.ReadInt64();
            UserToken = reader.ReadString();
            FacebookID = reader.ReadString();
            GameCenterID = reader.ReadString();
            MajorVersion = reader.ReadInt32();
            MinorVersion = reader.ReadInt32();
            RevisionVersion = reader.ReadInt32();
            ServerEnvironment = reader.ReadString();
            LoginCount = reader.ReadInt32();
            PlayTime = TimeSpan.FromSeconds(reader.ReadInt32());

            Unknown1 = reader.ReadInt32();

            FacebookAppID = reader.ReadString();
            DateLastPlayed = DateTimeConverter.FromJavaTimestamp(double.Parse(reader.ReadString()));
            DateJoined = DateTimeConverter.FromJavaTimestamp(double.Parse(reader.ReadString()));

            Unknown2 = reader.ReadInt32();

            GooglePlusID = reader.ReadString();
            CountryCode = reader.ReadString();

            Unknown3 = reader.ReadInt32();
        }
开发者ID:circa94,项目名称:CoCSharp,代码行数:36,代码来源:LoginSuccessMessage.cs


注:本文中的MessageReader.ReadInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。