Kicked player cannot join new games....

So, I've just implemented a Chat Window that uses commands sent from the admin, or Master Client.

if I type "/kick [PlayerName]" it kicks the player with the specified name using PhotonNetwork.CloseConnection(PhotonPlayer player)..

The problem, then, is that I don't know how exactly it is closing the connection.. Once the connection is closed, it is pretty much closed for good I guess? After the player is kicked, it loads the Main Menu. Once the player clicks the "Multiplayer" button, it calls PhotonNetwork.ConnectUsingSettings, which SHOULD give him a fresh connection, right?

By the way, when a player is kicked from the server, his connection state remains at JoinedLobby... It puts him back into the lobby, but when he tries to join the game again he gets the following error:

"JoinRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster."

It's weird because his connection state is definitely JoinedLobby, and the Master hasn't changed at all... Any suggestions?

Comments

  • What is the best way to reconnect a player after CloseConnection has been called?
  • Okay, so, I finally got it to where it can join games after the player has been kicked, but now it is duplicating the player in any game he joins.. Like, for instance, he joins the first game and there is only one player model. He gets kicked, and then he joins another game. That game he has 2 player models. He gets kicked again, joins another, and now there are 3 player models, etc.
  • You mean in the client that was kicked and rejoins, there are multiple characters?
    Did you disable autocleanup?
    You could reaload the level or simply destroy the character.
  • Nah it was actually a mistake on my part. I was forgetting to destroy a gameobject when the main menu was loaded, and it was causing the player to connect twice and also instantiate two characters. Now the object is destroying correctly.