-
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 45 commits
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
16 changes: 16 additions & 0 deletions
16
match-making/constants/anybody_particiation_policy_argument.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package constants | ||
|
||
// AnybodyParticipationPolicyArgument seems to determine whether or not to | ||
// close participation when the gathering owner changes when MatchmakeSystemTypeAnybody | ||
// is used? | ||
type AnybodyParticipationPolicyArgument = PolicyArgument | ||
|
||
const ( | ||
// AnybodyParticipationPolicyArgumentWithoutClose means that participation should not | ||
// close when a new owner is selected. | ||
AnybodyParticipationPolicyArgumentWithoutClose AnybodyParticipationPolicyArgument = iota | ||
|
||
// AnybodyParticipationPolicyArgumentCloseOnOwnerMigration means that participation should | ||
// close when a new owner is selected. | ||
AnybodyParticipationPolicyArgumentCloseOnOwnerMigration | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package constants | ||
|
||
import ( | ||
"github.com/PretendoNetwork/nex-go/v2/types" | ||
) | ||
|
||
// AutoMatchmakeOption has an unknown use. | ||
type AutoMatchmakeOption uint32 | ||
|
||
// WriteTo writes the AutoMatchmakeOption to the given writable | ||
func (amo AutoMatchmakeOption) WriteTo(writable types.Writable) { | ||
writable.WriteUInt32LE(uint32(amo)) | ||
} | ||
|
||
// ExtractFrom extracts the AutoMatchmakeOption value from the given readable | ||
func (amo *AutoMatchmakeOption) ExtractFrom(readable types.Readable) error { | ||
value, err := readable.ReadUInt32LE() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
*amo = AutoMatchmakeOption(value) | ||
return nil | ||
} | ||
|
||
const ( | ||
// AutoMatchmakeOptionNone has an unknown use. | ||
AutoMatchmakeOptionNone AutoMatchmakeOption = iota | ||
|
||
// AutoMatchmakeOptionRecordLastGIDForParticipationCheck has an unknown use. | ||
// | ||
// Possibly related to gidForParticipationCheck? | ||
AutoMatchmakeOptionRecordLastGIDForParticipationCheck | ||
|
||
// AutoMatchmakeOptionUniqueGatheringByCodeword has an unknown use. | ||
// | ||
// Possibly related to m_Codeword? | ||
AutoMatchmakeOptionUniqueGatheringByCodeword | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package constants | ||
|
||
// * Miscellaneous constants | ||
|
||
const ( | ||
// InvalidGatheringID represents an invalid/unset gathering ID | ||
InvalidGatheringID uint32 = 0 | ||
|
||
// NumMatchmakeSessionAttributes is the max number of m_Attribs attributes a session may have | ||
NumMatchmakeSessionAttributes uint32 = 6 | ||
|
||
// MatchmakeSessionNearestNeighborAttributeIndex is the index into m_Attribs for finding the value | ||
// used for the SelectionMethodNearestNeighbor method | ||
MatchmakeSessionNearestNeighborAttributeIndex uint32 = 1 | ||
|
||
// MatchmakeSessionBroadenRangeAttributeIndex is the index into m_Attribs for finding the value | ||
// used for the SelectionMethodBroadenRange/SelectionMethodBroadenRangeWithProgressScore methods | ||
MatchmakeSessionBroadenRangeAttributeIndex uint32 = 1 | ||
|
||
// InvalidPersistentGatheringCode likely represents an invalid result from GatheringIdToPersistentGatheringCode? | ||
InvalidPersistentGatheringCode uint64 = 0 | ||
|
||
// PersistentGatheringCreationMax is the max number of persistent gatherings a user can create | ||
PersistentGatheringCreationMax uint32 = 4 | ||
|
||
// PersistentGatheringParticipationMax is the max number of persistent gatherings a user can join | ||
PersistentGatheringParticipationMax uint32 = 16 | ||
|
||
// PersistentGatheringChatParticipantsMax is unknown. Maybe related to the "SendChat" methods of the NexMessagingClient? | ||
PersistentGatheringChatParticipantsMax uint64 = 32 | ||
|
||
// SetAttributeVectorSizeMax seems to be the max number of values a m_Attribs string may have? ("1,2,3,4,5" etc.) | ||
// | ||
// Note: This is a guess based on the "SetAttribute" and "VectorSize" parts. MatchmakeSessionSearchCriteria has a | ||
// SetAttribute method which sets the m_Attribs field. We also know that the m_Attribs values can contain multiple | ||
// numbers, possibly representing a "vector" | ||
SetAttributeVectorSizeMax uint32 = 100 | ||
|
||
// MaxProgressScore is the max value for progressScore | ||
MaxProgressScore uint8 = 100 | ||
|
||
// UpdateProgressScoreMinimumIntervalTime is the minimum interval (in seconds?) for updating the sessions progressScore | ||
UpdateProgressScoreMinimumIntervalTime uint32 = 30 | ||
|
||
// MaxMatchmakeSessionUserPasswordLength is the max user password length for a matchmake session | ||
MaxMatchmakeSessionUserPasswordLength uint32 = 32 | ||
|
||
// MatchmakeSessionSystemPasswordLength is the system password length for a matchmake session | ||
MatchmakeSessionSystemPasswordLength uint32 = 16 | ||
|
||
// MaxMatchmakeBrowseSize is the max number of gatherings that can be returned from the BrowseMatchmakeSession family of methods. | ||
// | ||
// This seems to also be the max input size for FindMatchmakeSessionByGatheringId? | ||
MaxMatchmakeBrowseSize uint32 = 100 | ||
|
||
// MaxPrincipalIDSizeToFindMatchmakeSession is the max number of PIDs that can be used in FindMatchmakeSessionByParticipant and GetPlayingSession | ||
MaxPrincipalIDSizeToFindMatchmakeSession uint32 = 300 | ||
|
||
// MaxMatchmakeBrowseSizeByParticipant is unknown. | ||
// | ||
// Since the value is the same as, and shares a similar name with, MaxPrincipalIDSizeToFindMatchmakeSession | ||
// this is likely a newer/older version of that constant? | ||
MaxMatchmakeBrowseSizeByParticipant uint32 = 300 | ||
|
||
// MaxMatchmakeSessionByParticipant is the max number of sessions that can be returned by FindMatchmakeSessionByParticipant and GetPlayingSession | ||
MaxMatchmakeSessionByParticipant uint32 = 1000 | ||
|
||
// MaxExtraParticipants is the max value of extraParticipants | ||
MaxExtraParticipants uint32 = 4 | ||
|
||
// MaxP2PSignatureKeyLen is the max size of m_SessionKey | ||
MaxP2PSignatureKeyLen uint32 = 32 | ||
|
||
// ResultRangeAnyOffset when used in MatchmakeSessionSearchCriteria, seems to tell the server to search | ||
// the entire database for matching sessions and return up to m_uiSize (max 100) sessions in a random | ||
// order. Otherwise the ResultRange offset is used as normal and sessions are returned in order based on | ||
// their gathering IDs | ||
ResultRangeAnyOffset uint64 = 4294967295 | ||
|
||
// MatchmakeStringMaxLength is the max length of matchmaking strings | ||
MatchmakeStringMaxLength uint32 = 256 | ||
|
||
// MatchmakeBufferMaxLength is the max size of matchmaking binary data | ||
MatchmakeBufferMaxLength uint32 = 512 | ||
) |
52 changes: 52 additions & 0 deletions
52
match-making/constants/find_matchmake_session_result_option.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package constants | ||
|
||
import "github.com/PretendoNetwork/nex-go/v2/types" | ||
|
||
// FindMatchmakeSessionResultOption indicates how to populate the | ||
// responses from FindMatchmakeSessionByParticipant | ||
type FindMatchmakeSessionResultOption uint32 | ||
|
||
// WriteTo writes the FindMatchmakeSessionResultOption to the given writable | ||
func (fmsr FindMatchmakeSessionResultOption) WriteTo(writable types.Writable) { | ||
writable.WriteUInt32LE(uint32(fmsr)) | ||
} | ||
|
||
// ExtractFrom extracts the FindMatchmakeSessionResultOption value from the given readable | ||
func (fmsr *FindMatchmakeSessionResultOption) ExtractFrom(readable types.Readable) error { | ||
value, err := readable.ReadUInt32LE() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
*fmsr = FindMatchmakeSessionResultOption(value) | ||
return nil | ||
} | ||
|
||
func (fmsr FindMatchmakeSessionResultOption) HasFlag(flag FindMatchmakeSessionResultOption) bool { | ||
return fmsr&flag == flag | ||
} | ||
|
||
func (fmsr FindMatchmakeSessionResultOption) HasFlags(flags ...FindMatchmakeSessionResultOption) bool { | ||
if len(flags) == 0 { | ||
return false | ||
} | ||
|
||
for _, flag := range flags { | ||
if fmsr&flag != flag { | ||
return false | ||
} | ||
} | ||
|
||
return true | ||
} | ||
|
||
const ( | ||
// FindMatchmakeSessionResultOptionNone indicates no options | ||
FindMatchmakeSessionResultOptionNone FindMatchmakeSessionResultOption = 0 | ||
|
||
// FindMatchmakeSessionResultOptionApplicationBuffer populates m_ApplicationBuffer in the results | ||
FindMatchmakeSessionResultOptionApplicationBuffer FindMatchmakeSessionResultOption = 1 | ||
|
||
// FindMatchmakeSessionResultOptionMatchmakeParam populates m_MatchmakeParam in the results | ||
FindMatchmakeSessionResultOptionMatchmakeParam FindMatchmakeSessionResultOption = 2 | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
package constants | ||
|
||
import "github.com/PretendoNetwork/nex-go/v2/types" | ||
|
||
// GatheringFlags indicates the flags set on a gathering | ||
type GatheringFlags uint16 | ||
|
||
// WriteTo writes the GatheringFlags to the given writable | ||
func (gf GatheringFlags) WriteTo(writable types.Writable) { | ||
writable.WriteUInt16LE(uint16(gf)) | ||
} | ||
|
||
// ExtractFrom extracts the GatheringFlags value from the given readable | ||
func (gf *GatheringFlags) ExtractFrom(readable types.Readable) error { | ||
value, err := readable.ReadUInt16LE() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
*gf = GatheringFlags(value) | ||
return nil | ||
} | ||
|
||
func (gf GatheringFlags) HasFlag(flag GatheringFlags) bool { | ||
return gf&flag == flag | ||
} | ||
|
||
func (gf GatheringFlags) HasFlags(flags ...GatheringFlags) bool { | ||
if len(flags) == 0 { | ||
return false | ||
} | ||
|
||
for _, flag := range flags { | ||
if gf&flag != flag { | ||
return false | ||
} | ||
} | ||
|
||
return true | ||
} | ||
|
||
const ( | ||
// GatheringFlagNone means that no flags are set | ||
GatheringFlagNone GatheringFlags = 0x0 | ||
|
||
// GatheringFlagPersistentGathering indicates that a gathering is persistent. | ||
// | ||
// Gatherings with this flag don't get deleted on the server when the user logs | ||
// out or when the gathering state is set to "Finished". The gathering MUST be | ||
// deleted manually by the owner. | ||
// | ||
// Seen in Mario Kart 7 communities. | ||
GatheringFlagPersistentGathering GatheringFlags = 0x1 | ||
|
||
// GatheringFlagMigrateOwner determines whether or not to pick a new owner when | ||
// the current owner logs out. If set and the owner disconnects, a new owner is | ||
// picked from the remaining participants. If a new owner can't be set, or this | ||
// flag is not set, then the gathering is deleted when the owner disconnects. | ||
// | ||
// Only applies to non-persistent gatherings. | ||
GatheringFlagMigrateOwner GatheringFlags = 0x10 | ||
|
||
// GatheringFlagNoPersistentParticipation determines whether or not a participant | ||
// will have their participation status removed from a persistent gathering when | ||
// they log out. If set, the users participation status is removed after disconnecting. | ||
GatheringFlagNoPersistentParticipation GatheringFlags = 0x40 | ||
|
||
// GatheringFlagAllowNoParticipant determines whether or not a persistent gathering | ||
// will be deleted when it has 0 participants. Normally a persistent gathering is | ||
// deleted when it has 0 participants. If set, the persistent gathering will NOT be | ||
// deleted when it has 0 participants. | ||
// | ||
// Note: This does NOT mean ACTIVE players. Players may be participants of a persistent | ||
// gathering while not actively playing in the session or even online. | ||
GatheringFlagAllowNoParticipant GatheringFlags = 0x80 | ||
|
||
// GatheringFlagChangeOwnerByOtherHost determines whether or not ownership of a gathering | ||
// can be taken by another user. If set, calling UpdateSessionHost and UpdateGatheringOwnership | ||
// will allow ownership to be transfered. If set and ownership changes, a OwnershipChangeEvent | ||
// notification is sent to all participants. | ||
GatheringFlagChangeOwnerByOtherHost GatheringFlags = 0x200 | ||
|
||
// GatheringFlagNotifyParticipationEventsToAllParticipants determines whether or | ||
// not Participate, Disconnect, and EndParticipation ParticipationEvents notifications | ||
// are sent to players in the session. If neither this flag nor | ||
// GatheringFlagNotifyParticipationEventsToAllParticipantsReproducibly are set then | ||
// only the owner of the session gets these notifications. | ||
GatheringFlagNotifyParticipationEventsToAllParticipants GatheringFlags = 0x400 | ||
|
||
// GatheringFlagNotifyParticipationEventsToAllParticipantsReproducibly determines | ||
// whether or not Participate, Disconnect, and EndParticipation ParticipationEvents | ||
// notifications are sent to players in the session. If neither this flag nor | ||
// GatheringFlagNotifyParticipationEventsToAllParticipants are set then only the | ||
// owner of the session gets these notifications. | ||
// | ||
// The exact details on how this differs from GatheringFlagNotifyParticipationEventsToAllParticipants | ||
// is not known. It seems to seend a duplicate Participate notification event to | ||
// all existing players of the session (but not the new player)? | ||
GatheringFlagNotifyParticipationEventsToAllParticipantsReproducibly GatheringFlags = 0x800 | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package constants | ||
|
||
import ( | ||
"github.com/PretendoNetwork/nex-go/v2/types" | ||
) | ||
|
||
// GatheringState indicates the state of a gathering. | ||
// | ||
// Note: We do not know the real names for any of these, this is | ||
// all guess work. The values of these states seem to imply that | ||
// they are bitwise flags, but they seem to be treated as enum | ||
// values in practice? | ||
type GatheringState uint32 | ||
|
||
// WriteTo writes the GatheringState to the given writable | ||
func (gs GatheringState) WriteTo(writable types.Writable) { | ||
writable.WriteUInt32LE(uint32(gs)) | ||
} | ||
|
||
// ExtractFrom extracts the GatheringState value from the given readable | ||
func (gs *GatheringState) ExtractFrom(readable types.Readable) error { | ||
value, err := readable.ReadUInt32LE() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
*gs = GatheringState(value) | ||
return nil | ||
} | ||
|
||
const ( | ||
// GatheringStateLocked indicates that a gathering is locked, and no new participants may join | ||
// Name assumed from MatchmakeSessionSearchCriteria.ExcludeLocked. | ||
GatheringStateLocked GatheringState = 1 | ||
|
||
// GatheringStateStarted indicates that the gatherings session has begun. | ||
GatheringStateStarted GatheringState = 2 | ||
|
||
// GatheringStateFinished indicates that the gatherings session has finished. | ||
// Manually setting this state seems to delete gatherings which are non-persistent. | ||
GatheringStateFinished GatheringState = 4 | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
package constants | ||
|
||
import ( | ||
"github.com/PretendoNetwork/nex-go/v2/types" | ||
) | ||
|
||
// JoinMatchmakeSessionBehavior is used to indicate the behavior that joining a matchmake session will have | ||
type JoinMatchmakeSessionBehavior uint8 | ||
|
||
// WriteTo writes the JoinMatchmakeSessionBehavior to the given writable | ||
func (jmsb JoinMatchmakeSessionBehavior) WriteTo(writable types.Writable) { | ||
writable.WriteUInt8(uint8(jmsb)) | ||
} | ||
|
||
// ExtractFrom extracts the JoinMatchmakeSessionBehavior value from the given readable | ||
func (jmsb *JoinMatchmakeSessionBehavior) ExtractFrom(readable types.Readable) error { | ||
value, err := readable.ReadUInt8() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
*jmsb = JoinMatchmakeSessionBehavior(value) | ||
return nil | ||
} | ||
|
||
const ( | ||
// JoinMatchmakeSessionBehaviorJoinMyself indicates that the caller wants to join the session | ||
// JoinMatchmakeSessionBehaviorJoinMyself indicates that the caller wants to join the session. | ||
JoinMatchmakeSessionBehaviorJoinMyself JoinMatchmakeSessionBehavior = iota | ||
|
||
// JoinMatchmakeSessionBehaviorImAlreadyJoined indicates that the caller is already joined into the session | ||
// JoinMatchmakeSessionBehaviorImAlreadyJoined indicates that the caller is already joined into the session. | ||
// | ||
// This can be useful in cases where the caller wants to add additional users to the session using additionalParticipants | ||
// without trying to join the session themselves multiple times. | ||
JoinMatchmakeSessionBehaviorImAlreadyJoined | ||
) |
Oops, something went wrong.
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.
Could this possibly be related to the
ParticipationPolicyOpenParticipation
instead ofMatchmakeSystemTypeAnybody
? Maybe this could mean that the participation policy is actually namedParticipationPolicyAnybody
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.
In the matchmaking client there's 2 ways the game can set these policies:
MatchmakeSession::SetMatchmakeSystemType(MatchmakeSystemType system_type, PolicyArgument policy_arg)
Gathering::SetParticipationPolicy(ParticipationPolicy policy, PolicyArgument policy_arg)
When
MatchmakeSession::SetMatchmakeSystemType
is called andsystem_type
is eitherMatchmakeSystemTypeAnybody
orMatchmakeSystemTypeFriends
, then the client internally callsGathering::SetParticipationPolicy(ParticipationPolicyFriendsOnly, policy_arg)
Otherwise the client internally calls
Gathering::SetParticipationPolicy(ParticipationPolicyOpenParticipation, 0)
At least that's how it works in Xenoblade.
ParticipationPolicyOpenParticipation
never seems to get a policy argument for some reason:I have no idea why it sets
ParticipationPolicyFriendsOnly
for bothMatchmakeSystemTypeAnybody
ANDMatchmakeSystemTypeFriends
though, but given the naming ofAnybody
in bothAnybodyParticipationPolicyArgument
andMatchmakeSystemTypeAnybody
, and from what I remember in my testing, this policy argument seems directly related toMatchmakeSystemTypeAnybody