-
Notifications
You must be signed in to change notification settings - Fork 461
feat: RPC Network Update Order and Network Update Loop Registration #442
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
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
2bbbf5d
Zombie Toys - Adjustments
NoelStephensUnity 87bd6d9
More changes
NoelStephensUnity 4acce29
Minor updates
NoelStephensUnity 16cce8b
MTT-174
NoelStephensUnity 548280b
Merge branch 'develop' into feature/networkupdate
NoelStephensUnity 755009c
WIP
NoelStephensUnity 39f0502
WIP
NoelStephensUnity cadac6a
MTT-327
NoelStephensUnity d130e99
Merge branch 'develop' into feature/rpcqueuerevisited
NoelStephensUnity 00eda77
MTT-367 MTT-327
NoelStephensUnity e1dc42f
Minor update
NoelStephensUnity 5d75987
Merge branch 'feature/rpcqueuerevisited' into feature/networkupdate
NoelStephensUnity 9a09588
Revert "Merge branch 'feature/rpcqueuerevisited' into feature/network…
NoelStephensUnity 7b10b5e
Revert "Revert "Merge branch 'feature/rpcqueuerevisited' into feature…
NoelStephensUnity 4e99f6f
Develop Merge Adjustments
NoelStephensUnity 95bd375
Cluster-Merge
NoelStephensUnity a0032b5
Merge Fix - Batching
NoelStephensUnity 4fb8d9b
Fixes for Batching
NoelStephensUnity fafc49e
feat: network game update loop modular registration MTT-254
NoelStephensUnity c95547f
Merge branch 'develop' into feature/networkupdate
NoelStephensUnity aa9bfa3
fix: updated legacy name from rpcQueueMananger to rpcQueueContainer
NoelStephensUnity 451461b
fix: removed line between properties
NoelStephensUnity dda716b
refactor: Updated for BitReader BitWriter bool
NoelStephensUnity e103a95
refactor: Fixes and Standards
NoelStephensUnity b23eabb
Merge branch 'develop' into feature/networkupdate
NoelStephensUnity a80ea9c
refactor: develop branch merge
NoelStephensUnity ba66825
fix: Using different writers per SendStream, to fix issue with more t…
jeffreyrainy 2bb33a8
refactor: Better divide by 8 option
NoelStephensUnity d6211ac
refactor: Review comment related changes.
NoelStephensUnity 6052a47
refactor: removing USINGUTP
NoelStephensUnity c4d7c9d
refactor: moved rpc queue files
NoelStephensUnity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
com.unity.multiplayer.mlapi/Runtime/Core/NetworkUpdateLoopSystem.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| using System; | ||
| using UnityEngine; | ||
|
|
||
|
|
||
| namespace MLAPI | ||
| { | ||
| /// <summary> | ||
| /// NetworkUpdateLoopBehaviour | ||
| /// Derive from this class if you need to register a NetworkedBehaviour based class | ||
| /// </summary> | ||
| public class NetworkUpdateLoopBehaviour:NetworkedBehaviour,INetworkUpdateLoopSystem | ||
|
NoelStephensUnity marked this conversation as resolved.
Outdated
|
||
| { | ||
| protected virtual Action InternalRegisterNetworkUpdateStage(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| public Action RegisterUpdate(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return InternalRegisterNetworkUpdateStage(stage); | ||
| } | ||
|
|
||
| protected void RegisterUpdateLoopSystem() | ||
| { | ||
| NetworkUpdateManager.NetworkLoopRegistration(this); | ||
| } | ||
|
|
||
| protected void OnNetworkLoopSystemRemove() | ||
| { | ||
| if(onNetworkLoopSystemDestroyed != null) | ||
| { | ||
| onNetworkLoopSystemDestroyed.Invoke(this); | ||
| } | ||
| } | ||
|
|
||
| Action<INetworkUpdateLoopSystem> onNetworkLoopSystemDestroyed; | ||
|
NoelStephensUnity marked this conversation as resolved.
Outdated
|
||
|
|
||
| public void RegisterUpdateLoopSystemDestroyCallback(Action<INetworkUpdateLoopSystem> networkLoopSystemDestroyedCallback) | ||
| { | ||
| onNetworkLoopSystemDestroyed = networkLoopSystemDestroyedCallback; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// UpdateLoopBehaviour | ||
| /// Derive from this class if you only require MonoBehaviour functionality | ||
| /// </summary> | ||
| public class UpdateLoopBehaviour:MonoBehaviour,INetworkUpdateLoopSystem | ||
| { | ||
| protected virtual Action InternalRegisterNetworkUpdateStage(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| public Action RegisterUpdate(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return InternalRegisterNetworkUpdateStage(stage); | ||
| } | ||
|
|
||
| protected void RegisterUpdateLoopSystem() | ||
| { | ||
| NetworkUpdateManager.NetworkLoopRegistration(this); | ||
| } | ||
|
|
||
| protected void OnNetworkLoopSystemRemove() | ||
| { | ||
| if(onNetworkLoopSystemDestroyed != null) | ||
| { | ||
| onNetworkLoopSystemDestroyed.Invoke(this); | ||
| } | ||
| } | ||
|
|
||
| Action<INetworkUpdateLoopSystem> onNetworkLoopSystemDestroyed; | ||
|
NoelStephensUnity marked this conversation as resolved.
Outdated
|
||
|
|
||
| public void RegisterUpdateLoopSystemDestroyCallback(Action<INetworkUpdateLoopSystem> networkLoopSystemDestroyedCallback) | ||
| { | ||
| onNetworkLoopSystemDestroyed = networkLoopSystemDestroyedCallback; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// GenericUpdateLoopSystem | ||
| /// Derive from this class for generic (non-MonoBehaviour) classes | ||
| /// </summary> | ||
| public class GenericUpdateLoopSystem:INetworkUpdateLoopSystem | ||
| { | ||
| protected virtual Action InternalRegisterNetworkUpdateStage(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| public Action RegisterUpdate(NetworkUpdateManager.NetworkUpdateStages stage ) | ||
| { | ||
| return InternalRegisterNetworkUpdateStage(stage); | ||
| } | ||
|
|
||
| protected void RegisterUpdateLoopSystem() | ||
| { | ||
| NetworkUpdateManager.NetworkLoopRegistration(this); | ||
| } | ||
|
|
||
| protected void OnNetworkLoopSystemRemove() | ||
| { | ||
| if(onNetworkLoopSystemDestroyed != null) | ||
| { | ||
| onNetworkLoopSystemDestroyed.Invoke(this); | ||
| } | ||
| } | ||
|
|
||
| Action<INetworkUpdateLoopSystem> onNetworkLoopSystemDestroyed; | ||
|
NoelStephensUnity marked this conversation as resolved.
Outdated
|
||
|
|
||
| public void RegisterUpdateLoopSystemDestroyCallback(Action<INetworkUpdateLoopSystem> networkLoopSystemDestroyedCallback) | ||
| { | ||
| onNetworkLoopSystemDestroyed = networkLoopSystemDestroyedCallback; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| /// <summary> | ||
| /// INetworkUpdateLoopSystem | ||
| /// Use this interface if you need a custom class beyond the scope of GenericUpdateLoopSystem, UpdateLoopBehaviour, and NetworkUpdateLoopBehaviour | ||
| /// </summary> | ||
| public interface INetworkUpdateLoopSystem | ||
| { | ||
| Action RegisterUpdate(NetworkUpdateManager.NetworkUpdateStages stage ); | ||
|
|
||
| void RegisterUpdateLoopSystemDestroyCallback(Action<INetworkUpdateLoopSystem> networkLoopSystemDestroyedCallbsack); | ||
| } | ||
| } | ||
11 changes: 11 additions & 0 deletions
11
com.unity.multiplayer.mlapi/Runtime/Core/NetworkUpdateLoopSystem.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.