Open
Conversation
…ients. Client IDs are now generated as negative int64 values using an atomic uint64 counter, aligning with vanilla client behavior. Additionally, the number of MTU discovery attempts per size is increased from 3 to 4 to match vanilla clients.
…imics vanilla behavior. Adds a check to ensure that vanilla clients provide a negative client GUID during OPEN_CONNECTION_REQUEST_2 handling. Returns an error if the client GUID is not negative, improving protocol compliance.
Replaces all uses of the timestamp() function with timeSinceStart() to better reflect its purpose as milliseconds since system start, not Unix epoch. Updates related comments and documentation in ConnectedPing and ConnectedPong to clarify the meaning of PingTime and PongTime. Also simplifies .gitignore and adds .gitattributes for LF normalization.
Sorry for all the commits, I'm tired and on a new keyboard 😭
Clarify that startTime could be the system or the client start time. This is dependent on which device you're playing on.
The startTime variable is now set to the current time instead of a randomized past time. This simplifies initialization and removes the dependency on the math/rand/v2 package.
Introduces systemStart and lastConnectedPong fields to Conn for tracking system/client uptime and the latest ConnectedPong message. Adds methods to retrieve uptime and last pong, updates handler logic to set systemStart and store ConnectedPong, and provides a SetUptime function for manual uptime adjustment.
Renamed the unexported effectiveMTU method to EffectiveMTU and updated all usages. Added a WaitForPacket method to Conn and connection handlers, allowing registration of handlers for specific packet IDs and waiting for their arrival. Updated handler implementations to support this mechanism.
Introduces Conn.RaknetLatency to measure round-trip time using ConnectedPing/Pong. Enhances listener blocking by allowing custom block durations and refines block expiration logic. Adds logging for connection request times.
Introduces BlockDuration allowing for varying block durations.
Renamed BlockDuration to BlockFor and refactored internal methods for clarity. Added BlockUntil and blockUntil methods to allow blocking until a specific time, improving flexibility in blocking logic.
TrippleAWap
commented
Jan 19, 2026
Updated blockUntil to return early if the 'until' time is zero or already in the past, preventing unnecessary blocking logic for expired deadlines.
HashimTheArab
approved these changes
Jan 19, 2026
didntpot
suggested changes
Jan 19, 2026
Co-authored-by: هـ <didntpot@protonmail.com>
Updated the blockFor method to return early if the duration is less than or equal to zero, preventing unnecessary blocking for zero durations.
Eliminated the BlockUntil method from Listener and security, inlining the block duration logic directly into blockFor. This simplifies the code by reducing indirection and removing unused methods.
HashimTheArab
approved these changes
Jan 19, 2026
didntpot
approved these changes
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces extra Block methods allowing for varying block durations.