// import github.com/Diarkis/diarkis/matching github.com/Diarkis/diarkis/user// userData is the data representation of the client issued the ticketmatching.SetOnIssueTicket(func(userData *user.User) *matching.TicketParams {return&matching.TicketParams{// Control which matchmaking profiles the issued ticket should use ProfileIDs: []string{"RankMatch", "RankMatch2"},// Control the maximum number of clients to be matched MaxMembers: 2,// Controls how long the each search should wait before performing next search SearchInterval: 100, // 100 milliseconds// Controls how long should the issued ticket be valid in seconds TicketDuration: 60, // 1 minute// Controls how many matched candidates should a search should retrieve HowMany: 20,// Controls if the issued ticket should use MatchMaker Tag Tag: "",// Controls the conditions of the matchmaking wait (conditions to be found by others) AddProperties: map[string]int{"rank": userData.Get("UserRank")},// Controls the conditions for matchmaking search SearchProperties: map[string][]int{ "rank": []int{ 1, 2, 3 } }, }}
matching.SetOnTicketMatch(func(userData *user.User, roomID string, memberIDs []string) bool {// Add custom logic to decide matchmaking completion here// userData represents the client that issued the ticket// roomID represents the matchmaking room that all matched clients belong to// memberIDs is the list of all matched clients' user IDsreturnfalse})
matching.SetOnTicketComplete(func(roomID string, userData *user.User) []byte {// roomID represents the matchmaking room that all matched clients belong to// userData represents the client that issued the ticketreturn []byte("Send some meaningful information here...")}