You moved too fast :( (Hacking?) despite allow-flight=true

Discussion in 'Bukkit Help' started by petrifiednightmares, Aug 29, 2011.

Thread Status:
Not open for further replies.
  1. I am running a bukkit 1060 server with a ton of plugins. One of the plugins that I wrote allows the user to be catapulted high into the sky at amazing speeds. I did allow-flight=true to prevent the user from getting kicked when this happens.

    For a long time, this was fine, but recently I started getting the You moved too fast message again.

    Specs:


    Bukkit:
    Code:
    01:38:56 [INFO] Starting minecraft server version Beta 1.7.3
    01:38:56 [INFO] Loading properties
    01:38:56 [INFO] Starting Minecraft server on *:25565
    01:38:56 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-980-
    g4ed23b1-b1060jnks (MC: 1.7.3)
    Java:
    Code:
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
    Recently Installed Plugins:
    Server jars:

    Code:
    PermissionsBukkit-1.2.jar
    spoutEssentials.jar
    NarrowtuxLib.jar
    Shortcuts.jar
    Spout.jar
    HealthBar.jar
    Client side:
    Code:
    SpoutCraft
     
  2. Offline

    Lunar Delta

    Using Spout + Spoutcraft seems to quadruple the sensitivity of the speed check. I can't even slap or rocket people anymore.
     
  3. The interesting thing is, my friend can catapult, but not me. We are both ops and have all permissions. hmmm
     
  4. Offline

    Lunar Delta

    I can rocket people who don't use Spoutcraft, but not people who do.
     
    petrifiednightmares likes this.
  5. Offline

    Supersam654

    I took this block of code directly out of @Shamebot 's Rocket plguin's Github. Rocket lets you fling people far into the air (with an awesome smoke trail) and was also having problems with people getting kicked by it. So here is the exact code that he used:
    Code:
             @Override
             public void onPlayerKick(PlayerKickEvent e)  {
                 if(e.getReason().startsWith("You moved too") || e.getReason().startsWith("Flying is not")) {
                     Rocketeer rocketeer = getRocketeer(e.getPlayer());
                     if(rocketeer != null) {
                         e.setCancelled(true);
                     }
                 }
             }
     
    petrifiednightmares likes this.
  6. Offline

    Shamebot

    @Supersam654
    Code:
    private Logger log = Logger.getLogger("Minecraft");
    log.setFilter(new Filter()
            {
             public boolean isLoggable(LogRecord record) {
             if(record.getMessage() != null)
             {
             if(record.getMessage().endsWith("was kicked for floating too long!"))
             {
             return false;
             }
             }
             return true;
    }
    
            });
    Will remove the console spam resulting from cancelling the event. There might have been a change to craftbukkit which makes the above code not necassary, not sure.
     
  7. I tried this code, but for some reason it's still kicking me.

    To test that the code is actually getting run, I put in some printlns:

    Code:
        public void onPlayerKick(PlayerKickEvent e)
        {
            System.out.println(e.getReason());
            if (e.getReason().startsWith("You moved too") || e.getReason().startsWith("Flying is not"))
            {
                System.out.println("cancel");
                e.setCancelled(true);
            }
        }
    
    Both printlns are being printed, but I still get kicked. Any ideas?
     
  8. Offline

    Shamebot

    @petrifiednightmares Are you using a plugin which might uncancel the event? Register a listener with priority monitor and log whether the event is still cancelled.
     
  9. I bound a listener with Monitor priority to check if it is still canceled.

    It is saying true, yet I still get kicked:

    Code:
    14:43:24 [WARNING] razorstorm2 moved too quickly!
    14:43:24 [INFO] You moved too quickly :( (Hacking?)
    14:43:24 [INFO] cancel
    14:43:24 [INFO] You moved too quickly :( (Hacking?)
    14:43:24 [INFO] Is canceled? true
    14:43:24 [INFO] razorstorm2 lost connection: disconnect.endOfStream
    
     
  10. Offline

    Shamebot

    @SpoutDev As far as I can tell makes this code (SpoutNetServerHandler):
    Code:java
    1.  
    2. @Override
    3. public void disconnect(String kick) {
    4. this.sendPacket(new Packet255KickDisconnect(kick));
    5. syncFlushPacketQueue();
    6. super.disconnect(kick);
    7. }
    8.  

    , in combination with this (NetServerHandler):
    Code:java
    1.  
    2. if (d8 > 100.0D * (elapsedTicks <= 0 ? 1 : elapsedTicks) && this.checkMovement) {
    3. a.warning(this.player.name + " moved too quickly! Elapsed ticks: " + (elapsedTicks == 0 ? 1 : elapsedTicks) + ", Distance change: " + d8);
    4. this.disconnect("You moved too quickly :( (Hacking?)");
    5. return;
    6. }
    7.  

    , cancelling the player kick event useless (in case of "You moved too quickly").
     
  11. Hmm, so for now there's no other way against it? Whats the checkMovement variable? Is there a way to tell it to be false?
     
  12. Offline

    Shamebot

    Yes, using reflection. I searched the file for a setter, but didn't find one.
    Code:java
    1. private void setCheckMovement(Player player)
    2. {
    3. Field check = NetServerHandler.class.getDeclaredField("checkMovement");
    4. check.setAccessible(true);
    5. check.set(((CraftPlayer)player).getHandle().netServerHandler, false);
    6. }

    But that may result in problems, as the variable is used in other places.
     
  13. I feel like this is more than simply moving too quickly. I got kicked with the same message after jumping above height 127
     
Thread Status:
Not open for further replies.

Share This Page