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) } }