Skip to content

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
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Jul 8, 2025
055591a
feat(match-making): add missing constant values
jonbarrow Jul 9, 2025
d298534
feat(match-making): add MatchmakeGeoIpResult enum
jonbarrow Jul 9, 2025
203ef4f
chore(match-making): make MatchmakeSelectionMethod enum consistent wi…
jonbarrow Jul 9, 2025
a2a58bf
feat(match-making): add GatheringFlags enum
jonbarrow Jul 9, 2025
22653a5
feat(match-making): add MatchmakeSessionOption0 enum
jonbarrow Jul 9, 2025
eba96db
feat(match-making): add MatchmakeOption enum
jonbarrow Jul 9, 2025
c66ee65
feat(match-making): add AutoMatchmakeOption enum
jonbarrow Jul 9, 2025
9b9e2c5
chore(match-making): add usage details to JoinMatchmakeSessionBehavio…
jonbarrow Jul 9, 2025
3c813d8
fix(match-making): MatchmakeSessionOption0 are flags not enum
jonbarrow Jul 9, 2025
6844477
feat(match-making): add FindMatchmakeSessionResultOption flags
jonbarrow Jul 9, 2025
cbdb0b3
feat(match-making): add MatchmakeSessionModificationFlag flags
jonbarrow Jul 9, 2025
3513902
chore(match-making): expand MatchmakeSelectionMethod Godoc comments
jonbarrow Jul 9, 2025
e6e7436
feat(match-making): add AnybodyParticipationPolicyArgument enum
jonbarrow Jul 9, 2025
59183ed
feat(match-making): add ParticipationPolicy types
jonbarrow Jul 9, 2025
133cafb
fix(match-making): fix typo in MatchmakeSessionOption0None Godoc comment
jonbarrow Jul 9, 2025
a09b042
fix(match-making): fix AnybodyParticipationPolicyArgument typos
jonbarrow Jul 9, 2025
f432772
feat(notifications): add NotificationEvents types
jonbarrow Jul 12, 2025
b809493
feat(notifications): add NotificationEvents.Build() method
jonbarrow Jul 12, 2025
a753fb4
fix(notifications): add protocol to UpdateNotificationData mentions
jonbarrow Jul 12, 2025
a5e83f3
feat(notifications): add ParticipationEvents
jonbarrow Jul 12, 2025
57169f2
fix(notifications): add Godoc comment to NotificationEvents.Build()
jonbarrow Jul 12, 2025
7b1d19e
fix(notifications): fix ParticipationEventsParticipate name
jonbarrow Jul 12, 2025
ad2f935
fix(notifications): fix ParticipationEventsParticipate comment
jonbarrow Jul 12, 2025
23caa16
feat(notifications): add SubscriptionEvents
jonbarrow Jul 12, 2025
216c009
feat(notifications): remove old category/subtype handling
jonbarrow Jul 12, 2025
abff4f7
feat(match-making): add HasFlag and HasFlags methods to flag types
jonbarrow Jul 12, 2025
85e9e91
fix(notifications): make NotificationEvents.Build() return types.UInt32
jonbarrow Jul 12, 2025
fde236b
feat(match-making): change AutoMatchmakeParam to use AutoMatchmakeOption
jonbarrow Jul 12, 2025
72fe2cb
feat(match-making): add IsValid method to all enum types
jonbarrow Jul 13, 2025
9678fc7
chore(match-making): add PolicyArgument type
jonbarrow Aug 5, 2025
041e423
feat(match-making): add GatheringState type
jonbarrow Aug 5, 2025
eb731a0
chore(match-making): remove IsValid method from AnybodyParticipationP…
jonbarrow Aug 5, 2025
23fbe4e
feat(match-making): make FindMatchmakeSessionByParticipantParam use F…
jonbarrow Aug 5, 2025
51b81d7
feat(match-making): make Gathering uses new constants
jonbarrow Aug 5, 2025
3188a13
feat(match-making): make JoinMatchmakeSessionParam use JoinMatchmakeS…
jonbarrow Aug 5, 2025
89bd749
chore(match-making): rename GatheringStateClosed to GatheringStateLocked
jonbarrow Aug 5, 2025
e8e84a3
feat(match-making): make MatchmakeSessionSearchCriteria uses new cons…
jonbarrow Aug 5, 2025
4d755ab
chore(match-making): add ExtractFrom and WriteTo methods to add const…
jonbarrow Aug 5, 2025
e0955e9
feat(match-making): make MatchmakeSession uses new constants
jonbarrow Aug 5, 2025
8553249
feat(match-making): make UpdateMatchmakeSessionParam uses new constants
jonbarrow Aug 5, 2025
545c76a
chore(match-making): remove IsValid methods from constants
jonbarrow Aug 6, 2025
374cb36
feat(match-making): make SetState use GatheringState constant
jonbarrow Aug 6, 2025
3b1af2e
feat(notifications): add NotificationEvent.MapParam
jonbarrow Aug 6, 2025
48bb56c
feat(notifications): make NotificationEvent use NotificationEvents co…
jonbarrow Aug 6, 2025
d8468a8
feat(notifications): add NotificationEventsEagleAddress
jonbarrow Aug 6, 2025
d0cc42c
chore(match-making): remove legacy GatheringFlags file
jonbarrow Aug 8, 2025
8e46be7
chore(subscriber): update unknown param/type names
jonbarrow Aug 22, 2025
1bb3d8f
feat(subscriber): add constants
jonbarrow Aug 22, 2025
4c26949
feat(ranking): add missing ranking constants
jonbarrow Aug 22, 2025
db46dd5
feat(ranking): make ranking protocol use new constants/enums
jonbarrow Aug 22, 2025
d1a9468
feat(ranking2): add all constants
jonbarrow Aug 23, 2025
02c11f2
feat(ranking2): make ranking2 protocol use new constants/enums
jonbarrow Aug 23, 2025
2e35b3a
chore(matchmake-extension): use notifications constants in DebugNotif…
jonbarrow Aug 23, 2025
8b7fd51
fix(datastore): GetObjectInfos takes in a types.List[types.UInt64]
jonbarrow Aug 23, 2025
3fa4fc7
feat(datastore): make datastore protocol use new constants/enums
jonbarrow Aug 23, 2025
b7bf4f5
feat(notifications): split notification event and category
jonbarrow Aug 24, 2025
e59c9c0
feat(notifications): create NotificationCategorySigned
jonbarrow Aug 24, 2025
14495d6
fix(datastore): ResetRatings takes in a types.List[types.UInt64]
jonbarrow Aug 24, 2025
4b028e1
fix(subscriber): add proper Godoc comments to SubscriberUserStatusParam
jonbarrow Aug 24, 2025
d579bce
feat(ranking2): add bespoke Ranking2ResetDay
jonbarrow Aug 24, 2025
cf676e6
feat(ranking2): add bespoke Ranking2ResetMonth
jonbarrow Aug 24, 2025
b462290
feat(nintendo-notifications): add NintendoNotificationEventProfile
jonbarrow Aug 24, 2025
f2663cc
feat(nintendo-notifications): add bespoke NotificationType type
jonbarrow Aug 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions match-making/constants/anybody_particiation_policy_argument.go
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
Comment on lines +3 to +6
Copy link
Member

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 of MatchmakeSystemTypeAnybody? Maybe this could mean that the participation policy is actually named ParticipationPolicyAnybody

Copy link
Member Author

@jonbarrow jonbarrow Aug 24, 2025

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 and system_type is either MatchmakeSystemTypeAnybody or MatchmakeSystemTypeFriends, then the client internally calls Gathering::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:

void SetMatchmakeSystemType__Q3_2nn3nex16MatchmakeSessionFQ3_2nn3nex19MatchmakeSystemTypeUi(nn::nex::MatchmakeSession *this, uint system_type, uint policy_arg) {
  this->m_MatchmakeSystemType = system_type;
  if ((1 < system_type) && (system_type < 4)) {
    SetParticipationPolicy__Q3_2nn3nex9GatheringFUiT1((nn::nex::Gathering *)this, 0x62, policy_arg);
    return;
  }

  SetParticipationPolicy__Q3_2nn3nex9GatheringFUiT1((nn::nex::Gathering *)this, 8, 0);
  return;
}

void SetParticipationPolicy__Q3_2nn3nex9GatheringFUiT1(nn::nex::Gathering *this, undefined4 participation_policy, undefined4 policy_argument) {
  this->participation_policy = participation_policy;
  this->policy_argument = policy_argument;
  return;
}

I have no idea why it sets ParticipationPolicyFriendsOnly for both MatchmakeSystemTypeAnybody AND MatchmakeSystemTypeFriends though, but given the naming of Anybody in both AnybodyParticipationPolicyArgument and MatchmakeSystemTypeAnybody, and from what I remember in my testing, this policy argument seems directly related to MatchmakeSystemTypeAnybody


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
)
39 changes: 39 additions & 0 deletions match-making/constants/auto_matchmake_option.go
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
)
85 changes: 85 additions & 0 deletions match-making/constants/constants.go
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 match-making/constants/find_matchmake_session_result_option.go
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
)
100 changes: 100 additions & 0 deletions match-making/constants/gathering_flags.go
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
)
42 changes: 42 additions & 0 deletions match-making/constants/gathering_state.go
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
)
27 changes: 25 additions & 2 deletions match-making/constants/join_matchmake_session_behavior.go
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
)
Loading