From f406d53316254c17d5b1ccb78fc9e9de509244fc Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 25 Oct 2023 14:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E7=A7=AF=E5=88=86=E6=94=B9?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/api_match.go | 16 ---------------- modules/entertainment/match.go | 20 +------------------- modules/entertainment/room.go | 3 +++ modules/entertainment/xxlPlat.go | 10 ++++------ 4 files changed, 8 insertions(+), 41 deletions(-) diff --git a/modules/entertainment/api_match.go b/modules/entertainment/api_match.go index 98edbdd9c..eeb8d4e32 100644 --- a/modules/entertainment/api_match.go +++ b/modules/entertainment/api_match.go @@ -48,22 +48,6 @@ func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) } } - // if users, err := this.module.ModuleUser.UserOnlineList(); err == nil { - // if len(users) > 0 { - // bMatch = true - // s2, bMatch = this.module.GetUserSession(users[0].Uid) - // p2 = &pb.PlayerData{ - // Uid: s2.GetUserId(), - // Name: "", - // Score: 0, - // Ps: 0, - // Cardid: req.Idcard, - // } - // } else { // 测试用 - - // } - // - // } roomid = this.module.gameMgr.CreateRoom(session, s2, p1, p2) session.SendMsg(string(this.module.GetType()), "match", &pb.EntertainMatchResp{ Maych: true, diff --git a/modules/entertainment/match.go b/modules/entertainment/match.go index 3ab124114..ae9f3f679 100644 --- a/modules/entertainment/match.go +++ b/modules/entertainment/match.go @@ -101,25 +101,7 @@ func (this *matchComp) MatchNotic(players map[string]interface{}) (err error) { } } } - // roomid := this.module.gameMgr.CreateRoom(session, s2, p1, p2) + //roomid := this.module.gameMgr.CreateRoom(p1, p2) - // if leftnum > 0 { - // if ais, err = this.module.parkourComp.matcheAI(dan, leftnum); err != nil { - // this.module.Error("matcheAI err!", log.Field{Key: "key", Value: err.Error()}) - // return - // } - - // if len(red) < 3 { - // n = 3 - int32(len(red)) - // red = append(red, ais[0:n]...) - // ais = ais[n:] - // } - // if len(bule) < 3 { - // bule = append(bule, ais[0:3-len(bule)]...) - // } - // } - // if err = this.module.createbattle(red, bule); err != nil { - // this.module.Error("createbattle err!", log.Field{Key: "key", Value: err.Error()}) - // } return } diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 845a4f269..8d34868de 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -132,6 +132,7 @@ func (this *Room) AiOperator() { if len(szMap) > 0 { this.player2.Energy += szMap[len(szMap)-1].CurEnergy + this.player2.Score += szMap[len(szMap)-1].CurSocre } if bAddPs { @@ -319,8 +320,10 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr if len(szMap) > 0 { if color == 1 { this.player1.Energy += szMap[len(szMap)-1].CurEnergy + this.player1.Score += szMap[len(szMap)-1].CurSocre } else { this.player2.Energy += szMap[len(szMap)-1].CurEnergy + this.player2.Score += szMap[len(szMap)-1].CurSocre } } if this.player1.Ps <= 0 { // 权限给下一个人 diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 3cd065f93..8015d93b8 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -445,21 +445,20 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, xc var energy int32 for { curScore = 0 - energy = 0 if bRet, s, c := this.Check5X(color); bRet { - fmt.Printf("=====检测消除5x===========\n") + //fmt.Printf("=====检测消除5x===========\n") curScore += s energy += c xc = true // 只要有 4x 5x 就标记ture } if bRet, s, c := this.Check4X(color); bRet { - fmt.Printf("=====检测消除4x===========\n") + //fmt.Printf("=====检测消除4x===========\n") curScore += s energy += c xc = true } if bRet, s, c := this.Check3X(color); bRet { - fmt.Printf("=====检测消除3x===========\n") + //fmt.Printf("=====检测消除3x===========\n") curScore += s energy += c } @@ -468,7 +467,7 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, xc if this.DropGirde() { szMap = append(szMap, &pb.MapData{ Data: this.GetPalatData(), - CurSocre: curScore, + CurSocre: score, CurEnergy: energy, }) } @@ -479,7 +478,6 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, xc break } } - return }