-
-
Notifications
You must be signed in to change notification settings - Fork 414
Fix SSC login deadlock when players are crowd controlled before auth #3218
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: general-devel
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 | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -846,7 +846,11 @@ private static void AttemptLogin(CommandArgs args) | |||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if (args.TPlayer.CCed && Main.ServerSideCharacter) | ||||||||||||||||||||||||||||||||||||||||||
| // Pre-login auth gates can disable movement (SSC/RequireLogin), which may mark the player as CCed. | ||||||||||||||||||||||||||||||||||||||||||
| // Allow login in that temporary state to avoid an auth deadlock. | ||||||||||||||||||||||||||||||||||||||||||
| var disabledForAuthGate = args.Player.IsDisabledForSSC | ||||||||||||||||||||||||||||||||||||||||||
| || (!args.Player.IsLoggedIn && TShock.Config.Settings.RequireLogin); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| || (!args.Player.IsLoggedIn && TShock.Config.Settings.RequireLogin); | |
| || (!args.Player.IsLoggedIn && TShock.Config.Settings.RequireLogin); | |
| // If the player is only CCed because of a server-side auth gate (e.g., Webbed to disable movement | |
| // before login), clear that CC before we proceed into SSC restore/loadout sync. Otherwise the client | |
| // may reject the SyncLoadout packet while still CCed, causing desync. | |
| if (disabledForAuthGate && args.TPlayer.CCed) | |
| { | |
| for (int i = 0; i < args.TPlayer.buffType.Length; i++) | |
| { | |
| if (args.TPlayer.buffType[i] == Terraria.ID.BuffID.Webbed) | |
| { | |
| args.TPlayer.DelBuff(i); | |
| i--; | |
| } | |
| } | |
| // Ensure the auth-gate CC flag is cleared on the server-side Player instance. | |
| args.TPlayer.webbed = false; | |
| } |
Copilot
AI
Feb 27, 2026
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.
PR description says /login should be allowed while CCed only for the SSC pre-login disabled state (IsDisabledForSSC), but disabledForAuthGate also treats RequireLogin as an auth-gate condition. If the intent is strictly SSC-only, drop the RequireLogin clause; if RequireLogin is also intended here, please update the PR description to match (and clarify why this remains gated behind Main.ServerSideCharacter).
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.
disabledForAuthGateincludes!args.Player.IsLoggedIn, but this method already returns early whenIsLoggedInis true. Removing the redundant check would make the intent clearer and avoid implying thatdisabledForAuthGatecould ever be evaluated in a logged-in state.