CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Delay packets sent from server to client (S packets)

    ScriptAPI
    3
    8
    332
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • yorik100
      yorik100 last edited by

      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

      1 Reply Last reply Reply Quote 1
      • C
        commandblock2 last edited by

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

        yorik100 1 Reply Last reply Reply Quote 0
        • yorik100
          yorik100 @commandblock2 last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • C
            commandblock2 last edited by commandblock2

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

            yorik100 1 Reply Last reply Reply Quote 0
            • yorik100
              yorik100 @commandblock2 last edited by

              @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) ?

              1 Reply Last reply Reply Quote 0
              • C
                commandblock2 last edited by commandblock2

                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 *

                1 Reply Last reply Reply Quote 0
                • CzechHek
                  CzechHek last edited by CzechHek

                  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()));
                      }
                  }
                  
                  yorik100 1 Reply Last reply Reply Quote 0
                  • yorik100
                    yorik100 @CzechHek last edited by yorik100

                    @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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    About
                    • Terms of Service
                    • Privacy Policy
                    • Status
                    • Contact Us
                    Downloads
                    • Releases
                    • Source code
                    • License
                    Docs
                    • Tutorials
                    • CustomHUD
                    • AutoSettings
                    • ScriptAPI
                    Community
                    • Forum
                    • Guilded
                    • YouTube
                    • Twitter
                    • D.Tube