Im using Unity Engine and with the new Multiplayer Services SDK creating lobby based on sessions, but when im leaving from lobby as host the session is deleting after some time and didn’t available ? How its work ? I can’t find information about leaving as host from session and how to fix it. How can i give someone host promotion before host leave the session ?
You should be able to change the host to another member by doing this:
session.Host = newHostId;
session.SavePropertiesAsync();
This will not transfer your netcode connection though. Only ownership of the underlying lobby.
We also currently do not update the responsibility to heartbeat the lobby once a host changes, so you would have to start sending heartbeat to prevent it from closing after some time. This is something we will look to do by default.
This only solves cases where you are electing the new host, not when the host is disconnected for another reason (Crash or quitting app without ability to transfer host)
Ohh… i didn’t notice you can do it on IHostSession. I was trying on ISession but was only get properties on Host.
We sending session heartbeat with method Refresh ?
Soo what is the best solution, what would you recommend, for handle leaving/disconnect host ?