Hi !
I have a quick question here
I made a little demo where i have a server and one client, on my own computer (127.0.0.1), i just connect to the server, pop some little cubes and then disconnect. Right now, eveything is working. So why am I here ? When my client leaves, i ask my server to clean up the mess and destroy everything the client did:
void OnPlayerDisconnected (NetworkPlayer player){
Network.DestroyPlayerObjects (player);
Network.RemoveRPCs (player);
}
This is working but my client still has the cubes in its scene when i disconnect so if i go back on the server with the same client, without quitting and launching the exe again, i find myself with an empty server -as i can expect with the few lines of code just above- BUT with a client with all the previous cubes i popped. So when i pop more cubes, the server thinks there is 1 cube while my client has in fact >1 cubes.
I’m trying to find a proper way to destroy what one specific client did in my scene, without having to mark it on a list everytime i pop something and then use Object.Destroy()
on all the items of the list, something that would clean up without wondering what or how much, like the server is able to do, something equivalent to that:
void OnDisconnectFromServer(){
DestroyOwnObjects ();
RemoveOwnRPCs ();
}
Cheers