Skip to content

Fix MOTD not being sent to players on first join

Hanicef requested to merge Hanicef/SRB2:fix-motd-not-being-sent into next

Due to how rate limiting works, the server needs some time to fill up the token bucket before messages can be sent to the server. This filling is done automatically over time, regardless if there are players occupying a slot or not. The problem, however, is that due to dedicated idle, the buckets don't fill up when there are no players on the server, and since dedicated servers idles immediately upon starting up, the buckets start off empty until the first player joins. This is where this becomes a problem: since the buckets are all empty before the first players join, the MOTD that is sent once a player joins will be filtered by the rate limiting system, and thus not appear on the client.

The easiest fix for this is simply by initiating all entries in the token bucket with 1. This will at least be enough for the MOTD to be sent without being filtered, and is the easiest solution that fixes the problem.

Fixes #1194 (closed)

Edited by Hanicef

Merge request reports