barebones-masterserver icon indicating copy to clipboard operation
barebones-masterserver copied to clipboard

IPeer losing reference after abrupt disconnect and reconnect with Master

Open jasielmacedo opened this issue 6 years ago • 1 comments

Hi guys, I'm developing a racing-based game called Deliverace using Barebones and this framework it's awesome but: Recently we received a lot of reports from players reporting this issue and I checked the default package of Barebones (github release or unity asset store package) and i found the same issue. Basically when player disconnect from master and reconnect + LogIn the IPeer loses reference. Methods like peer.GetExtension<IUserExtension>() or message.Peer.GetExtension<IUserExtension>() returns null; The same happens with custom Extensions.

This snippet of code inside AuthModule per example, extension returns null

var extension = message.Peer.GetExtension<IUserExtension>(); if (extension == null || extension.AccountData == null) { message.Respond("Invalid session", ResponseStatus.Unauthorized); return; } I'm using the MasterServerConnector to connect.

Apparently the Peer Id is not the same between server and Client. I made a debug and Server returns 1 connection with Id 1 and Client returns connected with Id 0

Any advice?

jasielmacedo avatar Apr 05 '18 13:04 jasielmacedo