-
Notifications
You must be signed in to change notification settings - Fork 450
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
Conversation
[UnitySetUp] | ||
public override IEnumerator Setup() | ||
{ | ||
yield return StartSomeClientsAndServerWithPlayers(useHost: true, nbClients: NbClients, | ||
// this is treacherous...normally BaseMultiInstance calls StartSomeClientsAndServerWithPlayers for you |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; | |||
|
|||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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... |
There was a problem hiding this comment.
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
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