feat(auth): add GetPlayerBanStatus endpoint and ban info in error data#469
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support for player ban visibility in the Unity SDK by introducing a new ban-status endpoint and surfacing ban details in error payloads, with PlayMode integration tests to validate both the new API and session-start behavior for banned players.
Changes:
- Added
LootLockerSDKManager.GetPlayerBanStatus(playerUlid, onComplete)backed by a new request/response model and a newsession/ban-statusendpoint constant. - Extended
LootLockerErrorDatawith abanfield (LootLockerBanInfo) intended to be populated forplayer_bannederrors. - Added admin test utilities + PlayMode tests to ban/unban players and verify both ban status and session 403 behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/LootLockerTestUtils/LootLockerTestConfigurationEndpoints.cs | Adds admin API endpoint constants for banning/unbanning players. |
| Tests/LootLockerTestUtils/LootLockerTestConfigurationBan.cs | Introduces admin test helper to ban/unban a player via admin API. |
| Tests/LootLockerTests/PlayMode/BanTest.cs | Adds integration tests covering ban status and banned-session error behavior. |
| Runtime/Game/Requests/LootLockerBanRequest.cs | Adds ban DTO + ban-status request/response types used by the new API. |
| Runtime/Game/LootLockerSDKManager.cs | Adds the public GetPlayerBanStatus SDK method. |
| Runtime/Client/LootLockerErrorData.cs | Adds errorData.ban field to surface ban details on failures. |
| Runtime/Client/LootLockerEndPoints.cs | Adds banStatusRequest endpoint definition. |
69e1ba0 to
4b5d8f7
Compare
- Add LootLockerBanInfo DTO with ban_reason, banned_on, banned_until, permanent - Add LootLockerBanStatusRequest/Response in LootLockerBanRequest.cs - Add LootLockerBanInfo ban field to LootLockerErrorData for player_banned 403 responses - Add banStatusRequest endpoint (POST session/ban-status) - Add LootLockerSDKManager.GetPlayerBanStatus(playerUlid, onComplete) - Add admin test helpers: banPlayer and unbanPlayer in LootLockerTestConfigurationBan.cs - Add banPlayer/unbanPlayer endpoints in LootLockerTestConfigurationEndpoints.cs - Add BanTest.cs with 3 integration tests covering ban status and session rejection
4b5d8f7 to
33e8479
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements lootlocker/index#1501 — Add player ban reason to SDKs.
Two changes:
GetPlayerBanStatusmethod — callsPOST /game/session/ban-statususing the game API key (no player session required). Returns whether a player is banned and, if so, the ban details.code: "player_banned", theerrorData.banfield is now populated with the ban reason, timestamps, and permanent flag.Files changed
New files
Runtime/Game/Requests/LootLockerBanRequest.cs—LootLockerBanInfo,LootLockerBanStatusRequest,LootLockerBanStatusResponseTests/LootLockerTestUtils/LootLockerTestConfigurationBan.cs—LootLockerTestPlayerBanhelper (ban/unban via admin API)Tests/LootLockerTests/PlayMode/BanTest.cs— 3 integration testsModified files
Runtime/Client/LootLockerErrorData.cs— addedLootLockerBanInfo banfieldRuntime/Client/LootLockerEndPoints.cs— addedbanStatusRequestendpointRuntime/Game/LootLockerSDKManager.cs— addedGetPlayerBanStatus(playerUlid, onComplete)Tests/LootLockerTestUtils/LootLockerTestConfigurationEndpoints.cs— addedbanPlayer/unbanPlayeradmin endpointsTests
GetPlayerBanStatus_ForUnbannedPlayer_ReturnsNotBanned(LootLockerCIFast)StartSession_ForBannedPlayer_Returns403WithBanInfo(LootLockerCI)GetPlayerBanStatus_ForBannedPlayer_ReturnsIsBannedWithDetails(LootLockerCI)