Skip to content

Update NetworkServer.cs - #4010

Merged
miwarnec merged 1 commit into
MirrorNetworking:masterfrom
J0NY97:patch-1
Apr 16, 2025
Merged

Update NetworkServer.cs#4010
miwarnec merged 1 commit into
MirrorNetworking:masterfrom
J0NY97:patch-1

Conversation

@J0NY97

@J0NY97 J0NY97 commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@MrGadget1024

Copy link
Copy Markdown
Collaborator

No description of the issue provided, but conn should never be null there. The only callers have a good connection to pass.
If you're calling that from your code, you're responsible for passing a good connection.
Maybe you should be using NetworkServer.RemovePlayerForConnection instead?

@J0NY97

J0NY97 commented Apr 9, 2025

Copy link
Copy Markdown
Contributor Author

It seems like 'conn' would be 'null' if one calls 'NetworkManager.StopHost()' in 'NetworkManager.OnClientDisconnect()'.

@MrGadget1024

Copy link
Copy Markdown
Collaborator

It seems like 'conn' would be 'null' if one calls 'NetworkManager.StopHost()' in 'NetworkManager.OnClientDisconnect()'.

You definitely shouldn't be doing that...Mirror is already in that process at that point.

@J0NY97

J0NY97 commented Apr 10, 2025

Copy link
Copy Markdown
Contributor Author

Probably not, but you gotta do whatchu you gotta do.
My 'fix' would make the program run perfectly normal even if you did that.
Otherwise it just gives a NullReferenceException.

@miwarnec
miwarnec merged commit 2381edf into MirrorNetworking:master Apr 16, 2025
MrGadget1024 added a commit that referenced this pull request Apr 16, 2025
MrGadget1024 added a commit that referenced this pull request Apr 16, 2025
MrGadget1024 pushed a commit that referenced this pull request Apr 17, 2025
MrGadget1024 added a commit that referenced this pull request Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants