#Packet Defer Error

1 messages · Page 1 of 1 (latest)

peak cosmos
#

Oh also, this is the section of the code that it is referring to:

remoteEvent.OnClientEvent:Connect(function(receivedBuffer: buffer, instances: {Instance}?)
    Import({Buffer = receivedBuffer, BufferLength = buffer.len(receivedBuffer), BufferOffset = 0, Instances = instances or {}, InstancesOffset = 0})
    while Ended() == false do
        local packet = packets[ReadU8()]
        if packet.ResponseReads then
            local threadIndex = ReadU8()
            if threadIndex < 128 then
                Task:Defer(respond, packet, threadIndex, ReadParameters(packet.Reads))
            else
                threadIndex -= 128
                local responseThreads = threads[threadIndex]
                if responseThreads then
                    task.cancel(responseThreads.Timeout)        
                    local results = {ReadParameters(packet.ResponseReads)}
                    task.defer(responseThreads.Yielded, table.unpack(results))
                    threads[threadIndex] = nil
                else
                    warn("Response thread not found for packet:", packet.Name, "discarding response:", ReadParameters(packet.ResponseReads))
                end
            end
        else
            packet.OnClientEvent:Fire(ReadParameters(packet.Reads))
        end
    end
end)
near void
#

This is not the correct channel

peak cosmos
#

oh sorry!

near void
#

Post this in #1017021795330699334 :D

peak cosmos
#

thank you thank you!