Closed A1win closed 1 year ago
I made a few adjustments to the SteamNetworkingTransport that will check for connected user before handling the data and will notify the developer log if such happens
I also added an OnDestroy to try and close any open connections however this wouldn't be fool proof ... assuming that Steam API is shutdown before this is called it wont mean anything.
Beyond that the main push for #179 is the addition of the SteamNetworkingSocketsTransport ... it poles for network events by connection so this wouldn't be an issue in the first place.
The SteamNetworkingTransport accepts network messages from clients that aren't connected to the server. It appears to be a feature of Steam networking that messages can be sent and received without first establishing a connection. The SteamNetworkingTransport doesn't take this into account and can cause errors when it happens.
One such case can be reproduced as follows:
NetworkManager.Singleton.StartHost()
.ConnectToSteamID
field in SteamNetworkingTransport to the host's Steam ID and then callingNetworkManager.Singleton.StartClient()
.It also appears that the shutdown logic in SteamNetworkingTransport only works on a controlled shutdown (see Discord log below).
A client that isn't connected to a server shouldn't be able to cause errors on the server by sending it network messages. The server shouldn't accept any messages from such a client.
Initial conversation from Unity Multiplayer Networking Discord (#support):