From 8dec161257a2468a552bcc08fbaa90c2e1124d22 Mon Sep 17 00:00:00 2001 From: Andrea Toska Date: Mon, 30 Sep 2024 13:18:31 +0200 Subject: [PATCH] feat(secure): attempt to fix index bugs --- nex/register_common_secure_server_protocols.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index ffc77da..057773f 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -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)