From 90a1daf23af4ca7343c95f3667c8502b23656682 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 23 Oct 2023 15:58:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=8E=A9=E5=AE=B6=E4=BD=93?= =?UTF-8?q?=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/room.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 61a45ae5e..bbbec812b 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -241,6 +241,10 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr this.curPower = this.NexPower case "ready": if len(this.szSession) == 1 { // AI对战的话直接开始游戏 + this.NexPower = this.player1.Uid + this.curPower = this.player1.Uid + this.player1.Ps = MaxPs + this.player2.Ps = MaxPs if err := this.module.SendMsgToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{ User1: this.player1, User2: this.player2, @@ -251,8 +255,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr }, this.szSession...); err != nil { this.Errorln(err) } - this.NexPower = this.player1.Uid - this.curPower = this.player1.Uid + this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut) } }