SWU Forge Deck Stats Integration#2309
Draft
acousineau wants to merge 10 commits intoSWU-Karabast:mainfrom
Draft
Conversation
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
Adds SWU Forge (swuforge.com) as a new stat tracking destination, following the same pattern as the existing SWUBase integration. When a game ends, results and per-card metrics are sent to SWU Forge for players who have linked their
accounts.
SwuForgeHandler— handles OAuth2 token exchange, refresh, revocation, and game result delivery{set}_{number}card keys and per-card metrics (played, resourced, activated, drawn, discarded)Changes
SwuForgeHandler.ts— New stat handler withsendGameResultAsync,linkAccountAsync,unlinkAccountAsync, token managementStatHandlerTypes.ts— AddedSwuForgetoRefreshTokenSourceenumDeckInterfaces.ts— AddedSwuForgetoDeckSourceenumDeck.ts— Addedswuforge.comURL detection indetermineDeckSource()DynamoDBInterfaces.ts— AddedswuforgeRefreshTokenfield toIUserDataEntityUserFactory.ts— Added refresh token field mapping + new user defaultstatsMessages.ts— AddedSwuForgesource,SwuForgeSuccessmessage keyGameServer.ts— Handler instantiation, token mapping,/api/user/:userId/swuforgeLinkcheck endpoint,/api/link-swuforgeand/api/unlink-swuforgeendpoints, token cleanupLobby.ts—updatePlayerSwuForgeAsync()method, wired intoendGameUpdateStatsAsync()with status messagesenv.ts— AddedSWUFORGE_CLIENT_ID,SWUFORGE_CLIENT_SECRET,SWUFORGE_API_URLenv varsEnvironment Variables
SWUFORGE_CLIENT_IDSWUFORGE_CLIENT_SECRETSWUFORGE_API_URLhttps://swuforge.comTest Plan
tsc --noEmit)/api/link-swuforgewith valid authorization code/api/unlink-swuforgeas authenticated user/api/user/:userId/swuforgeLinkswuforge.comdeck link