Possible to make a lobby server NOT transition scenes?

Hey guys, I had this idea to make a lobby where players could do the standard host/connect via IP, and I had this idea for a player to open the game and run it as a server. My game is a 1v1 type of game, so I was wondering if it were possible to make it so that a server just handles the player scene transition and other standard multiplayer stuff, but also stay on the same scene? The Unity examples I’ve seen all change scenes. Basically imagine this:
4 players are in the same server. Two of them decide to play with each other, so they ready up and start a game while the other two can freely hang out on the server.

Basically my question is “Is this a possible thing with UNET?”. I’m pretty new to using Unity, let alone UNET, so I like to come here for guidance before I waste a ton of time only to find out that it’s not possible. Thanks for the input in advance!

Hmm, just toyed with the NetworkManager.StartServer() method on an old build of my game, and it didn’t look good. I made it so that the server joins the battle scene, but is immediately moved back to the main menu scene to see if players could still move about while the server is elsewhere. No go, boys /:

Sure thats possible :slight_smile: I think all you have to do is use a custom NetworkManager.

See:
http://docs.unity3d.com/Manual/UNetManager.html

Maybe this part can become important to you:

// called when connected to a server
public virtual void OnClientConnect(NetworkConnection conn)
{
    ClientScene.Ready(conn);
    ClientScene.AddPlayer(0);
}

I think if you just comment out the ClientScene.Ready(conn); that would mean the player is not ready → no scene change.

At least thats what I think should work, haha. If not still this link should be a good way to start.

Hmm, I’ll mess with it when I get home! My only concern is that even while players have changed scenes, they would still fire commands at the server without the objects to reference and not be able to use RPCs. I’ll try some stuff again after work

Look at client ready state:

http://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SetClientNotReady.html

http://docs.unity3d.com/Manual/UNetPlayers.html

So the general idea is to set the lobby players as just “Not Ready” while the server and ready players change scenes and play? What would happen to the “Not Ready” players? Do they freeze up or anything? The more I look into it, the more a Master Server or something akin to it would better suit my needs, it seems. I’ll look into this method more when I have free time after some exams this week. I was considering using another Networking service, but I would love to stick with UNET.

The biggest issue I seem to have with this is simply that if I move the server to a different scene, any player on a different scene still has trouble updating/sending updates. Makes sense, I suppose.

EDIT: Just read your second link about ClientReadyStates. Correct me if I’m wrong, but this insinuates that players can interact with select network things in a lobby such as chat and local editing such as something like an options menu? If I had a server in the Game Scene that hosted two players, would this mean that other players would have to wait until that game is finished, or could other players in a lobby start a new game by entering the ready state and pair up? I’m assuming the former, as everyone would be calling functions to the same server, which would create some weird bugs. Sorry for all of the questions! I’m really trying my best to grasp the concept

Actually, is it possible to just give a player host capabilities of some sort? I had this idea where a dedicated server acts as a lobby for players and maybe players could pair up for their own games if one player could become the host. I did see on the roadmap that host migration is planned for 5.3, but is there any other way to pass authority onto clients?