Hello.
Now i do the reconnecting if player has disconnected (as in Hearthstone, yes everywhere, in principle). I use HLAPI, i.e. the player is prefab with NetworkBehaviour. When disconnect, its object is destroyed.
Now i think to record the state of the player when the player disconnects, and when connected, write this data to the freshly spawned NetworkBehaviour. But this will lead to a rewriting of a large amount of logic.
Is it possible to cancel the auto-destroying of NetworkBehaviour on the client and the server and when connecting the player - set player authority to this prefab?
Ok, so to clarify:
I have a NetworkManager GameObject, with a NetworkManager component. Should I remove this component, and instead use MyOwnNetworkManager Script?
Despite the fact I’m overloading the NetworkManager method, when players reconnect, new player GameObjects are instantiated and spawned. I would like to implement a system in which when player reconnects, check if there is a Player GameObject and uses it when exists. How could I implement something like this?
I am also trying to understand what Severos has imlemented in his functions on this
which can be useful for me, but I don’t fully understand everything yet.
Do you know if there is some documentation or a useful post about how to design a system to manage player reconnection, considering user/password?
My final word is to forget about all of these “high level libraries” and start doing it from low level. It will give you an understanding of how things work and also, you will have precise control over everything. I had 3 stages. 1st, started from unet hlapi, realized that it’s not sufficient at all, had much of overhead + not concurrent. 2nd, moved to LIteNetLib. It gave me a bit more control, but the cpu usage for my goal was bit to high. But then, 3rd stage was moving to low level ENet library.
I know it might be painful and sometimes scarry to dive in low level. But you will learn fast day by day, trust me.