Skip to content

feat: NetcodeHooks added to restore previous IsServer/IsClient logic-gating [MTT-4054] [MTT-4056] #691

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
merged 2 commits into from
Jul 12, 2022

Conversation

fernando-cortez
Copy link
Collaborator

@fernando-cortez fernando-cortez commented Jul 8, 2022

Description

This PR introduces NetcodeHooks, a class used to relay Netcode-based callbacks to other non-NetworkBehaviour components on a NetworkObject that require knowing about a NetworkObject's spawn/despawn events. This is based off of Sam's DGS work here.

With some of the recent refactoring, some "Server..State" "Client..State" classes were not aware of network spawn events and so some server code was executed on clients, and vice-versa, namely ServerBossRoomState.

This restores some of the previous network spawn logic once in place, and makes the game playable as a client now.

Issue Number(s)

MTT-4054, MTT-4056

Contribution checklist

  • Tests have been added for boss room and/or utilities pack
  • Release notes have been added to the project changelog file and/or package changelog file
  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • JIRA ticket ID is in the PR title or at least one commit message
  • Include the ticket ID number within the body message of the PR to create a hyperlink

@fernando-cortez fernando-cortez added 0-URGENT Blocker for a release and needs to be merged ASAP 1-Needs Review PR needs attention from the assignee and reviewers 5-Design Review Draft to review design ideas before committing to future work labels Jul 8, 2022
@fernando-cortez fernando-cortez changed the title feat: NetcodeHooks added to restore previous IsServer/IsClient logic-gating feat: NetcodeHooks added to restore previous IsServer/IsClient logic-gating [MTT-4054] [MTT-4056] Jul 11, 2022
Copy link
Contributor

@LPLafontaineB LPLafontaineB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this solution, much more elegant! Will approve once conflicts are resolved

@pdeschain pdeschain added 3-Good to Merge and removed 1-Needs Review PR needs attention from the assignee and reviewers labels Jul 12, 2022
@fernando-cortez fernando-cortez merged commit eb52c45 into develop Jul 12, 2022
@fernando-cortez fernando-cortez deleted the feat/netcode-hooks-integration branch July 12, 2022 14:29
SamuelBellomo added a commit that referenced this pull request Jul 12, 2022
* develop:
  feat/fix: NetcodeHooks added to restore previous isserver/isclient logic gating [MTT-4054] [MTT-4056] (#691)

# Conflicts:
#	Assets/Prefabs/State/CharSelectState.prefab
#	Assets/Scripts/Gameplay/GameState/ServerBossRoomState.cs
#	Assets/Scripts/Gameplay/GameState/ServerCharSelectState.cs
#	Assets/Scripts/Gameplay/GameState/ServerPostGameState.cs
#	Packages/com.unity.multiplayer.samples.coop/Utilities/Net/NetcodeHooks.cs
#	Packages/com.unity.multiplayer.samples.coop/Utilities/Net/NetcodeHooks.cs.meta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-URGENT Blocker for a release and needs to be merged ASAP 3-Good to Merge 5-Design Review Draft to review design ideas before committing to future work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants