Skip to content

Commit 3e7908f

Browse files
committed
添加匹配算法
1 parent e3ccf15 commit 3e7908f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

game/match/match.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (m *MatchPool) match() {
9797
func (m *MatchPool) matchUser(key, value interface{}) {
9898
//找出同一分数段里,等待时间最长的玩家
9999
rating, err := strconv.Atoi(key.(string))
100+
fmt.Println("当前分数",rating)
100101
if err != nil {
101102
return
102103
}
@@ -123,10 +124,9 @@ func (m *MatchPool) matchUser(key, value interface{}) {
123124
}
124125
if len(MatchUser) >= m.num { //人员已经够了,不再判断
125126
//移除已经匹配成功的数据
126-
127127
continue
128128
}
129-
//再上下每次加1分取 如果加到50都没成功者失败
129+
//TODO 再上下每次加1分取 如果加到50都没成功者失败
130130

131131
}
132132
}

0 commit comments

Comments
 (0)