feat(secure): attempt to fix index bugs

This commit is contained in:
Andrea Toska 2024-09-30 13:18:31 +02:00
parent 9bd50d4cad
commit 8dec161257

View File

@ -86,6 +86,15 @@ func compareSearchCriteria[T ~uint16 | ~uint32](original T, search string) bool
}
}
func cleanupMatchmakeSessionSearchCriteriasHandler(searchCriterias *types.List[*match_making_types.MatchmakeSessionSearchCriteria]) {
search := searchCriterias.Slice();
for i, searchCriteriasElem := range search {
searchCriteriasElem.Attributes.DeleteIndex(1);
searchCriteriasElem.Attributes.DeleteIndex(4);
}
}
func gameSpecificMatchmakeSessionSearchCriteriaChecksHandler(searchCriteria *matchmakingtypes.MatchmakeSessionSearchCriteria, matchmakeSession *matchmakingtypes.MatchmakeSession) bool {
original := matchmakeSession.Attributes.Slice()
search := searchCriteria.Attribs.Slice()
@ -146,7 +155,7 @@ func registerCommonSecureServerProtocols() {
globals.SecureEndpoint.RegisterServiceProtocol(matchmakeExtensionProtocol)
commonMatchmakeExtensionProtocol := commonmatchmakeextension.NewCommonProtocol(matchmakeExtensionProtocol)
matchmakeExtensionProtocol.SetHandlerGetPlayingSession(stubGetPlayingSession)
// commonMatchmakeExtensionProtocol.CleanupMatchmakeSessionSearchCriteriaChecks = gameSpecificMatchmakeSessionSearchCriteriaChecksHandler
commonMatchmakeExtensionProtocol.CleanupMatchmakeSessionSearchCriterias = cleanupMatchmakeSessionSearchCriteriasHandler
commonMatchmakeExtensionProtocol.OnAfterAutoMatchmakeWithParamPostpone = onAfterAutoMatchmakeWithParamPostpone
commonMatchmakeExtensionProtocol.SetManager(globals.MatchmakingManager)