Skip to content

feat(auth): add GetPlayerBanStatus endpoint and ban info in error data#469

Merged
kirre-bylund merged 2 commits into
devfrom
feat/1501-player-ban-reason
May 29, 2026
Merged

feat(auth): add GetPlayerBanStatus endpoint and ban info in error data#469
kirre-bylund merged 2 commits into
devfrom
feat/1501-player-ban-reason

Conversation

@kirre-bylund
Copy link
Copy Markdown
Contributor

Summary

Implements lootlocker/index#1501 — Add player ban reason to SDKs.

Two changes:

  1. New GetPlayerBanStatus method — calls POST /game/session/ban-status using the game API key (no player session required). Returns whether a player is banned and, if so, the ban details.
  2. Ban info on session 403 — when a session start returns 403 with code: "player_banned", the errorData.ban field is now populated with the ban reason, timestamps, and permanent flag.

Files changed

New files

  • Runtime/Game/Requests/LootLockerBanRequest.csLootLockerBanInfo, LootLockerBanStatusRequest, LootLockerBanStatusResponse
  • Tests/LootLockerTestUtils/LootLockerTestConfigurationBan.csLootLockerTestPlayerBan helper (ban/unban via admin API)
  • Tests/LootLockerTests/PlayMode/BanTest.cs — 3 integration tests

Modified files

  • Runtime/Client/LootLockerErrorData.cs — added LootLockerBanInfo ban field
  • Runtime/Client/LootLockerEndPoints.cs — added banStatusRequest endpoint
  • Runtime/Game/LootLockerSDKManager.cs — added GetPlayerBanStatus(playerUlid, onComplete)
  • Tests/LootLockerTestUtils/LootLockerTestConfigurationEndpoints.cs — added banPlayer / unbanPlayer admin endpoints

Tests

  • GetPlayerBanStatus_ForUnbannedPlayer_ReturnsNotBanned (LootLockerCIFast)
  • StartSession_ForBannedPlayer_Returns403WithBanInfo (LootLockerCI)
  • GetPlayerBanStatus_ForBannedPlayer_ReturnsIsBannedWithDetails (LootLockerCI)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 new session/ban-status endpoint constant.
  • Extended LootLockerErrorData with a ban field (LootLockerBanInfo) intended to be populated for player_banned errors.
  • 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.

Comment thread Tests/LootLockerTestUtils/LootLockerTestConfigurationBan.cs
Comment thread Tests/LootLockerTestUtils/LootLockerTestConfigurationBan.cs
- 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
@kirre-bylund kirre-bylund force-pushed the feat/1501-player-ban-reason branch from 4b5d8f7 to 33e8479 Compare May 29, 2026 11:05
@kirre-bylund kirre-bylund merged commit 4110c47 into dev May 29, 2026
69 of 70 checks passed
@kirre-bylund kirre-bylund deleted the feat/1501-player-ban-reason branch May 29, 2026 12:06
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