Delay packets sent from server to client (S packets)



  • I need help because I know how to save them but I don't know how to play them back, example :
    I want to delay S08s, ignorants will probably say just cancel and when you want to execute back the packet use setPos but if I cancel S08 on world change then world doesn't load, I would also need to do delay velocity packets AND NO, CANCELING THEM AND SETTING MOTION TO THE VELOCITY IS NOT A FIX BECAUSE VELOCITY PACKETS SEND INCREDIBLY HIGH NUMBERS FOR SOME REASONS, THINK TWICE BEFORE TELLING ME SOMETHING I ALREADY THOUGHT OF



  • cancel the event then use net.minecraft.client.network.NetHandlerPlayClient#handlePlayerPosLook instead of setPos? Haven't tried(could possibly have some threading issues?).



  • @commandblock2 said in Delay packets sent from server to client (S packets):

    cancel the event then use net.minecraft.client.network.NetHandlerPlayClient#handlePlayerPosLook instead of setPos? Haven't tried(could possibly have some threading issues?).

    I need an universal fix that works with every packets sent by the server to the client



  • spacket.processPacket(mc.thePlayer.sendQueue)? (Still haven't tried)



  • @commandblock2 said in Delay packets sent from server to client (S packets):

    spacket.processPacket(mc.thePlayer.sendQueue)? (Still haven't tried)

    So I do spacket.processPacket(packet) ?



  • HashMap = Java.type("java.util.HashMap")
    
    packets2Timer = new HashMap()
    
    function idk(packetEvent) {
        packet = packetEvent.getPacket()
    
        if (packet.class.getName().startsWith("net.minecraft.network.play.server")) {
            packetEvent.cancelEvent()
            nt = new MSTimer()
            nt.reset()
            packets2Timer.put(packet, nt)
        }
    }
    
    function wtf() {
        deleteList = []
        packets2Timer.forEach(function (elem) {
            if (packets2Timer[elem].hasTimePassed(1000)) {
                elem.processPacket(mc.thePlayer.sendQueue)
                deleteList.push(elem)
            }
        })
    
        deleteList.forEach(function (elem) {
            packets2Timer.remove(elem)
        })
    }
    

    Something like that, however, It seemed that ConcurrentModificationException may happen from time to time, and also some clients packets was false recognized as server one (idk why that would happen and that doesn't make any sense). idk was onPacket and wtf was onUpdate.
    The delay in code is 1000 *



  • Can be simplified to:
    it's simplier and more accurate to use Timer and delay a function instead of checking if timer for every packet has passed a time every 50 ms

    ///api_version=2
    (script = registerScript({
        name: "YetAnotherPingSpoof",
        authors: ["CzechHek", "commandblock2"],
        version: "1.0"
    })).import("Core.lib");
    
    module = {
        category: "Misc",
        description: "Delays server packets.",
        values: ping = value.createInteger("Ping", 1000, 0, 5000),
        onPacket: function (e) {
            if (e.getPacket().class.simpleName.startsWith("S"))
                e.cancelEvent(),
                timeout(ping.get(), function () e.getPacket().processPacket(mc.getNetHandler()));
        }
    }
    


  • @CzechHek
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException
    [22:00:14] [setTimeout/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:-1]: net.minecraft.network.ThreadQuickExitException


Log in to reply