- Home /
Is Host Migration working with relay server and matchmaking ?
If yes, can someone point me to a working example of this ?
The documentation just cassually mentions that "This works for direct connection games. Additional work is required for this to function with the matchmaker and relay server."
More specifically I'm trying to find out which methods have to be overridden and how in our custom NetworkManager and/or NetworkMigrationManager in order to create a seamless host migration (like Photon does).
I'd really hate to have to switch to Photon just for this issue alone since UNet has been great so far with all the cool new syncvars and other multiplayer goodies.
Thank you in advance for any available info on this.
I, too, have been looking into this issue since June. There's very little documentation, but either way - it's currently confirmed bugged and not working. I've been following up every month. I have a feeling they forgot about it when I followed up last month (the first response was that it wasn't a bug and working as intended - which means, not trying to call the guy out but - since June, it sounds like it wasn't actually officially reported. They later took that statement back and said they are currently working on it).
All in all, mplayer docs need a serious revamp for anything to do with host migration, matchmaking, lobby, staging, and matchmaking with friends.
(90's mplayer services like hosting a server and joining a server manually from a list are fine - just these above - great for testing, but in production in 2016, realistically people will be using the above feats that are quite vaguely doc'd)
I wrote them today a mail through our premium account so maybe we get this answer prioritized by their tech guys.
Thanks for your input... standing by, hoping for the best :D
Doing host migration for match games too now, and don't know how to start....
Any updates, guys?
Nothing from my end. Couple weeks ago I got a "working on it" which I'm afraid was the same answer I got almost 6 months ago :/
Our only hope is that more people see this post and have an interest in it to encourage priority.
Same here, still no response :(
I sent them a mail from our premium account 3 weeks ago which was supposed to have 24 hour support response.
Bring your brethren to this question and let's grow so big that they cannot ignore us any more :D
Screw Unity! We have to leave host migration for now. Luckily 1 game rounds are very short (.5 ~ 1 $$anonymous$$) in our game. I think it's acceptable when host disconnected, all client continue the current game as offline game, and search and join another match at background. We have another game using legacy $$anonymous$$asterServer and planning to migration to UNet, we may look for Photon ins$$anonymous$$d then...
Answer by SweatyChair · Nov 17, 2016 at 01:12 AM
This is NOT a full answer, wish someone can finish it off
After digging into the source code of NetworkMigrationManager, I found that most functions in relay match are not being called like in direct (LAN) connect. (e.g. OnClientDisconnectedFromHost()).
In customized NetworkManager, I need to manually call few functions of the NetworkMigrationManager as:
public override void OnStartClient(NetworkClient client)
{
base.OnStartClient(client);
migrationManager.Initialize(client, matchInfo);
}
public override void OnServerConnect(NetworkConnection conn)
{
base.OnServerConnect(conn);
migrationManager.SendPeerInfo();
}
public override void OnServerDisconnect(NetworkConnection conn)
{
base.OnServerDisconnect(conn);
migrationManager.SendPeerInfo();
}
public override void OnClientDisconnect(NetworkConnection conn)
{
// Do not disconnect like normal
// base.OnClientDisconnect(conn);
migrationManager.LostHostOnClient(conn);
}
Then the GUI of NetworkMigrationManager is now shown and I can pick to become host. However, I am stuck on how other clients to connect the new host (while NetworkMigrationManager.peers should already have all clients info) and the relay match switch owner...
I have a feeling it should be do-able as Unity doc said, but you need to be very expert in LLAPI and know what to do...
No. UNet just won't work in relay server, at least not until 2018+ in Unity roadmap...
We gave up host migrant and just let clients disconnect, since our game is very fast pace (30s per game)
Thanks for the answer. But what if someone is using direct connect over the internet using NAT punchthrough? I have stopped using the relays (still use $$anonymous$$$$anonymous$$ though, and S$$anonymous$$m lobbies to pass some info).
Answer by MrLucid72 · Feb 02, 2018 at 06:18 AM
It never worked to begin with, although it was advertised, and never will because the module is abandoned. This is the answer, and not a single Unity staff member will challenge this answer. https://forum.unity.com/threads/unity-hello-is-there-anybody-out-there-p.445978/
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
How can I transfer hosts once the current host leaves? 0 Answers
Requesting data from server 1 Answer
Network messages (OnPlayerConnected, OnServerInitialized) never gets called 0 Answers
Multiplayer problem 1 Answer