예제 #1
0
파일: MotionItem.cs 프로젝트: ziang4891/ACE
 public MotionItem(MotionItem motionItem)
 {
     // copy constructor
     WorldObject          = motionItem.WorldObject;
     MotionCommand        = motionItem.MotionCommand;
     PackedSequence       = motionItem.PackedSequence;
     ServerActionSequence = motionItem.ServerActionSequence;
     IsAutonomous         = motionItem.IsAutonomous;
     Speed = motionItem.Speed;
 }
예제 #2
0
파일: MotionItem.cs 프로젝트: Yonneh0/ACE
        public static void Write(this BinaryWriter writer, MotionItem mc)
        {
            var sequence = mc.WorldObject.Sequences;

            writer.Write((ushort)mc.MotionCommand);      // verified

            // should already be masked with 0x7FFF
            var nextSequence = sequence.GetNextSequence(SequenceType.Motion);

            if (mc.IsAutonomous)
            {
                nextSequence[1] |= 0x80;    // if client-initiated motion, set upper bit
            }
            writer.Write(nextSequence);

            writer.Write(mc.Speed);
        }