Why is EmptyRoomTtl commented? I Need it!

Options
I want to set EmptyRoomTtl to 0 when PlayerTtl is not 0 in creating game. but RoomOptions.EmptyRoomTtl is commented in LoadbalancingPeer.cs line ~1341.
In other place, i saw this:

if (roomOptions.PlayerTtl > 0 || roomOptions.PlayerTtl == -1)
{
   op[ParameterCode.CheckUserOnJoin] = true;  
   op[ParameterCode.PlayerTTL] = roomOptions.PlayerTtl;  
   op[ParameterCode.EmptyRoomTTL] = roomOptions.PlayerTtl;  //Oops, this line is all my problem!!!!!
}

Comments

  • jeanfabre
    Options
    Hi,

    Yes, it's been decided to remove this because PlayerTtl seems enough to define a posible lenght for a game.

    Maybe you have a good case for why a PlayerTtl should less than the RoomTtl, we are ready to consider this, but did not find a good case to justify the added complexity.

    Bye,

    Jean
  • ahoogol
    ahoogol
    edited September 2016
    Options
    Hi @jeanfabre,
    In my case i want to disable EmptyRoomTTL while PlaterTTL is enabled. because i use PhotonNetwork.JoinRandomRoom to join random room but i dont want to join the room that is empty and not clean (has scene instantiated objects), and instead i want to create new clean room.
    so commenting below line will solve my problem:
    
    if (roomOptions.PlayerTtl > 0 || roomOptions.PlayerTtl == -1)
    {
       op[ParameterCode.CheckUserOnJoin] = true;  
       op[ParameterCode.PlayerTTL] = roomOptions.PlayerTtl;  
       //op[ParameterCode.EmptyRoomTTL] = roomOptions.PlayerTtl;  //Oops, this line is all my problem!!!!!
    }
    
    I dont like to change PUN code manually. So can you add an option for it in future version?
    thanks
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @ahoogol,

    I see. So you want to let players return to the room as long as the room is not empty.

    I think it should be possible in the future.
  • Hi,

    yeah, I think your use case makes sense. I have raised the question internally, we'll see.

    Bye,

    Jean
  • Hi,

    RoomTtl will be enabled back in the next Update on the Asset store.

    Bye,

    Jean
  • ahoogol
    ahoogol
    edited October 2016
    Options
    hi @jeanfabre ,
    Thanks, in the version 1.76, it is fixed.
    But that line is not commented yet, so setting EmptyRoomTtl to zero while PlayerTtl is greater than zero, will not disable it.
    A trick for this issue is setting to 1 that is very little for activating condition: EmptyRoomTtl>0
  • jeanfabre
    Options
    Hi,

    can you rephrase, I am missing the point here. What line is not commented?

    Bye,

    Jean

  • Tobias
    Options
    @ahoogol: You mean that the EmptyRoomTTL is still set with the PlayerTTL. So you can't have PlayerTTL > 0 and EmtpyRoomTTL == 0.

    Find this op[ParameterCode.EmptyRoomTTL] = roomOptions.PlayerTtl; in the LoadBalancingPeer and remove that line.

    We will remove that in the next update, too. Then both values are fully independent.
  • jeanfabre
    Options
    Ahhh, I see :)
  • ahoogol
    Options
    @Tobias , @jeanfabre : Thanks. it is fixed now in v1.77