Skip to content

refactor!: connection approval#2002

Merged
0xFA11 merged 8 commits intodevelopfrom
refactor/connection-approval
Jun 7, 2022
Merged

refactor!: connection approval#2002
0xFA11 merged 8 commits intodevelopfrom
refactor/connection-approval

Conversation

@jeffreyrainy
Copy link
Copy Markdown
Contributor

Adjust the connection approval flow, which was changed in previous release. This puts back the ability to delay approval.

  • The Connection Approval callback is now: public Action<ConnectionApprovalRequest, ConnectionApprovalResponse> ConnectionApprovalCallback;
  • The ConnectionApprovalResponse goes from a struct to a class, and gets reference semantics.
  • Client code doesn't allocate ConnectionApprovalResponse, they write to the response we allocate for them
  • Client code can set the response .Pending member to true, to indicate it is still processing the approval and set .Pending to false, later, once it has decide to approve or reject the connection.

Changelog

Pending changes will come in a later commit.

Testing and Documentation

MultiClientConnectionApproval now tests both immediate and delayed approval.

@jeffreyrainy jeffreyrainy requested a review from a team as a code owner June 7, 2022 15:01
@0xFA11 0xFA11 changed the title refactor: connection approval refactor!: connection approval Jun 7, 2022
Copy link
Copy Markdown
Contributor

@JesseOlmer JesseOlmer left a comment

Choose a reason for hiding this comment

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

The change to ConnectionApprovalResponse type, and the callback change from Func to Action are both breaking changes which should constitute a 2.0 rev of ngo. @ThusWroteNomad @lpmaurice is that on the table currently?

Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs Outdated
Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs Outdated
@0xFA11
Copy link
Copy Markdown
Contributor

0xFA11 commented Jun 7, 2022

@JesseOlmer

The change to ConnectionApprovalResponse type, and the callback change from Func to Action are both breaking changes which should constitute a 2.0 rev of ngo. @ThusWroteNomad @lpmaurice is that on the table currently?

since we haven't released NGO 1.0 yet, this area (connection approval) was one of the exceptions post pre.9 that we said OK for API breaking changes — and since we already changed the API just a few weeks ago, making this modification before we fully release NGO 1.0 should be OK too.

not ideal but still better than leaving the door open for misuse after 1.0 release or leaving it as is right now and taking away the functionality of delaying approval result from devs.

Comment thread com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs Outdated
Copy link
Copy Markdown
Contributor

@SamuelBellomo SamuelBellomo left a comment

Choose a reason for hiding this comment

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

Tested with boss room and I confirm we can receive custom messages with this

Copy link
Copy Markdown
Contributor

@JesseOlmer JesseOlmer left a comment

Choose a reason for hiding this comment

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

lgtm

@0xFA11 0xFA11 merged commit 55c1e62 into develop Jun 7, 2022
@0xFA11 0xFA11 deleted the refactor/connection-approval branch June 7, 2022 19:27
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