mirror of
https://github.com/PretendoNetwork/splatoon.git
synced 2026-04-26 07:47:57 -05:00
feat(secure): Mark Splatfest sessions as OpenParticipation
Bit of a hack but good enough to make things work for now
This commit is contained in:
parent
823e87ebee
commit
cd4e3159ca
|
|
@ -3,6 +3,7 @@ package nex
|
||||||
import (
|
import (
|
||||||
"github.com/PretendoNetwork/nex-go/v2"
|
"github.com/PretendoNetwork/nex-go/v2"
|
||||||
"github.com/PretendoNetwork/nex-go/v2/types"
|
"github.com/PretendoNetwork/nex-go/v2/types"
|
||||||
|
common_globals "github.com/PretendoNetwork/nex-protocols-common-go/v2/globals"
|
||||||
commonnattraversal "github.com/PretendoNetwork/nex-protocols-common-go/v2/nat-traversal"
|
commonnattraversal "github.com/PretendoNetwork/nex-protocols-common-go/v2/nat-traversal"
|
||||||
commonsecure "github.com/PretendoNetwork/nex-protocols-common-go/v2/secure-connection"
|
commonsecure "github.com/PretendoNetwork/nex-protocols-common-go/v2/secure-connection"
|
||||||
nattraversal "github.com/PretendoNetwork/nex-protocols-go/v2/nat-traversal"
|
nattraversal "github.com/PretendoNetwork/nex-protocols-go/v2/nat-traversal"
|
||||||
|
|
@ -106,6 +107,16 @@ func gameSpecificMatchmakeSessionSearchCriteriaChecksHandler(searchCriteria *mat
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func onAfterAutoMatchmakeWithParamPostpone(_ nex.PacketInterface, _ *matchmakingtypes.AutoMatchmakeParam) {
|
||||||
|
// * This is ugly but I can't work out a better way to do this
|
||||||
|
// * Set Splatfest rooms to open participation
|
||||||
|
for _, session := range common_globals.Sessions {
|
||||||
|
if session.GameMatchmakeSession != nil && session.GameMatchmakeSession.GameMode.Value == 12 {
|
||||||
|
session.GameMatchmakeSession.OpenParticipation.Value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func registerCommonSecureServerProtocols() {
|
func registerCommonSecureServerProtocols() {
|
||||||
secureProtocol := secure.NewProtocol()
|
secureProtocol := secure.NewProtocol()
|
||||||
globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol)
|
globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol)
|
||||||
|
|
@ -130,4 +141,5 @@ func registerCommonSecureServerProtocols() {
|
||||||
commonMatchmakeExtensionProtocol := commonmatchmakeextension.NewCommonProtocol(matchmakeExtensionProtocol)
|
commonMatchmakeExtensionProtocol := commonmatchmakeextension.NewCommonProtocol(matchmakeExtensionProtocol)
|
||||||
matchmakeExtensionProtocol.SetHandlerGetPlayingSession(stubGetPlayingSession)
|
matchmakeExtensionProtocol.SetHandlerGetPlayingSession(stubGetPlayingSession)
|
||||||
commonMatchmakeExtensionProtocol.GameSpecificMatchmakeSessionSearchCriteriaChecks = gameSpecificMatchmakeSessionSearchCriteriaChecksHandler
|
commonMatchmakeExtensionProtocol.GameSpecificMatchmakeSessionSearchCriteriaChecks = gameSpecificMatchmakeSessionSearchCriteriaChecksHandler
|
||||||
|
commonMatchmakeExtensionProtocol.OnAfterAutoMatchmakeWithParamPostpone = onAfterAutoMatchmakeWithParamPostpone
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user