Documentation
¶
Index ¶
- Constants
- func FifoMatch(pool PoolProfile, tickets map[string]*Ticket, now int64, r ResultSubmitter)
- type FloatArg
- type FloatFilter
- type IntArg
- type IntFilter
- type MatchProfile
- type MatchResult
- type Member
- type MemberResult
- type PoolProfile
- type ResultSubmitter
- type StringArg
- type StringFilter
- type TeamResult
- type Ticket
Constants ¶
View Source
const ( EqualOp = "=" NotEqualOp = "!=" )
Variables ¶
This section is empty.
Functions ¶
func FifoMatch ¶
func FifoMatch(pool PoolProfile, tickets map[string]*Ticket, now int64, r ResultSubmitter)
Types ¶
type FloatFilter ¶
type MatchProfile ¶
type MatchProfile struct {
Name string `json:"name"` // 匹配场名字,唯一
Algorithm string `json:"algorithm"` // 进行匹配所使用的算法,内置 fifo
Tick string `json:"tick"` // 匹配场匹配频率,如 "0.5s"
Pools []PoolProfile `json:"pools"` // 匹配池
}
MatchProfile 匹配场配置
type MatchResult ¶
type MatchResult struct {
PoolName string `json:"pool_name"` // 表示从哪个池子挑出来的
Teams []TeamResult `json:"teams"` // 挑选出来的队伍
}
type MemberResult ¶
type PoolProfile ¶
type PoolProfile struct {
Name string `json:"name"` // 匹配池名字
BetweenTeamAntiAffinity string `json:"between_team_anti_affinity"` // 队间反亲和性选择词
StringFilters []StringFilter `json:"string_filters"`
IntFilters []IntFilter `json:"int_filters"`
FloatFilters []FloatFilter `json:"float_filters"`
Teams []string `json:"teams"` // 匹配结果需要多个team
TeamMembers int `json:"team_members"` // 每队人数
MaxMatchPerRound int `json:"max_match_per_round"` // 每场最多匹配队伍
AllowCut bool `json:"allow_cut"` // 允许缩减队伍
AllowHate bool `json:"allow_hate"` // 考虑玩家的黑名单
}
PoolProfile 匹配池配置
type ResultSubmitter ¶
type ResultSubmitter func(MatchResult)
type StringFilter ¶
type TeamResult ¶
type TeamResult struct {
TeamName string `json:"team_name"` // 表示对应哪个 TeamProfile
TicketId []string `json:"ticket_id"` // 表示来源于哪些 Ticket
Members []MemberResult `json:"members"`
CutMembers []MemberResult `json:"cut_members"`
}
type Ticket ¶
type Ticket struct {
TicketId string `json:"ticket_id"` // 整个匹配场里ticket的全局唯一id
Members []Member `json:"members"`
StringArgs []StringArg `json:"string_args"`
IntArgs []IntArg `json:"int_args"`
FloatArgs []FloatArg `json:"float_args"`
BlackList []int64 `json:"black_list"` // 设置黑名单,不会跟指定 member 匹配到同team
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.