Skip to content
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

feat(matchmake-extension): Support additionalParticipants in AutoMatchmakeWithParamPostpone #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ashquarky
Copy link
Member

Resolves PretendoNetwork/splatoon#3

Changes:

Implements moving players between sessions via additionalParticipants. Moving involves skipping disconnecting and migrating hosts, and just moves the connection from one room to another (with an accompanying SwitchGathering call). This happens for all participants and the caller.

Code is pretty thoroughly commented so I won't wax on it too much here.

Copy link
Member

@DaniElectra DaniElectra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some minor things from me

matchmake-extension/auto_matchmake_with_param_postpone.go Outdated Show resolved Hide resolved
globals/matchmaking_utils.go Outdated Show resolved Hide resolved
matchmake-extension/auto_matchmake_with_param_postpone.go Outdated Show resolved Hide resolved
@ashquarky ashquarky marked this pull request as ready for review July 21, 2024 02:17
@@ -37,10 +64,19 @@ func (commonProtocol *CommonProtocol) autoMatchmakeWithParamPostpone(err error,
session = sessions[0]
}

errCode := common_globals.AddPlayersToSession(session, []uint32{connection.ID}, connection, "")
Copy link

@ItzSwirlz ItzSwirlz Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try something like

var errCode nex.Error // I think thats what the type is, assuming based off the diff

if useAdditionalParticipants {
  errCode = common_globals.MovePlayersToSession(session, additionalParticipants, connection, autoMatchmakeParam.JoinMessage.Value)
} else {
  errCode = common_globals.AddPlayersToSession(session, []uint32{connection.ID}, connection, autoMatchmakeParam.JoinMessage.Value)
}
if errCode != nil {
    common_globals.Logger.Error(errCode.Error())
    return nil, errCode
}

to prevent the repetitiveness. not sure if go will let you get away with this

@ashquarky
Copy link
Member Author

Focusing on #35 for the time being

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Splatfest matchmaking doesn't work
3 participants