-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/Restricted Restart #7
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: main
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -55,6 +55,13 @@ modded class MissionServer | |||||||||||||||||||||
| else | ||||||||||||||||||||||
| Print("[SwarmObserver] No logout data found for uid: " + uid); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (!shouldClientBeObserved(player)) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| Print("[SwarmObserver] Player " + (data ? data.PlayerName : "unknown") + " is not subject to observation, skipping"); | ||||||||||||||||||||||
|
||||||||||||||||||||||
| Print("[SwarmObserver] Player " + (data ? data.PlayerName : "unknown") + " is not subject to observation, skipping"); | |
| Print("[SwarmObserver] Player " + (data ? data.PlayerName : "unknown") + " is not subject to observation, skipping"); | |
| // Even if the player is not observed, ensure we clean up any stored logout data and combat state | |
| if (data) | |
| SwarmObserverLogoutManager.RemoveLogoutData(uid); | |
| if (player) | |
| GetCombatStateManager().RemoveCombatState(player); | |
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.
shouldClientBeObservedreturnsfalsewhenplayeris null, but this file’s existing disconnect flow explicitly accounts forPlayerDisconnectedoften being invoked without a validplayer/identity(hence storing logout data inOnClientDisconnectedEvent). With the new check, a nullplayerwill cause SwarmObserver processing to be skipped even for normal voluntary disconnects, preventing restricted-area grace periods/combat notifications from ever running. To keep the intended behavior, base the decision on stored logout data (e.g., store the kickoff reason/flag inSwarmObserverLogoutDataduringOnClientDisconnectedEvent) or treatplayer == nullas observable whendataexists.