BeardedManStudios / ForgeNetworkingRemastered

See various forks, also please join the Forge Community fork of Forge Alloy! -> https://github.com/ForgeAlloyCommunity/ForgeAlloy
https://twitter.com/FarrisFaulds
Apache License 2.0
1.49k stars 309 forks source link

Joining players over ServerBrowser acts differently to joining over MultiplayerMenu scene. #336

Open JesusLuvsYooh opened 4 years ago

JesusLuvsYooh commented 4 years ago

Version Number and Operating System(s):

Latest Unity 2019, Forge Remastered Git

Summary:

Connecting between MultiplayerMenu over Master Server to a different device on different IP works. Player 1 hosts, Player 2 (on different ip and device) puts in IP on MultiplayerMenu, clicks join, both players are now in Lobby scene, chatting, setting team colours changing name etc (works perfectly, master server shows they registered, nats working great etc)

But not when a player tries to join using ServerBrowser it does not. The host shows up on ServerBrowser, code looks same for joining in ServerBrowser as MultiplayerMenu, but the game acts as if networkObjects do not exist.

Reproduce:

Using the default 3 scenes provided, unchanged, except for IP's. 2 builds/projects, one to host, and one to view hosts, both go to lobby.

Add yours/mine (if requested) master server and nat IP on the canvas/ServerBrowser script, and on /canvas/MultiplayerMenu script on their scenes.

Build 1: Add MultiplayerMenu as 0, Lobby as 1 in build settings. Play, click host on MultiplayerMenu, on the master server exe you can see they connect and get registered.

Build 2: Add ServerBrowser as 0, Lobby as 1 in build settings. Play, build 1 host shows on screen, click join on the host. Lobby scene loads, the joining player to host flashes up for a second before disappearing, type in chat for example on players side, any interaction with rpc's or syncvars displays errors that seem to link to networkObjects not being there. NetworkManager has been instantiated and initialised, everything looks to be same as MultiplayerMenu joining, but the outcomes are not.

[Optional] Discord Username:

JesusLuvsYooh

MMconnect SBconnect

harleydk commented 4 years ago

Same here. Somewhere in there the networkObject gets wrecked.