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
1010达到最大匹配时间,则跳过等待下一秒的匹配;如果达到最大匹配时间,还是没匹配到足够的人,则给这个几个人
1111凑机器人,提交匹配成功。
1212
13-
1413*/
1514
1615type MatchMoudle interface {
1716 GetMatchResult (string , int ) []byte
1817 PutMatch ([]byte )
1918 GetMatchNum (string ) int
2019 TimerMatch ()
20+ DestroyMatch ()
2121}
Original file line number Diff line number Diff line change @@ -23,20 +23,16 @@ func newPoolMatch(IMax int) (MapPoolMatch chan map[int]*PoolMatch) {
2323
2424func (this * PoolMatch ) PutMatch (data map [int ]* PoolMatch ) {
2525 if len (MapPoolMatch ) >= PoolMax {
26- log .Debug ("超过了pool的上限! " )
26+ log .Debug ("超过了 pool的上限! " )
2727 return
2828 }
2929 MapPoolMatch <- data
3030}
3131
32- func (this * PoolMatch ) GetMatchResult () {
32+ func (this * PoolMatch ) GetMatchResult () {}
3333
34- }
35-
36- func (this * PoolMatch ) GetMatchNum () {
34+ func (this * PoolMatch ) GetMatchNum () {}
3735
38- }
36+ func ( this * PoolMatch ) TimerMatch () { }
3937
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 {
1414 RoomPlayerMap map [string ]* player.PlayerSt // 房间玩家的结构信息
1515}
1616
17- // 新注册匹配
18- func newMatch () (MapMatch map [string ]* RoomMatch ) {
17+ func newRoomMatch () (MapMatch map [string ]* RoomMatch ) {
1918
20- return nil
19+ return make ( MapMatch map [ string ] * RoomMatch )
2120}
You can’t perform that action at this time.
0 commit comments