Skip to content

Commit

Permalink
Merge pull request #77 from ashquarky/jmsp-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow authored Jun 28, 2024
2 parents 33c0c11 + 9c31236 commit 2def9e2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions match-making/types/join_matchmake_session_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type JoinMatchmakeSessionParam struct {
StrSystemPassword *types.String
JoinMessage *types.String
ParticipationCount *types.PrimitiveU16
ExtraParticipants *types.PrimitiveU16
ExtraParticipants *types.PrimitiveU16 // * Revision 1 or NEX v4.0
BlockListParam *MatchmakeBlockListParam // * NEX v4.0
}

Expand All @@ -41,7 +41,10 @@ func (jmsp *JoinMatchmakeSessionParam) WriteTo(writable types.Writable) {
jmsp.StrSystemPassword.WriteTo(contentWritable)
jmsp.JoinMessage.WriteTo(contentWritable)
jmsp.ParticipationCount.WriteTo(contentWritable)
jmsp.ExtraParticipants.WriteTo(contentWritable)

if jmsp.StructureVersion >= 1 || libraryVersion.GreaterOrEqual("4.0") {
jmsp.ExtraParticipants.WriteTo(contentWritable)
}

if libraryVersion.GreaterOrEqual("4.0") {
jmsp.BlockListParam.WriteTo(contentWritable)
Expand Down Expand Up @@ -111,9 +114,11 @@ func (jmsp *JoinMatchmakeSessionParam) ExtractFrom(readable types.Readable) erro
return fmt.Errorf("Failed to extract JoinMatchmakeSessionParam.ParticipationCount. %s", err.Error())
}

err = jmsp.ExtraParticipants.ExtractFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract JoinMatchmakeSessionParam.ExtraParticipants. %s", err.Error())
if jmsp.StructureVersion >= 1 || libraryVersion.GreaterOrEqual("4.0") {
err = jmsp.ExtraParticipants.ExtractFrom(readable)
if err != nil {
return fmt.Errorf("Failed to extract JoinMatchmakeSessionParam.ExtraParticipants. %s", err.Error())
}
}

if libraryVersion.GreaterOrEqual("4.0") {
Expand Down

0 comments on commit 2def9e2

Please sign in to comment.