From 694e8a599266a3c8f0bfbfd9ed430f12c03b4edb Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 21 Dec 2024 09:05:08 +0800 Subject: [PATCH] =?UTF-8?q?modify=20=E5=8D=81=E4=B8=89=E5=BC=A0=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=91=86=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/thirteen/scenepolicy.go | 21 ++++++++++++++------- model/thirteen.go | 11 ++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gamesrv/thirteen/scenepolicy.go b/gamesrv/thirteen/scenepolicy.go index d4300c2..57bd699 100644 --- a/gamesrv/thirteen/scenepolicy.go +++ b/gamesrv/thirteen/scenepolicy.go @@ -940,6 +940,10 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param } } + if len(params) == 1 { + sceneEx.SelectCards(playerEx, int(params[0])) + } + if len(params) == 0 { playerEx.preCardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} } @@ -974,13 +978,16 @@ func (this *StateOp) OnLeave(s *base.Scene) { for _, player := range sceneEx.players { if player != nil && player.IsGameing() { - mq.Write(model.ThirteenAutoLog{ - Id: primitive.NewObjectID().Hex(), - LogId: sceneEx.logid, - SnId: player.SnId, - AutoTime: player.AutoMill.Milliseconds(), - HandTime: player.HandMill.Milliseconds(), - }, mq.BackThirteenAutoLog) + if !player.IsRobot() { + mq.Write(model.ThirteenAutoLog{ + Id: primitive.NewObjectID().Hex(), + Platform: player.Platform, + LogId: sceneEx.logid, + SnId: player.SnId, + AutoTime: player.AutoMill.Milliseconds(), + HandTime: player.HandMill.Milliseconds(), + }, mq.BackThirteenAutoLog) + } // 使用预选牌 if player.preCardsO != nil && player.preCardsO.PokerType != -1 && (player.cardsO == nil || player.cardsO.PokerType == -1) { diff --git a/model/thirteen.go b/model/thirteen.go index 731ae76..b610205 100644 --- a/model/thirteen.go +++ b/model/thirteen.go @@ -1,9 +1,10 @@ package model type ThirteenAutoLog struct { - Id string - LogId string - SnId int32 - AutoTime int64 // 自动时长,毫秒 - HandTime int64 // 手动时长,毫秒 + Id string `gorm:"primaryKey"` + Platform string `gorm:"-"` + LogId string `gorm:"index;column:logid"` + SnId int32 `gorm:"index;column:snid"` + AutoTime int64 // 自动时长,毫秒 + HandTime int64 // 手动时长,毫秒 }