Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forced movement update block not working #21

Open
lare96 opened this issue Jul 11, 2016 · 2 comments
Open

Forced movement update block not working #21

lare96 opened this issue Jul 11, 2016 · 2 comments
Labels
hard An issue that is hard to resolve. high priority An issue that should be resolved right away.
Milestone

Comments

@lare96
Copy link
Member

lare96 commented Jul 11, 2016

Not exactly sure what's wrong with it, when I test it nothing happens. Will have to look into it more

@lare96 lare96 added the medium priority An issue that can be resolved whenever, but is guaranteed to be completed. label Jul 11, 2016
@lare96 lare96 added low priority An issue that can be resolved whenever. Low priority issues may not be completed. and removed medium priority An issue that can be resolved whenever, but is guaranteed to be completed. labels Jul 18, 2017
@lare96 lare96 added the hard An issue that is hard to resolve. label Nov 4, 2018
@lare96 lare96 added this to the v1.0 milestone Nov 9, 2018
@lare96 lare96 added high priority An issue that should be resolved right away. and removed low priority An issue that can be resolved whenever. Low priority issues may not be completed. labels Nov 22, 2018
@lare96
Copy link
Member Author

lare96 commented Nov 22, 2018

This is needed for proper agility, so moving it to high priority.

@lare96 lare96 modified the milestones: v1.0, v0.5 Mar 2, 2019
@notjuanortiz
Copy link
Contributor

notjuanortiz commented Jun 29, 2021

I could be wrong but it looks like there's a type mismatch on the server/client. I suspect that this is the root cause of the issue.

Luna via ForcedMovementUpdateBlock.java

    @Override
    public void encodeForPlayer(Player player, ByteMessage msg) {
        ForcedMovement movement = unwrap(player.getForcedMovement());
        msg.put(movement.getStartPosition().getX(), ValueType.ADD);
        msg.put(movement.getStartPosition().getY(), ValueType.NEGATE);
        msg.put(movement.getEndPosition().getX(), ValueType.SUBTRACT);
        msg.put(movement.getEndPosition().getY());
        msg.putShort(movement.getDurationX());
        msg.putShort(movement.getDurationY(), ValueType.ADD);
        msg.put(movement.getDirection().getId());
    }

Luna-client via Client.java

private void updatePlayer(final Buffer stream, final int updateType, final Player player, final int playerId) {
        if ((updateType & 0x400) != 0) {
            player.startX = stream.getUnsignedByteS();
            player.startY = stream.getUnsignedByteS();
            player.endX = stream.getUnsignedByteS();
            player.endY = stream.getUnsignedByteS();
            player.tickStart = stream.getUnsignedShortA() + tick;
            player.tickEnd = stream.getUnsignedLEShortA() + tick;
            player.direction = stream.getUnsignedByteS();
            player.resetPath();
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hard An issue that is hard to resolve. high priority An issue that should be resolved right away.
Projects
None yet
Development

No branches or pull requests

2 participants