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


C# StreamHandler.WriteUInt64方法代码示例

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


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

示例1: Save


//.........这里部分代码省略.........

                        if (this.HaveTransportTime3)
                            Writer.WriteUInt32(this.TransportTime3);

                        Writer
                            .WriteSingle(this.TransportPosition.Y)
                            .WriteSByte(this.TransportSeat)
                            .WriteSingle(this.TransportFacing);

                        if (this.HaveTransportTime2)
                            Writer.WriteUInt32(this.TransportTime2);

                        Writer
                            .WriteXorByte(bytes[2])
                            .WriteUInt32(this.TransportTime)
                            .WriteXorByte(bytes[0]);
                    }
                }

                Writer
                    .WriteSingle(this.Speeds[7])
                    .WriteSingle(this.Position.X);

                if (this.HavePitch)
                    Writer.WriteSingle(this.Pitch);

                // Fall Data
                if (this.HaveFallData)
                {
                    Writer.WriteUInt32(this.FallTime);
                    if (this.HaveFallDirection)
                    {
                        Writer
                            .WriteSingle(this.FallSinAngle)
                            .WriteSingle(this.FallHorizontalSpeed)
                            .WriteSingle(this.FallCosAngle);
                    }
                    Writer.WriteSingle(this.FallVerticalSpeed);
                }

                Writer
                    .WriteXorByte(p_guid.Bytes[7])
                    .WriteSingle(this.Speeds[4])
                    .WriteXorByte(p_guid.Bytes[0])
                    .WriteXorByte(p_guid.Bytes[5]);

                if (this.TimeStamp != 0)
                    Writer.WriteUInt32(this.TimeStamp);

                Writer
                    .WriteSingle(this.Position.Z)
                    .WriteSingle(this.Speeds[6])
                    .WriteXorByte(p_guid.Bytes[1])
                    .WriteSingle(this.Speeds[2])
                    .WriteSingle(this.Speeds[5])
                    .WriteSingle(this.Speeds[3])
                    .WriteSingle(this.Speeds[0])
                    .WriteXorByte(p_guid.Bytes[3])
                    .WriteXorByte(p_guid.Bytes[4])
                    .WriteXorByte(p_guid.Bytes[2])
                    .WriteXorByte(p_guid.Bytes[6]);

                if (this.HaveSplineElevation)
                    Writer.WriteSingle(this.SplineElevation);

                Writer.WriteSingle(this.Position.Y);
                if (this.Orientation != 0.0f)
                    Writer.WriteSingle(this.Orientation);
                Writer.WriteSingle(this.Speeds[1]);
            }

            // floats here

            // transport time
            if (this.HaveTransportTime)
                Writer.WriteUInt32(this.TransportTime);

            // shorts here

            // go rotation?
            if (this.HaveGameObjectRotation)
                Writer.WriteUInt64(this.GameObjectRotation.Pack());

            // target guid?
            if (this.HaveAttackingTarget)
            {
                fixed (byte* bytes = this.AttackingTarget.Bytes)
                {
                    Writer
                        .WriteXorByte(bytes[3])
                        .WriteXorByte(bytes[5])
                        .WriteXorByte(bytes[0])
                        .WriteXorByte(bytes[7])
                        .WriteXorByte(bytes[2])
                        .WriteXorByte(bytes[4])
                        .WriteXorByte(bytes[6])
                        .WriteXorByte(bytes[1]);
                }
            }
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:101,代码来源:MovementInfo.cs


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