Hello,
I’m working on Unity 6000.0.73, with Nintendo Switch 2 SDK 21.4.0, using eos plugin for unity 6.1.0, and eos plugin for unity switch 2 version 4.2.0. I’m also using Mirror library, with EOS Transport.
I’ve recently been able to make EOS work on Switch 2, but I’m now encountering a new issue.
The game allows multiplayer p2p lobbies, up to 2 players per lobby (one host and one client). When players decide to leave a lobby, the host goes through “DestroyLobby()” while the client goes through “LeaveLobby()”, both methods from the EOS LobbyInterface.
The issue is the following: when the client is disconnected from the lobby, it then tries to reconnect to the other player, actually succeeding to do so if the Host didn’t leave, and getting timed out otherwise. We gets a lot of subsequent bugs because of this undexpected behaviour.
I can’t find any part of the code asking the client to reconnect. Some behaviours are specified with “AddNotifyPeerConnectionClosed”, and I read that “OnPeerConnectionInterrupted” was trying to auto-recover. Could that be related? And if so, can we prevent the auto-recover when the lobby was meant to be closed?
Here are some logs on the client side, when the player left while the host was still in the lobby:
<<
Closed a connection with a peer. LocalUserId=[000…25f] RemoteUserId=[000…c1a] SocketId=[RbKhTUbjuwqFSRMSfYwu] SessionGuid=[sCcWAFIe3wistyuG5teW-w]
…
Attempted to close a connection request listener for a Socket ID that was not bound. NotificationId=[48]
Attempted to close a connection closed listener for a Socket ID that was not bound. NotificationId=[49]
…
Peer Connection has successfully connected. LocalUserId=[000…25f] RemoteUserId=[000…c1a] SessionGuid=[dCUYAFIe3wiXW_iLG1i2DQ] State=[Connecting] SignalingState=[Stable] ConnectionState=[IceConnectionConnected]
Connection established. LocalUserId=[000…25f] RemoteUserId=[000…c1a] SocketId=[RbKhTUbjuwqFSRMSfYwu] ConnectionType=[EOS_CET_NewConnection] NetworkType=[EOS_NCT_DirectConnection]
>>
And on the host side:
<<
Removed peer with no connections. LocalUserId=[000…c1a] RemoteUserId=[000…25f]
Added new peer. LocalUserId=[000…c1a] RemoteUserId=[000…25f]
Accepted a connection with a peer. LocalUserId=[000…c1a] RemoteUserId=[000…25f], SocketId=[RbKhTUbjuwqFSRMSfYwu]
PeerConnection has successfully connected. LocalUserId=[000…c1a] RemoteUserId=[000…25f] SessionGuid=[dCUYAFIe3wiXW_iLG1i2DQ] State=[Connecting] SignalingState=[Stable] ConnectionState=[IceConnectionConnected]
Connection established. LocalUserId=[000…c1a] RemoteUserId=[000…25f] SocketId=[RbKhTUbjuwqFSRMSfYwu] ConnectionType=[EOS_CET_NewConnection] NetworkType=[EOS_NCT_DirectConnection]
>>