Ejemplo n.º 1
0
        public PSMovement(WorldOpcodes worldOpcode, WorldSession session, PCMoveInfo moveinfo)
            : base(worldOpcode)
        {
            var correctedMoveTime = (uint)Environment.TickCount;

            byte[] packedGUID = session.Player.ObjectGUID.GetGuidBytes();
            this.WriteBytes(packedGUID);
            this.WriteBytes((moveinfo.BaseStream as MemoryStream).ToArray());

            // We then overwrite the original moveTime (sent from the client) with ours
            (this.BaseStream as MemoryStream).Position = 4 + packedGUID.Length;
            this.WriteBytes(BitConverter.GetBytes(correctedMoveTime));
        }
Ejemplo n.º 2
0
 private void TransmitMovement(WorldSession session, PCMoveInfo handler, WorldOpcodes code)
 {
     UpdateEntity(session, handler);
     //ToList because collection can be modified while iterating.
     session.Player.SubscribedBy.ToList().ForEach(s => s.SendPacket(new PSMovement(code, session, handler)));
 }
Ejemplo n.º 3
0
 private void UpdateEntity(WorldSession session, PCMoveInfo handler)
 {
     session.Player.Location.X = handler.X;
     session.Player.Location.Y = handler.Y;
     session.Player.Location.Z = handler.Z;
 }