So I’m using OnPlayerDisconnected (NetworkPlayer player) along with Network.RemoveRPCs and Network.DestroyPlayerObjects.
However, what I’ve come to realize is that this is too disrupt-full to the game. Depending on what the character is doing when the connection drops, I need to perform other cleanup tasks to set the world back to a pristine state if the player left in the middle of doing something.
For example lets say I have a group of players tossing a ball around and one player is holding the ball when his network drops. Although I want to remove the player, I don’t want to remove the ball that was associated to him. In this case the ball isn’t even instantiated any more, but I know the player has it. If the player drops I want to instantiate the ball back to the scene for others to pick it up. This is not a persistent world so when the player logs back in he wont have the ball anymore. This is just one sample situation and in reality I can forsee all kinds of problems if I can’t gracefully clean up the player properly.
As it happens now the destroyplayerobjects gives me no control, and I don’t know how (if its even possible) to map the NetworkPlayer back to a GameObject so I can do some cleanup before calling DestroyPlayerObjects.
Anyone have any ideas. I really don’t want to re-architect my entire design for something that seems so trivial.
Thanks