-
-
Notifications
You must be signed in to change notification settings - Fork 825
Fix: Issues related to Geyser's reload command #6179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,36 +28,49 @@ | |||||
| import lombok.Getter; | ||||||
| import lombok.RequiredArgsConstructor; | ||||||
| import org.geysermc.geyser.GeyserImpl; | ||||||
| import org.geysermc.geyser.configuration.GeyserConfig; | ||||||
| import org.geysermc.geyser.api.event.EventRegistrar; | ||||||
| import org.geysermc.geyser.api.event.lifecycle.GeyserPostInitializeEvent; | ||||||
| import org.geysermc.geyser.api.event.lifecycle.GeyserPostReloadEvent; | ||||||
| import org.geysermc.geyser.session.GeyserSession; | ||||||
| import org.geysermc.geyser.session.cache.WorldCache; | ||||||
| import org.geysermc.geyser.text.GeyserLocale; | ||||||
|
|
||||||
| import java.util.Collection; | ||||||
| import java.util.concurrent.atomic.AtomicInteger; | ||||||
|
|
||||||
| public final class ScoreboardUpdater extends Thread { | ||||||
| public static final int FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD; | ||||||
| public static final int SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD = 250; | ||||||
| public final class ScoreboardUpdater extends Thread implements EventRegistrar { | ||||||
|
|
||||||
| private static final int FIRST_MILLIS_BETWEEN_UPDATES = 250; // 4 updates per second | ||||||
| private static final int SECOND_MILLIS_BETWEEN_UPDATES = 1000; // 1 update per second | ||||||
| public static final int SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD = 250; | ||||||
| public static int firstScorePacketsPerSecondThreshold; | ||||||
|
||||||
| public static int firstScorePacketsPerSecondThreshold; | |
| public static volatile int firstScorePacketsPerSecondThreshold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GeyserLegacyPingPassthrough.init(...)now only starts the thread viaGeyserPostInitializeEvent/GeyserPostReloadEventsubscriptions. However, every bootstrap callsGeyserLegacyPingPassthrough.init(geyser)afterGeyserImpl.start(), and those lifecycle events are fired insidestartInstance()beforestart()returns. This means the event has already fired by the time you subscribe, so the ping passthrough thread will never start (both on initial enable and reload). Consider starting the thread immediately here (and only delay if you can guarantee subscription happens before the event is fired), or move initialization earlier in the startup sequence.