diff --git a/nex/register_common_secure_server_protocols.go b/nex/register_common_secure_server_protocols.go index 7e6cb85..fdab791 100644 --- a/nex/register_common_secure_server_protocols.go +++ b/nex/register_common_secure_server_protocols.go @@ -1,6 +1,9 @@ package nex import ( + "slices" + + "github.com/PretendoNetwork/nex-go/v2" "github.com/PretendoNetwork/nex-go/v2/types" commonmatchmaking "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making" commonmatchmakingext "github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making-ext" @@ -28,11 +31,17 @@ func cleanupMatchmakeSessionSearchCriteriasHandler(searchCriterias types.List[ma } } +func adjustPublicStationFirst(packet nex.PacketInterface, urls types.List[types.StationURL], dataHolder types.DataHolder) { + connection := packet.Sender().(*nex.PRUDPConnection) + slices.Reverse(connection.StationURLs) +} + func registerCommonSecureServerProtocols() { secureProtocol := secure.NewProtocol() globals.SecureEndpoint.RegisterServiceProtocol(secureProtocol) commonSecureProtocol := commonsecure.NewCommonProtocol(secureProtocol) commonSecureProtocol.EnableInsecureRegister() + commonSecureProtocol.OnAfterRegisterEx = adjustPublicStationFirst commonSecureProtocol.CreateReportDBRecord = CreateReportDBRecord natTraversalProtocol := nattraversal.NewProtocol()