Closed RikuTheFuffs closed 1 year ago
As an additional thought, we might think about this:
I Opened a PR to add this event
As an additional thought, we might think about this:
* OnClientStarted: Basically does the exact same thing as OnServerStarted but for Clients only * We could make a host invoke both * OnShutdownComplete: Both server and clients would invoke this once the NetworkManager is shutdown.
OnShutdownComplete would be very useful for what I'm doing as the client needs to disconnect from one server and join another but I'm not using Update at all currently so can't poll for it, instead I'm getting the server to disconnect them which isn't ideal for the workflow.
Update: This is now implemented in the develop
branch! PR: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/2420
I also took the chance to add some more events in that PR, have a look at the changes in the changelog for all the details
Description
Hi, I noticed that in NetworkManager we have an event for when a client connects / disconnects, but for the server we only have the "started" one.
Solution I'd like
Would it make sense to add an
OnServerStopped
event, so that applications can do specific operations when a server instance is stopped but the application is still running?Additional context:
This could be useful to send analytics, do cleanups, etc...