The MultiplayerSystemComponent has logic that prevents a client from initiating "LoadLevel" at any point after the client has connected to a server for the first time, even if a disconnect occurs. However, the "disconnect" console command will reset the client-side state back to uninitialized, allowing the LoadLevel to succeed. This change to the game's ClientDisconnect state calls "disconnect" explicitly before calling "LoadLevel" so that it can successfully navigate back to the start screen. (Side note - this is why testing the feature with using "disconnect" on the client always worked :( )
This potentially should get fixed in the Multiplayer Gem as well in the development branch, GHI entered here: https://github.com/o3de/o3de/issues/15771 . But since it can't get fixed in the stabilization branch, the workaround in this PR is required.
The MultiplayerSystemComponent has logic that prevents a client from initiating "LoadLevel" at any point after the client has connected to a server for the first time, even if a disconnect occurs. However, the "disconnect" console command will reset the client-side state back to uninitialized, allowing the LoadLevel to succeed. This change to the game's ClientDisconnect state calls "disconnect" explicitly before calling "LoadLevel" so that it can successfully navigate back to the start screen. (Side note - this is why testing the feature with using "disconnect" on the client always worked :( )
This potentially should get fixed in the Multiplayer Gem as well in the development branch, GHI entered here: https://github.com/o3de/o3de/issues/15771 . But since it can't get fixed in the stabilization branch, the workaround in this PR is required.