-
-
Notifications
You must be signed in to change notification settings - Fork 747
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
isClient is false in OnDestroy #3832
Comments
Checking! |
Hey @Ghetaldus maybe I am misunderstanding this.
That's what you mentioned in the first post. If I test the other way around: build=server-only, editor=client, the IsClient flag is true as we would expect: |
You're looking at PlayMode tests - we haven't maintained those in ages because CI doesn't run them. The tests themselves are broken. |
Override OnStopServer and OnStopClient instead. Also you should be calling NetworkServer.Destroy instead of just Destroy. |
Thanks Mr. G! I've already started refactoring code to use OnStopServer/OnStopClient, instead of OnDestroy. |
…abs, fixes isServer flag always being false in OnDestroy
PR: #3848 |
…abs, fixes isServer flag always being false in OnDestroy (#3848) * repro * NetworkServer.Destroy(): refactor to split scene vs. prefab cases more obviously * fix: #3832 NetworkServer.Destroy now doesn't call ResetState for prefabs, fixes isServer flag always being false in OnDestroy * fix the runtime test * Revert "repro" This reverts commit 3a5a33e. --------- Co-authored-by: mischa <[email protected]>
Describe the bug
When player disconnects isClient is false in OnDestroy on dedicated server.
[IMPORTANT] How can we reproduce the issue, step by step:
Please tell us how to reproduce your issue, STEP BY STEP, with one of our built in examples.
Expected behavior
isClient should be true in OnDestroy
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: