Skip to content

fix: server doesn't apply triggers to itself; add host and server Animation tests (#1746) #1751

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 5 commits into from
Feb 25, 2022

Conversation

mattwalsh-unity
Copy link
Contributor

This is a bug found while looking at the other animation things. When the server sets a trigger it forwards it but does not apply it to itself. Hence it works in Host mode, hence it passes the tests up to this commit in which I add server and host tests.

MTT-2643

Changelog

Testing and Documentation

  • Includes updates to integration tests.
  • No documentation changes or additions were necessary.

[UnitySetUp]
public override IEnumerator Setup()
{
yield return StartSomeClientsAndServerWithPlayers(useHost: true, nbClients: NbClients,
// this is treacherous...normally BaseMultiInstance calls StartSomeClientsAndServerWithPlayers for you
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NoelStephensUnity this was what I was trying to convey in our slack thread

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a way to handle this a little more gracefully in the NetcodeIntegraitonTest, and was why I included an example of how to do this in the documentation (because the way it is currently can be problematic to figure out the best way to achieve the same kind of results).

@@ -18,10 +18,21 @@ public class NetworkAnimatorTests : BaseMultiInstanceTest
private Animator m_PlayerOnServerAnimator;
private Animator m_PlayerOnClientAnimator;


Copy link
Contributor

Choose a reason for hiding this comment

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

so I'm not sure how changes in this test file actually tests against the fix proposed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before, we just called Setup and set things up in host mode. Host mode passed the old code with the bug, because the bug only shows up in server mode. The new test code now supports host and server mode and would expose the bug (if it wasn't fixed)

@@ -359,8 +360,23 @@ public void SetTrigger(int hash, bool reset = false)

if (IsServer)
{
// trigger the animation locally on the server...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the missing server animation update bug fix

…-Technologies/com.unity.multiplayer.mlapi into fix/triggers-dont-play-server-anim
@mattwalsh-unity mattwalsh-unity enabled auto-merge (squash) February 25, 2022 16:58
@mattwalsh-unity mattwalsh-unity merged commit 0f4109b into develop Feb 25, 2022
@mattwalsh-unity mattwalsh-unity deleted the fix/triggers-dont-play-server-anim branch February 25, 2022 17:57
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