Why Master Client dont be switched in inactive state?
Options
ahoogol
✭
When master client disconnect and his state changed to inactive, photon will not switch master client to another active player. in the duration between start of inactiving and rejoining, the room has not any active master client, so many conditions in the code not satisfied. WHY? is this a bug?
0
Best Answers
-
Hi,
ok, we found the issue, a fix has been made, so it will be available in the next release very very soon.
Thanks for your report, your contribution greatly helped us
Bye,
Jean5 -
Hi,
Note: There is no limit for PlayerTtl.
Bye,
Jean
5
Answers
-
Hi,
How do you know MasterClient is not reassigned?
Are you implementing the callback OnMasterClientSwitched ?
http://doc-api.exitgames.com/en/pun/current/class_photon_1_1_pun_behaviour.html#a53833ef0f9be9906694fc600acc1b897
Do you get some activity on that callback when you disconnect the masterClient?
Bye,
Jean0 -
Hi @jeanfabre
I checkjeanfabre said:
How do you know MasterClient is not reassigned?PhotonNetwork.masterClient
orplayer1.IsMasterClient
.
Yes. it not calledjeanfabre said:
Are you implementing the callback OnMasterClientSwitched ?
I found three UseCase that are not expected:
UC1: 1.MasterClient close connection and go to inactive state(inactive=true). 2. then master client stay on him and not reasssigned.
UC2: after UC1 => 3. the inactive master client dont return back to game after playerTtl (60 Seconds) and it is removed from playerlist of the room. 4.the room now has not any master client because master client not reassigned.PhotonNetwork.masterClient
return null for other players in the room.
UC3: after UC1 => 3.the inactive master client return back to game by callingPhotonNetwork.reconnectAndReJoin()
and go to active state(inactive=false). 4. the master client now leave room. 5. the room now has not any master client because master client not reassigned.PhotonNetwork.masterClient
return null for other players in the room.
Help plz. are there a BUG !?0 -
New Thing Found: when i call
PhotonNetwork.SetMasterClient(nextMasterClient)
in during current master client is inactive, it fail and get error response:Operation failed: OperationResponse 252: ReturnCode: -2 (CAS update failed: property='248' has value='2'). Parameters: {} Server: GameServer
in debuging i found master client is switched to new one in the server but clients didnt know. because expected properties forGamePropertyKey.MasterClientId
when callingPhotonNetwork.SetMasterClient
is different.
I used photon server OnPremise SDK and PUN (Last version). Help plz0 -
Hi,
ok, thanks for your information. It's very useful. I think the problem is that a player can be inactive for a moment and this is conflicting with logics when that client is the master client.
we are currently investigating on how to resolve this. I'll keep you up dated on the fix.
Right now, If you are in a rush, I would account for that potential error in your code, or reduce the time to live of players to limit the possibilities of this to happen.
Bye,
Jean
0 -
Hi,
Quick question: You are setting Player Time to Live right? how much is this value?
Bye,
Jean0 -
Hi,
ok, we found the issue, a fix has been made, so it will be available in the next release very very soon.
Thanks for your report, your contribution greatly helped us
Bye,
Jean5 -
Thanks @jeanfabre
I am happy from your news and i am waiting for next release
Yes, this value is PlayerTtl = 60000 (1min, Maximum value i think)jeanfabre said:Quick question: You are setting Player Time to Live right? how much is this value?
0 -
Hi,
Note: There is no limit for PlayerTtl.
Bye,
Jean
5 -
Hi @jeanfabre ,jeanfabre said:ok, we found the issue, a fix has been made, so it will be available in the next release very very soon.
Pun v1.73 was released a few days ago. but this issue has not been fixed yet.
0 -
Hi,
uhm, thanks for reporting, I'll investigate further, I'll get back to you on this.
Bye,
Jean0 -
Hi,
ok, yes, that's odd. I'll get back to you when we have another fix
Bye,
Jean0 -
Thanks @jeanfabre, i am waiting for you0
-
Hi,
ok, found the issue. It will be in the next update ( for real this time hopefully )
If you don't want to wait, the fix is easy.
locate the method HandleEventLeave in NetworkingPeer.cs and changeif (player.isInactive) { Debug.LogWarning("HandleEventLeave for player ID: " + actorID + " isInactive: " + player.isInactive + ". Stopping handling if inactive."); return; }
toif (player.isInactive && _isAlreadyInactive) { Debug.LogWarning("HandleEventLeave for player ID: " + actorID + " isInactive: " + player.isInactive + ". Stopping handling if inactive."); return; }
Bye,
Jean0 -
I still have this issue with the latest release of the realtime SDK. (this is NOT about PUN). When OnPlayerLeftRoom is triggered by the former master client, it tells that he is active while it shouldn't be. Did you actually fixe it ?
PS: It's writtenThe former MasterClient is still in the player list when this method get called.for theOnMasterClientSwitched
but when i am iterating on CurrentRoom.Players in this callback, i don't have the former master client anymore. I don't understand0 -
For the initial issue, the mistake was from me. But i still have the second issue so my question is: in the OnMasterClientSwitched callback, in the currentroom.players, is the former master client still there ? Because i don't have it anymore while it seems in the documentation that i should still have it.0