-
Notifications
You must be signed in to change notification settings - Fork 450
test: sending multiple clients RPC messages in various combinations for RPC Queue validation purposes #635
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
This removes the NetworkManager.Singleton dependencies from within the RpcQueueContainer and RpcQueueProcessor classes. This further strengthens the RPC Queue system as a whole, will allow for multiple instances if RpcQueueContainer, removes a limitation I set in NetworkWriter.ReadAndWrite, and provides unit testing capabilities required for new RPC Queue unit Tests.
The new rpc queue tests without all of the extra files associated with them.
Added some additional prefabs to make creating a new scene simpler. Added a ManualTests folder where manual tests can live. Added ClientRpcTesting scene that tests sending to one client, multiple clients, and all clients in many different combinations.
/// This creates a NetworkManger, | ||
/// </summary> | ||
/// <returns></returns> | ||
public static bool StartNetworkManager() |
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.
Nit but this should probably be clear that it's starting a network manager as host
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.
+1
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.
I added the capability for one to start the NetworkManager in Host, Server, or client mode. You should be able to switch modes during testing if one needed to test specific aspects of the Server or Client modes.
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.
Please review adjustment.
Noticed there was an empty GameObject in the testing scene, so I removed it.
Condensed the initialization process. Adjusted the comments to better match the user story (testing and what is being tested). Adjusted-polished up some UI related items like the visual name or concept relating to a specific counter, etc.
Minor LF adjustment and permissions declaration for m_GlobalCounterOffset property
Just renamed the Rpc Test scene to better reflect that it tests client and server rpcs.
Added 4 new tests that send no parameters and multiple parameters both directions (server to client and vice versa).
/// </summary> | ||
public class ClientCounterBehaviour : NetworkBehaviour | ||
{ | ||
private const float k_ProgressBarDivisor = 1.0f/200.0f; |
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.
private const float k_ProgressBarDivisor = 1.0f/200.0f; | |
private const float k_ProgressBarDivider = 1.0f/200.0f; |
divider vs divisor? 🤔
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.
Actually in this case it's neither, it's a scale-down factor ;)
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.
Actually, it is used as a divisor in the code base... it just handles dividing into zero without having to check.
Divisor: a number by which another number is to be divided.
private bool m_MutliParameterCanSend; | ||
|
||
private int m_MutliParameterIntValue; | ||
private int m_MutliParameterValuesCount; | ||
private int m_MutliParameterNoneCount; | ||
private int m_RpcMessagesSent; | ||
private int m_GlobalCounter; | ||
private int m_GlobalDirectCounter; | ||
private int m_GlobalDirectCurrentClientIdIndex; | ||
private int m_localClientCounter; | ||
private int m_GlobalCounterOffset; | ||
private int m_RpcPerSecond; | ||
private int m_GlobalDirectScale; | ||
|
||
private long m_MutliParameterLongValue; | ||
private ulong m_LocalClientId; | ||
|
||
private float m_MutliParameterFloatValue; | ||
private float m_GlobalCounterDelay; | ||
private float m_DirectGlobalCounterDelay; | ||
private float m_LocalCounterDelay; | ||
private float m_LocalMultiDelay; | ||
private float m_RpcPerSecondTimer; | ||
private float m_GlobalDirectFrequency; |
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.
private bool m_MutliParameterCanSend; | |
private int m_MutliParameterIntValue; | |
private int m_MutliParameterValuesCount; | |
private int m_MutliParameterNoneCount; | |
private int m_RpcMessagesSent; | |
private int m_GlobalCounter; | |
private int m_GlobalDirectCounter; | |
private int m_GlobalDirectCurrentClientIdIndex; | |
private int m_localClientCounter; | |
private int m_GlobalCounterOffset; | |
private int m_RpcPerSecond; | |
private int m_GlobalDirectScale; | |
private long m_MutliParameterLongValue; | |
private ulong m_LocalClientId; | |
private float m_MutliParameterFloatValue; | |
private float m_GlobalCounterDelay; | |
private float m_DirectGlobalCounterDelay; | |
private float m_LocalCounterDelay; | |
private float m_LocalMultiDelay; | |
private float m_RpcPerSecondTimer; | |
private float m_GlobalDirectFrequency; | |
private bool m_MultiParameterCanSend; | |
private int m_MultiParameterIntValue; | |
private int m_MultiParameterValuesCount; | |
private int m_MultiParameterNoneCount; | |
private int m_RpcMessagesSent; | |
private int m_GlobalCounter; | |
private int m_GlobalDirectCounter; | |
private int m_GlobalDirectCurrentClientIdIndex; | |
private int m_LocalClientCounter; | |
private int m_GlobalCounterOffset; | |
private int m_RpcPerSecond; | |
private int m_GlobalDirectScale; | |
private long m_MultiParameterLongValue; | |
private ulong m_LocalClientId; | |
private float m_MultiParameterFloatValue; | |
private float m_GlobalCounterDelay; | |
private float m_DirectGlobalCounterDelay; | |
private float m_LocalCounterDelay; | |
private float m_LocalMultiDelay; | |
private float m_RpcPerSecondTimer; | |
private float m_GlobalDirectFrequency; |
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.
I applied this update in b798e82 which included all references to said variables.
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
Changed all occurrences of Mutli to Multi
This reverts commit 0ec8343.
Replaced all occurrences of Mutli to Multi
private int m_GlobalCounter; | ||
private int m_GlobalDirectCounter; | ||
private int m_GlobalDirectCurrentClientIdIndex; | ||
private int m_localClientCounter; |
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.
private int m_localClientCounter; | |
private int m_LocalClientCounter; |
😛
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.
commit 50815a8 resolves this issue.
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.
spaceship-it-to-the-moon 🚀
Minor PascalCase adjustment for private property m_LocalClientCounter.
The following test can be used to verify that the RPC Queue allows for the sending of ClientRpcs to specific clients.
It has several "direct" methods of sending as is defined in the enum ClientCounterBehaviour.ClientRpcDirectTestingModes:
Each direct testing mode sends a count value starting at 0 up to 100.
Each direct testing mode sends to all clients at least once during testing (sometimes twice in striped)
During direct testing mode the following is also tested:
During all tests the following additional Rpc Tests are performed: