Skip to content

chore: allowing multiple Connection Approval handlers. [MTT-3496] #1964

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

Closed

Conversation

jeffreyrainy
Copy link
Contributor

chore: allowing multiple Connection Approval handlers. Using the decision after they all got a chance to decide

[MTT-3496]

Changelog

  • [breaking] Allow multiple Connection Approval handlers.
    public delegate void ConnectionApprovalDelegate(byte[] payload, ulong clientId, ConnectionApprovalDecision decision); now receives a ConnectionApprovalDecision class that must be filled, instead of calling a second callback. This allows having multiple Connection Approval handlers. (Exception when there are multiple connectional approval callbacks #1941)

@jeffreyrainy jeffreyrainy requested review from 0xFA11 and TwoTenPvP May 13, 2022 01:21
@jeffreyrainy jeffreyrainy requested a review from a team as a code owner May 13, 2022 01:21
@@ -165,14 +165,17 @@ private void ConnectionApprovalCallback(byte[] dataToken, ulong clientId, Networ

if (m_GlobalObjectIdHashOverride != 0 && m_PlayerPrefabOverride && m_PlayerPrefabOverride.isOn)
{
aprovalCallback.Invoke(true, m_GlobalObjectIdHashOverride, isTokenValid, null, null);
decision.Approved = isTokenValid;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those three lines should be the first focus. The API changed in this way: instead of asking the client code to call a callback, they fill a class with their decision. All the approval handler get to run before the decision is used. Then, the decision is used just once.

@jeffreyrainy
Copy link
Contributor Author

Superseded by #1972

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.

2 participants