How can i kick the inactive user?

ahoogol
✭
PhotonNetwork.CloseConnection(PhotonPlayer)
not works on already inactive users. 
1
Best Answer
-
The answer to your topic's question is:
You can't kick inactive players atm. Because "kicking" is basically asking the kicked client to leave. When inactive, the kicked client doesn't get the events (and thus can't leave).5
Answers
-
Hi @JohnTube,So you want to remove inactive actors from the room and by "inactive" you mean actors that disconnected but their PlayerTTL is not expired yet?
Yes, that is correct.I don't think that's possible currently but why do you need that?
I used matchmaking by `PhotonNetwork.JoinRandomRoom`. i create room with `MaxPlayers=10` if any match not found. when all 10 slots are filled by actors and all notified that are ready to play, the game will be started. also i need PlayerTTL after the game is started so i create room with `PlayerTtl=60000`. my problem is this: when any player disconnect from room before the room be filled and the game be started, i dont want wait to disconnected actor in this state.1 -
Hi Ahoogol,
if you set PlayerTtl=60000 then you can not remove that player till that time is expired (Thats the purpose of PlayerTtl). We have a game which requires 4 players to start, we wait for 4 players to join then we start the game no matter who disconnects in between.
So you don't have to Use PlayerTtl. You should just proceed to game play once your room is full. If someone disconnects during game start time, you should handle that on client.
So just get rid of PlayerTtl and everything should work fine.0 -
@ahoogol how did you resolve this? We are in 100% same boat. We need a TTL to allow for reconnection, yet TTL is causing disconnected players queued up in a room together to "linger".
Alternately, can we change TTL after creating the room? Ideally, I want to create a room with 0 TTL, then once we START (and change scenes), I want to boost up the TTL to allow for reconnections.
EDIT: Oh, this was marked "answered". I should probably make a new post. Apologies, if a mod sees this.0 -
The answer to your topic's question is:
You can't kick inactive players atm. Because "kicking" is basically asking the kicked client to leave. When inactive, the kicked client doesn't get the events (and thus can't leave).5 -
I am also having a similar problem. Being able to kick an inactive player would be very useful. For example
PhotonNetwork.CloseConnection(inactivePlayer);
would remove the player from the remaining player's PlayerLists and when the inactive player returns they would be informed that they have been removed from the room.
I heard there is talk of making it possible to change the room TTL after creation, this would also solve the problem and be very much appreciated!
We only have this issue on the pregame screen, once the game starts, players that drop should be able to Rejoin because of the TTL.
Currently, when a player unintentionally disconnects in the pregame we have to kill the room and boot everybody, it's a bummer.0