modify 十三张手动摆牌

This commit is contained in:
sk 2024-12-21 09:05:08 +08:00
parent b186967189
commit 694e8a5992
2 changed files with 20 additions and 12 deletions

View File

@ -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() {
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) {

View File

@ -1,9 +1,10 @@
package model
type ThirteenAutoLog struct {
Id string
LogId string
SnId int32
Id string `gorm:"primaryKey"`
Platform string `gorm:"-"`
LogId string `gorm:"index;column:logid"`
SnId int32 `gorm:"index;column:snid"`
AutoTime int64 // 自动时长,毫秒
HandTime int64 // 手动时长,毫秒
}