Hi,
I'm one of the two guys working at [in]Sanity Interactive, a co-op game development crew that is currently working on a shooter project, which will feature both dedicated server and private matches where the player hosting the match is able to play as well. We have been using Unity's built-in framework (RakNet) and we've had troubles trying to get the network layer to work correctly when sending RPCs back to clients so they can load the right level.
I was wondering if you could confirm if TNet has server-instructed level loading capabilities, and if you could post a snippet of code that would be the basis of the server telling the client what to load.
When the player connects to the server hosting the game, before the client should do anything, the server sends a message (let's for arguments sake say "clientLoadLevel") to the client, with a string of it's level that is currently loaded (called from Application.levelLoadedName, etc). The client must then accept this message and start loading the level (I see TNet has TNet.LoadLevel which is nice!) otherwise I intend to kick the client saying "Wrong level loaded" to prevent really weird stuff happening.
So, in pseudo code:
Server: Client connects > Client, clientLoadLevel("mp_testlevel") > *waits for client response * > Okay, you've loaded, welcome to the game
Client: Connect to server from mainmenu > Server, what is the level? > Okay, I'll load mp_testlevel > Yay!
The thing here, is that in our current Unity RPC implementation, is that the RPC gets fired in a different scene since the server has loaded the level (let's say mp_testlevel) and since the client is on the main menu, it freaks out and errors or doesn't load the level and weird stuff starts happening.
So, this is one of the things I'm looking at in TNet. Plus, for shooters, I need a robust and reliable solution because I don't want major network glitches due to bugs in Unity's set-up. I realize that TNet is only the networking cake, and my game is the icing on top of that, but if you can confirm I can do the level loading as shown above, then you pretty much have a purchase.
Cheers!