Photon Unity在比赛开始时创建房间后,房间会在所有人离开后消失吗?

After creating a room at the beginning of the match, will the room dissapear after everyone leaves in Photon Unity?

我正在使用 Photon 统一开发一款游戏。我正在制作一个系统,当玩家点击播放时,它会把他们放在一个合适的房间里。如果没有房间,它会自动创建一个新房间,但我很好奇,如果每个人都离开房间,它会消失还是一直呆在那里?

我也担心,如果房间一直留在那里,玩家会玩,然后离开,创造越来越多的房间。

比如创建了1000个房间,1000个玩家在线:如果1000个玩家加入1000个房间,那么如果每个房间只有1个玩家,他们就玩不了了。

如果有,有没有人走后销毁房间的功能?

默认情况下,房间会自动执行此操作。

Room.EmptyRoomTtl

Room Time To Live. How long a room stays available (and in server-memory), after the last player becomes inactive. After this time, the room gets persisted or destroyed.

默认情况下这是 0

另见 RoomOptions which can be passed to the overload of PhotonNetwork.CreateRoom(string, RoomOptions, TypedLobby = null) and there RoomOptions.EmptyRoomTtl

Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds