Skip to content

refactor: NetworkAnimator cleanup#4001

Open
noellie-velez wants to merge 3 commits into
develop-2.0.0from
refactor/network-animator-cleanup
Open

refactor: NetworkAnimator cleanup#4001
noellie-velez wants to merge 3 commits into
develop-2.0.0from
refactor/network-animator-cleanup

Conversation

@noellie-velez
Copy link
Copy Markdown
Collaborator

Purpose of this PR

Cleanup:

  • add read-only keyword when applicable
  • made internal fields and methods private when applicable
  • renaming pass
  • remove redundant code
  • replace ContainsKey and Add by TryAdd

Jira ticket

N/A

Changelog

N/A

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

N/A

@noellie-velez noellie-velez marked this pull request as ready for review May 28, 2026 16:33
@noellie-velez noellie-velez requested review from a team and simon-lemay-unity as code owners May 28, 2026 16:33
Copy link
Copy Markdown
Contributor

@simon-lemay-unity simon-lemay-unity left a comment

Choose a reason for hiding this comment

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

Changes to UnityTransport are fine with me.

@noellie-velez noellie-velez marked this pull request as draft May 28, 2026 17:33
@noellie-velez noellie-velez force-pushed the refactor/network-animator-cleanup branch from 9ebf082 to fa030ef Compare May 29, 2026 09:51
@noellie-velez noellie-velez marked this pull request as ready for review May 29, 2026 09:52
@noellie-velez noellie-velez changed the title refactor: network animator cleanup refactor: NetworkAnimator cleanup May 29, 2026
@noellie-velez noellie-velez enabled auto-merge (squash) May 29, 2026 10:02
Copy link
Copy Markdown
Member

@EmandM EmandM left a comment

Choose a reason for hiding this comment

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

There's some really nice changes here. Only a few small comments

{
if (IsServer)
{
/// <see cref="UpdatePendingTriggerStates"/> as to why we queue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We probably still want these log lines, just with // rather than ///. We don't want to lose information.

Maybe move the comments into the XML doc for QueueTriggerUpdateToServer

/// </summary>
/// <param name="animationTriggerMessage">the payload containing the trigger data to apply</param>
/// <param name="clientRpcParams">unused</param>
/// <param name="rpcParams"> unused</param>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Technically this is used, it's just used in the RPC sending.

Suggested change
/// <param name="rpcParams"> unused</param>
/// <param name="rpcParams"> used to send the RPC to be invoked on this client</param>

/// to forward a trigger to a client
/// </summary>
/// <param name="animationTriggerMessage">the payload containing the trigger data to apply</param>
/// <param name="rpcParams"></param>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/// <param name="rpcParams"></param>
/// <param name="rpcParams">Defined as it's used to send the RPC to be invoked on this client</param>

/// Optionally, you can still derive from <see cref="NetworkAnimator"/> and override the <see cref="OnIsServerAuthoritative"/> method.
/// </summary>
/// <returns><see cref="true"/> or <see cref="false"/></returns>
public bool IsServerAuthoritative()
Copy link
Copy Markdown
Member

@EmandM EmandM May 29, 2026

Choose a reason for hiding this comment

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

Hmmm, I know the tests are passing but we might need this defined to release seeing as it's a public function.

Suggested change
public bool IsServerAuthoritative()
/// <returns>True if this <see cref="NetworkAnimator"/> is server authoritative, false otherwise</returns>
public bool IsServerAuthoritative()

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.

4 participants