mirror of
https://github.com/PretendoNetwork/nex-protocols-common-go.git
synced 2025-04-02 11:02:13 -04:00
33 lines
1.4 KiB
Go
33 lines
1.4 KiB
Go
package matchmake_extension
|
|
|
|
import (
|
|
nex "github.com/PretendoNetwork/nex-go"
|
|
match_making "github.com/PretendoNetwork/nex-protocols-go/match-making"
|
|
matchmake_extension "github.com/PretendoNetwork/nex-protocols-go/matchmake-extension"
|
|
"github.com/PretendoNetwork/plogger-go"
|
|
)
|
|
|
|
var commonMatchmakeExtensionProtocol *CommonMatchmakeExtensionProtocol
|
|
var logger = plogger.NewLogger()
|
|
|
|
type CommonMatchmakeExtensionProtocol struct {
|
|
*matchmake_extension.MatchmakeExtensionProtocol
|
|
server *nex.Server
|
|
|
|
cleanupSearchMatchmakeSessionHandler func(matchmakeSession *match_making.MatchmakeSession)
|
|
}
|
|
|
|
// CleanupSearchMatchmakeSession sets the CleanupSearchMatchmakeSession handler function
|
|
func (commonMatchmakeExtensionProtocol *CommonMatchmakeExtensionProtocol) CleanupSearchMatchmakeSession(handler func(matchmakeSession *match_making.MatchmakeSession)) {
|
|
commonMatchmakeExtensionProtocol.cleanupSearchMatchmakeSessionHandler = handler
|
|
}
|
|
|
|
// NewCommonMatchmakeExtensionProtocol returns a new CommonMatchmakeExtensionProtocol
|
|
func NewCommonMatchmakeExtensionProtocol(server *nex.Server) *CommonMatchmakeExtensionProtocol {
|
|
MatchmakeExtensionProtocol := matchmake_extension.NewMatchmakeExtensionProtocol(server)
|
|
commonMatchmakeExtensionProtocol = &CommonMatchmakeExtensionProtocol{MatchmakeExtensionProtocol: MatchmakeExtensionProtocol, server: server}
|
|
|
|
MatchmakeExtensionProtocol.AutoMatchmake_Postpone(autoMatchmake_Postpone)
|
|
|
|
return commonMatchmakeExtensionProtocol
|
|
}
|