-
Notifications
You must be signed in to change notification settings - Fork 0
Achievements progresses eventsub subscriptions frontend #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Darosss
merged 4 commits into
achievements-progresses-eventsub-subscriptions
from
achievements-progresses-eventsub-subscriptions-frontend
Nov 28, 2023
Merged
Achievements progresses eventsub subscriptions frontend #87
Darosss
merged 4 commits into
achievements-progresses-eventsub-subscriptions
from
achievements-progresses-eventsub-subscriptions-frontend
Nov 28, 2023
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
- change obtainedAchievement state type to ObtainedAchievementStateType - change to play sounds with achievement progress or obtained acheivements depends which one is received - move obtained achievement data into separate component AchievementDataBlock - create AchievementProgressDataBlock for achievement progresses
Darosss
added a commit
that referenced
this pull request
Nov 28, 2023
* Achievements progresses eventsub subscriptions server (#86) * feat(models/achievements): add showProgress to AchievementModel * feat(auth/scopes): add new scopes for auth url - add channel:read:subscriptions - add bits:read * feat(defaults/achievements): add new achievements to ACHIEVEMENTS enum - add SUBSCRIBTIONS_TIER_1, SUBSCRIBTIONS_TIER_2, SUBSCRIBTIONS_TIER_3, SENT_SUBSCRIBTIONS_GIFTS_CUMULATIVE, SENT_SUBSCRIBTIONS_GIFTS_TIER_1, SENT_SUBSCRIBTIONS_GIFTS_TIER_2, SENT_SUBSCRIBTIONS_GIFTS_TIER_3, SENT_SUBSCRIBTIONS_GIFTS_AS_PACK_TIER_1, SENT_SUBSCRIBTIONS_GIFTS_AS_PACK_TIER_2, SENT_SUBSCRIBTIONS_GIFTS_AS_PACK_TIER_3, RECEIVED_SUBSCRIBTIONS_GIFTS, BOUGHT_SUBSCRIBTIONS * feat(defaults/achievements): add new default achievements - add new default achievements connected with: 1282a97 * feat(socket/types): add separate types to work with progress achievement dataTypes: - rename ObtainAchievementData to ObtainAchievementBaseData - remove stage from ObtainAchievementBaseData - add ObtainAchievementDataStageType - add ObtainAchievementDataProgressDataType - add ObtainAchievementDataWithCollectedAchievement - add ObtainAchievementDataWithProgressOnly clientToServier: - replace types in emulateAchievement to ObtainAchievementDataWithCollectedAchievement serverToClient: - replace types in obtainAchievement to ObtainAchievementDataWithCollectedAchievement | ObtainAchievementDataWithProgressOnly * feat(socket): add isObtainedAchievement function * refactor(createUserIfNotExist): change way how get/creatae user - replace usage of isUserInDB to findneAndUpdate wit option upsert:true - this change let program to find or create if not exist * feat(services/achievements): add handling for obtained achievement progresses types: - add GainedProgress type - add gainedProgress to UpdateAchievementUserProgressProgressesReturnData add UpdateFinishedStagesDependsOnProgressReturnData type GetDataForObtainAchievementEmitReturnData type: - change achievement type to ObtainAchievementBaseData["achievement"] - change stages type to ObtainAchievementDataWithCollectedAchievement["stage"][] - add gainedProgress property achievementUserProgresses: in updateOneAchievementUserProgress: - add updateData.progresses.length when no progresses were in doc in updateFinishedStagesDependsOnProgress: - destructure achievement and achievementProgress for needed data - add gainedProgress to returnData - add else if showProgress is true and stage progress is not finished or it is last index - add returnData.nowFinishedStages to updateOneAchievementUserProgress - replace return newfinishedStages; to return returnData; in getDataForObtainAchievementEmit: - add helper getGainedProgressReturnData - to retrieve gained progress data - add gainedProgress to return data - destructure foundAchievement to get stageData - newStages.push - change push type from tuple to object * feat(EventSubHandler): add new subscriptions + achievement logic - add achievementsHandler to class property and constructor methods: - add subscribeToChannelSubscription - add subscribeToChannelSubscriptionGift - add subscribeToChannelFollow - add above listed into initEvents method add SubscriptionTiers type * feat(stream/initializeHandlers): add achievmeentHandler to eventSubHandler opts * feat(AchievementsHandler): add handling for obtained achievements progress - add CheckUserSubscribeForAchievementsParams type - add CheckUserSubscribeGiftsForAchievementsParams type - add AddAchievementProgressDataToQueueData - add AddAnonymousAchievementProgressData - change type of QueueHandler generic to ObtainAchievementDataWithCollectedAchievement | ObtainAchievementDataWithProgressOnly methods: - in startTimeout set timeoutDelat depends if its [...]ObtainedAchievement or [...]ProgressOnly type in handleDiscordAnnoucment change type of item to ObtainAchievementDataWithCollectedAchievement - in getDiscordAchievementMessage change type of params to ObtainAchievementDataWithCollectedAchievement - in enqueue change type of item to ObtainAchievementDataWithCollectedAchievement | ObtainAchievementDataWithProgressOnly - in updateAchievementUserProgressAndAddToQueue add condition for add achievement progress - add addAnonymousAchievementProgress method - add addAchievementProgressDataToQueue - in addObtainedAchievementDataToQueue add type assertion to enqueu data to ObtainAchievementDataWithCollectedAchievement - in emitObtainAchievement change emitData to ObtainAchievementDataWithCollectedAchievement | ObtainAchievementDataWithProgressOnly - in checkUserFollowageForAchievement add 1 minute to twitch follow time, to prevent program gets times like -1 - add checkUserSubscribeForAchievements - add checkUserSubscribeGiftsForAchievements * Achievements progresses eventsub subscriptions frontend (#87) * feat(utils/socketData): add isObtainedAchievement function * refactor(socket): replace to proper types in emulateAchievement emit * refactor(AchievementStageDisplayData): change to object type in emulateAchievement * feat(overlay/Achievements): add display achievement progress - change obtainedAchievement state type to ObtainedAchievementStateType - change to play sounds with achievement progress or obtained acheivements depends which one is received - move obtained achievement data into separate component AchievementDataBlock - create AchievementProgressDataBlock for achievement progresses
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.
No description provided.