Skip to content

fix: remove OnClientConnectedCallback registration from StatsDisplay #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

NoelStephensUnity
Copy link
Collaborator

This change is within the test project's manual tests area and this PR is to just fix this minor bug in the StatsDisplay code used in the manual scene transitioning test.

Background:
I ran into a bug that can cause late joining players to not get registered with the rest of the players if you have a NetworkBehaviour that has registered for the OnClientConnectedCallback event but never removes the registration when destroyed. This will cause, on the server side, the HandleApproval method to throw an exception before notifying the rest of the players that a new player has joined and as such the notification is never sent.

Up for Debate:
If you are interested in a potential way to fix this "break in the approval process" while also having the ability to notify the user that they failed to remove their OnClientConnectedCallback registration you can find that in this experimental branch.

The above experimental branch does not include a unique warning message but that can be easily added

Comments for OnDestroy method
Yamato 1 commit problems.
@NoelStephensUnity NoelStephensUnity merged commit 92cd9cc into develop Jun 4, 2021
@NoelStephensUnity NoelStephensUnity deleted the fix/StatsDisplayOnClinetConnectedCallback branch June 4, 2021 22:22
SamuelBellomo added a commit that referenced this pull request Jun 22, 2021
* develop: (21 commits)
  feat: NetworkObject Parenting (#855)
  refactor: move RpcMethodId serialization from ILPP to Core (#910)
  fix: NetworkPrefabs container's elements invalidated in the NetworkManager after relaunching Unity Project (#905)
  feat!: OnNetworkSpawn / OnNetworkDespawn (#865)
  feat: Add missing XMLdoc comment (#897)
  refactor: upgrade ILPP backend, drop 2019.4 support, rename types/fields (#895)
  fix: do not access/render runtime info if not playing in the editor (#898)
  feat: Add name property for network variables (#891)
  chore: delete PhilTestResults.xml (#894)
  feat: MultiInstanceHelpers to use fixed FrameRate by default (#893)
  test: General MultiInstanceHelper improvements (#885)
  refactor: isKinematic set to true for rigid bodies of non-authorized instances (#886)
  docs: adding more info to help debug on network transform error message (#892)
  feat: Add RPC Name Lookup Table Provided by NetworkBehaviourILPP (#875)
  fix: remove OnClientConnectedCallback registration from StatsDisplay (#882)
  feat: Add profiling decorator pattern (#878)
  refactor: Removing dead code for NETWORK_VARIABLE_UPDATE (#880)
  fix: update package version to 0.2.0 because of unity minversion change (#881)
  docs: Fix typo in changelog version title
  docs: Hotfix Changelog for 0.1.1 and manual update (#873)
  ...

# Conflicts:
#	com.unity.multiplayer.mlapi/Runtime/Core/NetworkBehaviour.cs
#	com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs
#	com.unity.multiplayer.mlapi/Tests/Runtime/BaseMultiInstanceTest.cs
#	com.unity.multiplayer.mlapi/Tests/Runtime/BaseMultiInstanceTest.cs.meta
SamuelBellomo added a commit that referenced this pull request Jun 22, 2021
* develop: (67 commits)
  feat: NetworkObject Parenting (#855)
  refactor: move RpcMethodId serialization from ILPP to Core (#910)
  fix: NetworkPrefabs container's elements invalidated in the NetworkManager after relaunching Unity Project (#905)
  feat!: OnNetworkSpawn / OnNetworkDespawn (#865)
  feat: Add missing XMLdoc comment (#897)
  refactor: upgrade ILPP backend, drop 2019.4 support, rename types/fields (#895)
  fix: do not access/render runtime info if not playing in the editor (#898)
  feat: Add name property for network variables (#891)
  chore: delete PhilTestResults.xml (#894)
  feat: MultiInstanceHelpers to use fixed FrameRate by default (#893)
  test: General MultiInstanceHelper improvements (#885)
  refactor: isKinematic set to true for rigid bodies of non-authorized instances (#886)
  docs: adding more info to help debug on network transform error message (#892)
  feat: Add RPC Name Lookup Table Provided by NetworkBehaviourILPP (#875)
  fix: remove OnClientConnectedCallback registration from StatsDisplay (#882)
  feat: Add profiling decorator pattern (#878)
  refactor: Removing dead code for NETWORK_VARIABLE_UPDATE (#880)
  fix: update package version to 0.2.0 because of unity minversion change (#881)
  docs: Fix typo in changelog version title
  docs: Hotfix Changelog for 0.1.1 and manual update (#873)
  ...

# Conflicts:
#	com.unity.multiplayer.mlapi/Tests/Runtime/com.unity.multiplayer.mlapi.runtimetests.asmdef
#	testproject/ProjectSettings/EditorBuildSettings.asset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants