File tree Expand file tree Collapse file tree 5 files changed +8
-13
lines changed
第一季 从零开始写游戏服务器 第二期/最新课节--课程代码/vender/src/LollipopGo/LollipopGo Expand file tree Collapse file tree 5 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ package match
10
10
达到最大匹配时间,则跳过等待下一秒的匹配;如果达到最大匹配时间,还是没匹配到足够的人,则给这个几个人
11
11
凑机器人,提交匹配成功。
12
12
13
-
14
13
*/
15
14
16
15
type MatchMoudle interface {
17
16
GetMatchResult (string , int ) []byte
18
17
PutMatch ([]byte )
19
18
GetMatchNum (string ) int
20
19
TimerMatch ()
20
+ DestroyMatch ()
21
21
}
Original file line number Diff line number Diff line change @@ -23,20 +23,16 @@ func newPoolMatch(IMax int) (MapPoolMatch chan map[int]*PoolMatch) {
23
23
24
24
func (this * PoolMatch ) PutMatch (data map [int ]* PoolMatch ) {
25
25
if len (MapPoolMatch ) >= PoolMax {
26
- log .Debug ("超过了pool的上限! " )
26
+ log .Debug ("超过了 pool的上限! " )
27
27
return
28
28
}
29
29
MapPoolMatch <- data
30
30
}
31
31
32
- func (this * PoolMatch ) GetMatchResult () {
32
+ func (this * PoolMatch ) GetMatchResult () {}
33
33
34
- }
35
-
36
- func (this * PoolMatch ) GetMatchNum () {
34
+ func (this * PoolMatch ) GetMatchNum () {}
37
35
38
- }
36
+ func ( this * PoolMatch ) TimerMatch () { }
39
37
40
- func (this * PoolMatch ) TimerMatch () {
41
-
42
- }
38
+ func (this * PoolMatch ) DestroyMatch () {}
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ type RoomMatch struct {
14
14
RoomPlayerMap map [string ]* player.PlayerSt // 房间玩家的结构信息
15
15
}
16
16
17
- // 新注册匹配
18
- func newMatch () (MapMatch map [string ]* RoomMatch ) {
17
+ func newRoomMatch () (MapMatch map [string ]* RoomMatch ) {
19
18
20
- return nil
19
+ return make ( MapMatch map [ string ] * RoomMatch )
21
20
}
You can’t perform that action at this time.
0 commit comments