Exemplo n.º 1
0
        public void HandleCursor(ByteReader data)
        {
            if (Player.lastCursorTick == Server.net.NetTimer)
            {
                return;
            }

            var writer = new ByteWriter();

            byte seq = data.ReadByte();
            byte map = data.ReadByte();

            writer.WriteInt32(Player.id);
            writer.WriteByte(seq);
            writer.WriteByte(map);

            if (map < byte.MaxValue)
            {
                byte  icon = data.ReadByte();
                short x    = data.ReadShort();
                short z    = data.ReadShort();

                writer.WriteByte(icon);
                writer.WriteShort(x);
                writer.WriteShort(z);

                short dragX = data.ReadShort();
                writer.WriteShort(dragX);

                if (dragX != -1)
                {
                    short dragZ = data.ReadShort();
                    writer.WriteShort(dragZ);
                }
            }

            Player.lastCursorTick = Server.net.NetTimer;

            Server.SendToAll(Packets.Server_Cursor, writer.ToArray(), reliable: false, excluding: Player);
        }
Exemplo n.º 2
0
        public void HandleCursor(ByteReader data)
        {
            var writer = new ByteWriter();

            byte seq = data.ReadByte();
            byte map = data.ReadByte();

            writer.WriteInt32(Player.id);
            writer.WriteByte(seq);
            writer.WriteByte(map);

            if (map < byte.MaxValue)
            {
                byte  icon = data.ReadByte();
                short x    = data.ReadShort();
                short z    = data.ReadShort();

                writer.WriteByte(icon);
                writer.WriteShort(x);
                writer.WriteShort(z);
            }

            Server.SendToAll(Packets.Server_Cursor, writer.GetArray(), reliable: false);
        }