Skip to content

feat: RPC Network Update Order and Network Update Loop Registration#442

Merged
NoelStephensUnity merged 31 commits intodevelopfrom
feature/networkupdate
Jan 15, 2021
Merged

feat: RPC Network Update Order and Network Update Loop Registration#442
NoelStephensUnity merged 31 commits intodevelopfrom
feature/networkupdate

Conversation

@NoelStephensUnity
Copy link
Copy Markdown
Member

@NoelStephensUnity NoelStephensUnity commented Jan 14, 2021

MTT-174
This commit provides the ability to:

  • specify at what network update stage an RPC will be invoked on the receiver side.
  • create new network update loop systems that can register an Action with a specific network update loop stage.

Ancillary information:

  • Networking Manager only registers for the PreUpdate and Update stages and now derives from the UpdateLoopBehaviour class (used for MonoBehaviour dependent classes).
  • RpcQueueContainer (formally RpcQueueManager) now registers for all network loop update stages and now derives from the GenericUpdateLoopSystem (for generic classes that don't have MonoBehaviour or NetworkedBehaviour dependencies)
  • There is also a NetworkUpdateLoopBehaviour class that is a Network Update Loop aware NetworkedBehaviour.

Additional updates unrelated to MTT-174:

  • This also provides the ability to enable or disable RPC Batching in the event there is a need to do this for some reason in the future.
  • Hot Fix: RPC Batch Jitter-bug MTT-408

This branch *is not for any prouction use*, but is for a quick holiday port of a Unity Lesson (Chapter 17: Zombie Toys) to a client server architecture.  This currently only supports single player (server authoritative client) and the monster AI (server authoritative).
This branch, however, does include some potential fixes to potential bugs in the current development branch.
Some interesting changes.
Had to add a "destroy" parm to be able to use registered custom destroy callbacks.
Just some tweaks and a useful way to get notified the network session is shutting down.
Added first pass implementation of RPC invocation update stage assignment.
RPCs can now be assigned a specific update stage for the RPC to be invoked.
Starting to get new network update loop registration into place.
Tracking down additional issues.
The rest of the changes for the RPC Queue Revisited jira task MTT-327.
MTT-367 Finalizing some adjustment to conform to the naming standards.
Predominantly updating member property names and formating related changes.
minor update
…update"

This reverts commit 5d75987, reversing
changes made to 39f0502.
Making adjustments from the merge of develop
The RPCQueueRevisited kind of threw this branch into chaos.
These are some of the fixes for the merge issue.
Lost some of the batching changes, also wanted to keep the original RPC Send methods.
This just fixes some of the stutter associated with batching.
Added a more modular way to register with the network loop update system.
This includes four possible paths:
Add the INetworkUpdateLoopSystem to your class declaration and provide the appropriate methods.
=or=
Derive your class from:
GenericUpdateLoopSystem for a slim non-monobehavior derived class.
UpdateLoopBehaviour for a MonoBehaviour derived class.
NetworkUpdateLoopBehaviour for a NetworkedBehaviour derived class.

NetworkingManager now only is updated during the PREUPDATE and UPDATE stages.

RpcQueueContainer now automatically registers for all update stages but also provides the ability for one to handle RPC queue processing externally (i.e.. at different stages).
The updated names and formating for Unity standards will be coming in the RPCQueueRevisited PR
This just applies the fix for bool reading and writing PR #438
Removed the code that extracted the host client id from the connected client list as the bug that invoked that change was finally found and not related to this temporary fix.
Did some standards clean up.
Had to refactor some of the code based on current state of develop branch.
@jeffreyrainy
Copy link
Copy Markdown
Contributor

Added HotFix for MessageBatching: using different writers for different SendStreams.

Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkedObject.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkedObject.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkingManager.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkingManager.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkingManager.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/NetworkingManager.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/RPCQueue/FrameQueueItem.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/RPCQueue/FrameQueueItem.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/RPCQueue/QueueHistoryFrame.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Core/RPCQueue/QueueHistoryFrame.cs Outdated
Comment thread com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Messaging/RpcParams.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Serialization/BitWriter.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Spawning/SpawnManager.cs Outdated
Comment thread com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs Outdated
Copy link
Copy Markdown
Contributor

@0xFA11 0xFA11 left a comment

Choose a reason for hiding this comment

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

I'll have another thorough look at this PR.

Comment thread com.unity.multiplayer.mlapi/Runtime/Core/MessageBatcher.cs
Comment thread com.unity.multiplayer.mlapi/Runtime/Serialization/BitWriter.cs Outdated
The majority of these changes are syntax/standard oriented, but there are a few good catches like removing C# 8.0 standard "using", try an catches left in, and some const definitions for some of the RPC queue related boundary checking.
Removing the ifdef.
Moving the RPC queue related files to the Messaging directory since they are within the same namespace (and it is the proper location for them).
@NoelStephensUnity NoelStephensUnity merged commit 634a140 into develop Jan 15, 2021
@NoelStephensUnity NoelStephensUnity deleted the feature/networkupdate branch March 2, 2021 21:17
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.

3 participants