UNET: Network.isServer/isClient = False; PeerType = Disconnected but accepting connections?
I don't fully understand this. I'm using Opsive's Third Person Controller and using the Network Demo provided as a basis for my networked game. The controller uses the Network Manager HUD that allows you to test scenes without needing to dive into the code (ie. StartServer and all that) at a click of a button.
When I click "LAN Host" on the HUD, the scene will initialize and the server will start up correctly, with the NM HUD saying "server port 7777". No problems with that, things are sync'd across the network correctly. My character appears on both the host and the client, I can interact, pick up objects, blow stuff up, kill the host character, etc.
Here's the thing though. Even though I'm hosting a match, Network.PeerType says "Disconnected" and Network.isServer and Network.isClient are both false! I thought Network.isServer should be set to true since you are hosting? I build and run the client with a debug script that shows the parameter values on the GUI, and connect as a client. However, the whole time those parameters will still say "Disconnected", "False" and "False". They never change.
I don't understand this. Is PeerType and such are used if you're connected through a firewall or through the MatchMaker setup or it's left in there for compatibility reasons?
Pre-post Edit: Apparently NetworkServer.active and NetworkClient.active are the golden tickets now. Source. Right now I'm using those which seem to be working as intended.
Your answer
Follow this Question
Related Questions
What's wrong with my script ? 0 Answers
how to connect WEBRTC in unity ? 2 Answers
[UNET] Can't spawn players with code 1 Answer
[uNet] Multiple Spawnpoints with Selection 0 Answers
Enemy AI for Multiplayer (using NavMeshAgent) unity 5.6.5f1 0 Answers