Skip to content

炸图修复

原理

恶意客户端修改了 怪物 不支持的方向, 但是服务端未做校验, 直接广播了

修复

java
public static final void updatePosition(final List<LifeMovementFragment> movement, final AnimatedMapleMapObject target, final int yoffset) {
    for (final LifeMovementFragment move : movement) {
        if (move instanceof LifeMovement) {
            if (move instanceof StaticLifeMovement) {
                Point position = ((StaticLifeMovement) move).getPosition();
                if (position != null) {
                    position.y += yoffset;
                    target.setPosition(position);
                }
            }
            int newstate = ((StaticLifeMovement) move).getNewstate();    
            if (target instanceof MapleMonster && newstate == 0) {       
                newstate = 2;                                            
            }                                                            
            target.setStance(newstate);                                  
            target.setStance(((StaticLifeMovement) move).getNewstate()); 
        }
    }
}