-
Notifications
You must be signed in to change notification settings - Fork 13
Update constants/magic numbers #100
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
Open
jonbarrow
wants to merge
64
commits into
master
Choose a base branch
from
chore/magic-numbers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,348
−737
Open
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
d0fa7d1
feat(messaging): add MaxStringLength and MaxBinarySize constants
jonbarrow 055591a
feat(match-making): add missing constant values
jonbarrow d298534
feat(match-making): add MatchmakeGeoIpResult enum
jonbarrow 203ef4f
chore(match-making): make MatchmakeSelectionMethod enum consistent wi…
jonbarrow a2a58bf
feat(match-making): add GatheringFlags enum
jonbarrow 22653a5
feat(match-making): add MatchmakeSessionOption0 enum
jonbarrow eba96db
feat(match-making): add MatchmakeOption enum
jonbarrow c66ee65
feat(match-making): add AutoMatchmakeOption enum
jonbarrow 9b9e2c5
chore(match-making): add usage details to JoinMatchmakeSessionBehavio…
jonbarrow 3c813d8
fix(match-making): MatchmakeSessionOption0 are flags not enum
jonbarrow 6844477
feat(match-making): add FindMatchmakeSessionResultOption flags
jonbarrow cbdb0b3
feat(match-making): add MatchmakeSessionModificationFlag flags
jonbarrow 3513902
chore(match-making): expand MatchmakeSelectionMethod Godoc comments
jonbarrow e6e7436
feat(match-making): add AnybodyParticipationPolicyArgument enum
jonbarrow 59183ed
feat(match-making): add ParticipationPolicy types
jonbarrow 133cafb
fix(match-making): fix typo in MatchmakeSessionOption0None Godoc comment
jonbarrow a09b042
fix(match-making): fix AnybodyParticipationPolicyArgument typos
jonbarrow f432772
feat(notifications): add NotificationEvents types
jonbarrow b809493
feat(notifications): add NotificationEvents.Build() method
jonbarrow a753fb4
fix(notifications): add protocol to UpdateNotificationData mentions
jonbarrow a5e83f3
feat(notifications): add ParticipationEvents
jonbarrow 57169f2
fix(notifications): add Godoc comment to NotificationEvents.Build()
jonbarrow 7b1d19e
fix(notifications): fix ParticipationEventsParticipate name
jonbarrow ad2f935
fix(notifications): fix ParticipationEventsParticipate comment
jonbarrow 23caa16
feat(notifications): add SubscriptionEvents
jonbarrow 216c009
feat(notifications): remove old category/subtype handling
jonbarrow abff4f7
feat(match-making): add HasFlag and HasFlags methods to flag types
jonbarrow 85e9e91
fix(notifications): make NotificationEvents.Build() return types.UInt32
jonbarrow fde236b
feat(match-making): change AutoMatchmakeParam to use AutoMatchmakeOption
jonbarrow 72fe2cb
feat(match-making): add IsValid method to all enum types
jonbarrow 9678fc7
chore(match-making): add PolicyArgument type
jonbarrow 041e423
feat(match-making): add GatheringState type
jonbarrow eb731a0
chore(match-making): remove IsValid method from AnybodyParticipationP…
jonbarrow 23fbe4e
feat(match-making): make FindMatchmakeSessionByParticipantParam use F…
jonbarrow 51b81d7
feat(match-making): make Gathering uses new constants
jonbarrow 3188a13
feat(match-making): make JoinMatchmakeSessionParam use JoinMatchmakeS…
jonbarrow 89bd749
chore(match-making): rename GatheringStateClosed to GatheringStateLocked
jonbarrow e8e84a3
feat(match-making): make MatchmakeSessionSearchCriteria uses new cons…
jonbarrow 4d755ab
chore(match-making): add ExtractFrom and WriteTo methods to add const…
jonbarrow e0955e9
feat(match-making): make MatchmakeSession uses new constants
jonbarrow 8553249
feat(match-making): make UpdateMatchmakeSessionParam uses new constants
jonbarrow 545c76a
chore(match-making): remove IsValid methods from constants
jonbarrow 374cb36
feat(match-making): make SetState use GatheringState constant
jonbarrow 3b1af2e
feat(notifications): add NotificationEvent.MapParam
jonbarrow 48bb56c
feat(notifications): make NotificationEvent use NotificationEvents co…
jonbarrow d8468a8
feat(notifications): add NotificationEventsEagleAddress
jonbarrow d0cc42c
chore(match-making): remove legacy GatheringFlags file
jonbarrow 8e46be7
chore(subscriber): update unknown param/type names
jonbarrow 1bb3d8f
feat(subscriber): add constants
jonbarrow 4c26949
feat(ranking): add missing ranking constants
jonbarrow db46dd5
feat(ranking): make ranking protocol use new constants/enums
jonbarrow d1a9468
feat(ranking2): add all constants
jonbarrow 02c11f2
feat(ranking2): make ranking2 protocol use new constants/enums
jonbarrow 2e35b3a
chore(matchmake-extension): use notifications constants in DebugNotif…
jonbarrow 8b7fd51
fix(datastore): GetObjectInfos takes in a types.List[types.UInt64]
jonbarrow 3fa4fc7
feat(datastore): make datastore protocol use new constants/enums
jonbarrow b7bf4f5
feat(notifications): split notification event and category
jonbarrow e59c9c0
feat(notifications): create NotificationCategorySigned
jonbarrow 14495d6
fix(datastore): ResetRatings takes in a types.List[types.UInt64]
jonbarrow 4b028e1
fix(subscriber): add proper Godoc comments to SubscriberUserStatusParam
jonbarrow d579bce
feat(ranking2): add bespoke Ranking2ResetDay
jonbarrow cf676e6
feat(ranking2): add bespoke Ranking2ResetMonth
jonbarrow b462290
feat(nintendo-notifications): add NintendoNotificationEventProfile
jonbarrow f2663cc
feat(nintendo-notifications): add bespoke NotificationType type
jonbarrow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should split the type into the categories and the full type with the subtype. Mixing these types together is counter-intuitive
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean? This was done because
NotificationEvent.Type
is now of typeconstants.NotificationEvents
. So when we build theNotificationEvent
instance we would do this directly:If it was kept as a
types.UInt32
then we would have to explicitly cast the return value every time:I'm not sure what you mean by counter-intuitive, or where this splitting should be done? The types are already split by category and subtype, and the usage of the method seems intuitive to me?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was to split the
NotificationEvents
type,NotificationCategory
for the actual category andNotificationEvents
for the category + subtype. TheBuild
function would look like this:This way we wouldn't have to cast into the
notification.Type
and the separation between "category" and "category + subtype" is more intuitiveUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue with that is that
NotificationEvents
is the official name of these category types https://github.com/tech-ticks/RTDXTools/blob/232a7797e01369e9c12704f58fdde65dd3ac1c32/Assets/Scripts/Stubs/Generated/Assembly-CSharp/NexPlugin/Common.cs#L35-L53, so we would have to intentionally not use the correct official name and instead repurpose the official name for our own definitionWe have changed official names before, but that was due to technical issues (see
RatingLockPeriodDay
, which is officially namedRatingLockPeriod
but that conflicts withRatingLockPeriod
inRatingLockType
)Though I do agree that that sounds more intuitive, especially since I had added these types to the
MatchmakeExtension
protocol (see 2e35b3a). I ran into a snag there because there's 3 methods that take in notification data:UpdateNotificationData
- Takes inuiType types.UInt32, uiParam1 types.UInt64, uiParam2 types.UInt64, strParam types.String
GetFriendNotificationData
- Takes inuiType types.Int32
DebugNotifyEvent
-pid types.PID, mainType types.UInt32, subType types.UInt32, param1 types.UInt64, param2 types.UInt64, stringParam types.String
I only ended up changing
DebugNotifyEvent
to take inmainType notifications_constants.NotificationEvents, subType notifications_constants.SubType
because the other 2 made this a bit annoying.UpdateNotificationData
seems to expect the fully finished built type (which isn't something we have types for at all) andGetFriendNotificationData
wants a signed version of this?Renaming
NotificationEvents
toNotificationCategory
would make handlingUpdateNotificationData
a bit better since like you said it splits the final built type from the category, but it still has the issue of "we don't have types for these built values", and it doesn't helpGetFriendNotificationData
at allThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That isn't the case,
UpdateNotificationData
only uses the category as inputGetFriendNotificationData
being signed is an issue though, huh. I guess we can just leave things as is, no big dealThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That actually makes things easier then tbh. We can definitely still do this if you want, we just have to:
We can make the signed part a bit easier tbh by just creating a 2nd type for it. Like:
GetFriendNotificationData
would just take inNotificationCategorySigned
and we could callToUnsigned
in the implementation handler (or just directly cast)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me 👍