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


C# BitReader.ReadUInt32Max方法代码示例

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


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

示例1: Deserialize

 public static ClientLoadoutOnlineThing Deserialize(BitReader br)
 {
     var clot = new ClientLoadoutOnlineThing(); // ha, "clot"
     clot.Unknown1 = br.ReadUInt32();
     clot.Unknown2 = br.ReadUInt32Max(MAX_UNKNOWN2);
     return clot;
 }
开发者ID:jjbott,项目名称:RocketLeagueReplayParser,代码行数:7,代码来源:ClientLoadoutOnlineThing.cs

示例2: Deserialize

        public static ActorStateProperty Deserialize(IClassNetCache classMap, string typeName, string[] objectIndexToName, UInt32 versionMajor, UInt32 versionMinor, BitReader br)
        {
            var asp = new ActorStateProperty();

            var maxPropId = classMap.MaxPropertyId;

            var className = objectIndexToName[classMap.ObjectIndex];
            asp.PropertyId = br.ReadUInt32Max(maxPropId + 1);
            #if DEBUG
            asp.MaxPropertyId = (UInt32)maxPropId;
            #endif
            asp.PropertyName = objectIndexToName[classMap.GetProperty((int)asp.PropertyId).Index];

            var startPosition = br.Position;

            asp.Data = new List<object>();

            switch (asp.PropertyName)
            {
                case "TAGame.GameEvent_TA:ReplicatedStateIndex":
                    asp.Data.Add(br.ReadUInt32Max(140)); // number is made up, I dont know the max yet // TODO: Revisit this. It might work well enough, but looks fishy
                    asp.MarkComplete();
                    break;
                case "TAGame.RBActor_TA:ReplicatedRBState":
                    asp.Data.Add(RigidBodyState.Deserialize(br));
                    asp.MarkComplete();
                    break;
                case "TAGame.CrowdActor_TA:ReplicatedOneShotSound":
                case "TAGame.CrowdManager_TA:ReplicatedGlobalOneShotSound":
                case "Engine.GameReplicationInfo:GameClass":
                case "TAGame.CrowdManager_TA:GameEvent":
                case "TAGame.CrowdActor_TA:GameEvent":
                case "TAGame.Team_TA:LogoData":
                case "TAGame.CameraSettingsActor_TA:PRI":
                case "TAGame.PRI_TA:PersistentCamera":
                case "TAGame.GameEvent_TA:MatchTypeClass":
                case "TAGame.GameEvent_Soccar_TA:SubRulesArchetype":
                    // Theres a good chance that most of these can be moved to the next section
                    asp.Data.Add(br.ReadBit());
                    asp.Data.Add(br.ReadUInt32());
                    asp.MarkComplete();
                    break;
                case "TAGame.Team_TA:GameEvent":
                case "TAGame.Ball_TA:GameEvent":
                case "Engine.PlayerReplicationInfo:Team":
                case "Engine.Pawn:PlayerReplicationInfo":
                case "TAGame.PRI_TA:ReplicatedGameEvent":
                case "TAGame.CarComponent_TA:Vehicle":
                case "TAGame.Car_TA:AttachedPickup":
                case "TAGame.SpecialPickup_Targeted_TA:Targeted":
                    // TODO: Use a real class so it can be accessed normally.
                    // If Active == false, ActorId will be -1
                    asp.Data.Add(ActiveActor.Deserialize(br));
                    asp.MarkComplete();
                    break;
                case "Engine.GameReplicationInfo:ServerName":
                case "Engine.PlayerReplicationInfo:PlayerName":
                case "TAGame.Team_TA:CustomTeamName":
                case "Engine.PlayerReplicationInfo:RemoteUserData":
                case "TAGame.GRI_TA:NewDedicatedServerIP":
                    asp.Data.Add(br.ReadString());
                    asp.MarkComplete();
                    break;
                case "TAGame.GameEvent_Soccar_TA:SecondsRemaining":
                case "TAGame.GameEvent_TA:ReplicatedGameStateTimeRemaining":
                case "TAGame.CrowdActor_TA:ReplicatedCountDownNumber":
                case "TAGame.GameEvent_Team_TA:MaxTeamSize":
                case "Engine.PlayerReplicationInfo:PlayerID":
                case "TAGame.PRI_TA:TotalXP":
                case "TAGame.PRI_TA:MatchScore":
                case "TAGame.GameEvent_Soccar_TA:RoundNum":
                case "TAGame.GameEvent_TA:BotSkill":
                case "TAGame.PRI_TA:MatchShots":
                case "TAGame.PRI_TA:MatchSaves":
                case "ProjectX.GRI_X:ReplicatedGamePlaylist":
                case "Engine.TeamInfo:Score":
                case "Engine.PlayerReplicationInfo:Score":
                case "TAGame.PRI_TA:MatchGoals":
                case "TAGame.PRI_TA:MatchAssists":
                case "ProjectX.GRI_X:ReplicatedGameMutatorIndex":
                case "TAGame.PRI_TA:Title":
                case "TAGame.GameEvent_TA:ReplicatedStateName":
                case "TAGame.Team_Soccar_TA:GameScore":
                case "TAGame.GameEvent_Soccar_TA:GameTime":
                case "TAGame.CarComponent_Boost_TA:UnlimitedBoostRefCount":
                case "TAGame.CrowdActor_TA:ReplicatedRoundCountDownNumber":
                    asp.Data.Add(br.ReadUInt32());
                    asp.MarkComplete();
                    break;
                case "TAGame.VehiclePickup_TA:ReplicatedPickupData":
                    asp.Data.Add(br.ReadBit());
                    asp.Data.Add(br.ReadUInt32());
                    asp.Data.Add(br.ReadBit());

                    asp.MarkComplete();
                    break;
                case "Engine.PlayerReplicationInfo:Ping":
                case "TAGame.Vehicle_TA:ReplicatedSteer":
                case "TAGame.Vehicle_TA:ReplicatedThrottle": // 0: full reverse, 128: No throttle.  255 full throttle/boosting
                case "TAGame.PRI_TA:CameraYaw":
//.........这里部分代码省略.........
开发者ID:jjbott,项目名称:RocketLeagueReplayParser,代码行数:101,代码来源:ActorStateProperty.cs

示例3: Deserialize

        public static ActorState Deserialize(int maxChannels, List<ActorState> existingActorStates, List<ActorState> frameActorStates, string[] objectIndexToName, IDictionary<string, ClassNetCache> classNetCacheByName, UInt32 versionMajor, UInt32 versionMinor, BitReader br)
        {
            var startPosition = br.Position;
            ActorState a = new ActorState();

            try
            {
                var actorId = br.ReadUInt32Max(maxChannels);

                a.Id = actorId;

                if (br.ReadBit())
                {
                    if (br.ReadBit())
                    {
                        a.State = ActorStateState.New;

                        if (versionMajor > 868 || (versionMajor == 868 && versionMinor >= 14))
                        {
                            a.NameId = br.ReadUInt32();
                        }

                        a.Unknown1 = br.ReadBit();
                        a.TypeId = br.ReadUInt32();

                        a.TypeName = objectIndexToName[(int)a.TypeId.Value];
                        a._classNetCache = ObjectNameToClassNetCache(a.TypeName, classNetCacheByName);
                        a.ClassName = objectIndexToName[a._classNetCache.ObjectIndex];

                        if ( !ClassHasInitialPosition(a.ClassName))
                        {
            #if DEBUG
                            a.KnownBits = br.GetBits(startPosition, br.Position - startPosition);
                            a.Complete = true;
            #endif
                            return a;
                        }

                        a.Position = Vector3D.Deserialize(br);

                        if (ClassHasRotation(a.ClassName))
                        {
                            a.Rotation = Rotator.Deserialize(br);
                        }
            #if DEBUG
                        a.Complete = true;
            #endif
                    }
                    else
                    {
                        a.State = ActorStateState.Existing;
                        var oldState = existingActorStates.Where(x => x.Id == a.Id).Single();

                        a.TypeId = oldState.TypeId;

                        a.Properties = new List<ActorStateProperty>();
                        ActorStateProperty lastProp = null;
                        while (br.ReadBit())
                        {
                            lastProp = ActorStateProperty.Deserialize(oldState._classNetCache, oldState.TypeName, objectIndexToName, versionMajor, versionMinor, br);
                            a.Properties.Add(lastProp);

            #if DEBUG
                            if (!lastProp.IsComplete)
                            {
                                break;
                            }
            #endif
                        }

            #if DEBUG
                        a.Complete = lastProp.IsComplete;
                        if (lastProp.Data.Count > 0 && lastProp.Data.Last().ToString() == "FAILED")
                        {
                            a.Failed = true;
                        }
            #endif
                        var endPosition = br.Position;
                    }
                }
                else
                {
                    a.State = ActorStateState.Deleted;

                    var actor = existingActorStates.Where(x => x.Id == a.Id).SingleOrDefault();
            #if DEBUG
                    a.Complete = true;
            #endif
                    var endPosition = br.Position;
                }
            #if DEBUG
                if (!a.Complete)
                {
                    // Read a bunch of data so we have something to look at in the logs
                    // Otherwise the logs may not show any data bits for whatever is broken, which is hard to interpret
                    br.ReadBytes(16);
                }

                a.KnownBits = br.GetBits(startPosition, br.Position - startPosition);
            #endif
//.........这里部分代码省略.........
开发者ID:jjbott,项目名称:RocketLeagueReplayParser,代码行数:101,代码来源:ActorState.cs


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