Skip to content

Add banGroupUsers function (#84) - #205

Merged
VBorisof merged 2 commits into
heroiclabs:masterfrom
greenSwanz:add-ban-group-users
Jul 7, 2026
Merged

Add banGroupUsers function (#84)#205
VBorisof merged 2 commits into
heroiclabs:masterfrom
greenSwanz:add-ban-group-users

Conversation

@greenSwanz

Copy link
Copy Markdown
Contributor

Closes #84.

Adds the missing banGroupUsers client function, which was present in the other Nakama SDKs (Go, JS, .NET) but absent from the C++ client.

Implementation

  • Uses the existing kickGroupUsers pattern across NClientInterface.h, BaseClient (async wrapper), and RestClient (REST implementation).
  • POSTs to /v2/group/{groupId}/ban, matching the server endpoint and the other SDKs.
  • Added an integration test (test_addAndBanGroupUser) in test_groups.cpp, registered in test_groups(), similar to test_addAndKickGroupUser.

Note on gRPC

REST client only for now. I noticed sessionLogout is also REST-only, so I followed that since the gRPC version would need a BanGroupUsersRequest type and an AsyncBanGroupUsers stub, and neither is in the generated API yet. Can extend to gRPC if you want the API definitions regenerated.

Testing

The change compiles cleanly on Windows (win-x64, MSVC). I haven't run the integration suite locally as it requires a running server, but the test mirrors the existing kickGroupUsers coverage and is ready for CI.

@CLAassistant

CLAassistant commented Jul 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread core/core-rest/RestClient.cpp Outdated
std::function<void()> successCallback,
ErrorCallback errorCallback) {
try {
NLOG_INFO("...");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution. This is probably leftover from your testing :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that was carried over from the kick method. Removed it and pushed.

@VBorisof VBorisof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great, thank you for the contribution! 🙂

@VBorisof
VBorisof merged commit 1d688b5 into heroiclabs:master Jul 7, 2026
1 of 2 checks passed
@greenSwanz
greenSwanz deleted the add-ban-group-users branch July 8, 2026 13:05
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.

Add Ban Group Users Function

4 participants