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

Client loading Scene even though automaticScenes is false #368

Open Gwom opened 4 years ago

Gwom commented 4 years ago

Version Number and Operating System(s):

03/10/2018-19.53.38,04 Windows, Unity Editor 2019.2.21f1

Expected behavior:

When the Server transitions to a new scene with automaticScenes set to false, the Cleint should not load a new Scene

Actual behavior:

ReadBinary in the NetworkManager calls SceneManager.LoadScene (Async too) on the Client. As suggested by PHalasz here maybe the client should be notified of the scene change and then they can load if the automaticScenes is set to true.

Also this issue was seen by devandart here who also fixed it with an if(!automaticScenes) return statement, but I found this did not work for me, as the client was not entering the if (frame.GroupId == MessageGroupIds.VIEW_INITIALIZE) section. My work around is to put the if(!automaticScenes) return at the start of the ReadBinary function

Steps to reproduce:

Turn off automaticScenes and transition the Server to a new Scene. Not 100% sure if it happens every time.

[Optional] Discord Username:

Gwom

phalasz commented 4 years ago

I think this has been fixd on the develop branch.