Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. Delay packets sent from server to client (S packets)

Delay packets sent from server to client (S packets)

Scheduled Pinned Locked Moved ScriptAPI
8 Posts 3 Posters 1.1k Views
  • 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.
  • yorik100Y Offline
    yorik100Y Offline
    yorik100
    wrote on last edited by
    #1

    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
    1
    • C Offline
      C Offline
      commandblock2
      wrote on last edited by
      #2

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

      yorik100Y 1 Reply Last reply
      0
      • C commandblock2

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

        yorik100Y Offline
        yorik100Y Offline
        yorik100
        wrote on last edited by
        #3

        @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
        0
        • C Offline
          C Offline
          commandblock2
          wrote on last edited by commandblock2
          #4

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

          yorik100Y 1 Reply Last reply
          0
          • C commandblock2

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

            yorik100Y Offline
            yorik100Y Offline
            yorik100
            wrote on last edited by
            #5

            @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
            0
            • C Offline
              C Offline
              commandblock2
              wrote on last edited by commandblock2
              #6
              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
              0
              • CzechHekC Offline
                CzechHekC Offline
                CzechHek
                wrote on last edited by CzechHek
                #7

                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()));
                    }
                }
                
                yorik100Y 1 Reply Last reply
                0
                • CzechHekC 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()));
                      }
                  }
                  
                  yorik100Y Offline
                  yorik100Y Offline
                  yorik100
                  wrote on last edited by yorik100
                  #8

                  @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
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  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
                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups