From c7cdb49a7bd23442a545cd003f0c6d1fde349aee Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 17 Oct 2024 17:07:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=9C=8D=E5=90=8C=E6=AD=A5=E9=81=93=E5=85=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/base/player.go | 1 + model/baginfo.go | 1 + worldsrv/bagmgr.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gamesrv/base/player.go b/gamesrv/base/player.go index 817912f..d6b6113 100644 --- a/gamesrv/base/player.go +++ b/gamesrv/base/player.go @@ -1267,6 +1267,7 @@ func (this *Player) GetSkillAdd(id int32) int32 { // 增加或减少道具 // 同步到 worldsrv func (this *Player) AddItems(args *model.AddItemParam) { + args.IsGame = true changeItem := map[int32]int64{} for _, v := range args.Change { item := srvdata.GameItemMgr.Get(this.Platform, v.ItemId) diff --git a/model/baginfo.go b/model/baginfo.go index a32f549..a47e8de 100644 --- a/model/baginfo.go +++ b/model/baginfo.go @@ -84,6 +84,7 @@ type AddItemParam struct { GameId, GameFreeId int64 // 游戏id,场次id LogId string // 撤销的id,道具兑换失败 RoomConfigId int32 // 房间配置id + IsGame bool // 是否为gamesrv的操作 } type ChangeItemParam struct { diff --git a/worldsrv/bagmgr.go b/worldsrv/bagmgr.go index 2422c0c..9c39a95 100644 --- a/worldsrv/bagmgr.go +++ b/worldsrv/bagmgr.go @@ -729,7 +729,7 @@ func (this *BagMgr) AddItems(param *model.AddItemParam) (*BagInfo, bag.OpResultC } // 同步游戏服务器 - if p.scene != nil { + if p.scene != nil && !param.IsGame { b, err := netlib.Gob.Marshal(items) if err != nil { logger.Logger.Errorf("AddItems Marshal error(%v)", err) From 9196e235d88e57fa14df557f33889ecb16422633 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Thu, 17 Oct 2024 17:33:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=91=E7=89=8C=E8=B0=83=E6=8E=A7?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=20=E4=BD=BF=E7=94=A8=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E7=89=8C=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/tienlen/scenedata_tienlen.go | 5 ++--- gamesrv/tienlen/scenepolicy_tienlen.go | 10 +++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gamesrv/tienlen/scenedata_tienlen.go b/gamesrv/tienlen/scenedata_tienlen.go index 9509c64..dd941de 100644 --- a/gamesrv/tienlen/scenedata_tienlen.go +++ b/gamesrv/tienlen/scenedata_tienlen.go @@ -561,8 +561,7 @@ func (this *TienLenSceneData) GetFreeGameSceneType() int32 { // 比赛场发牌 // 纯真人,随机发牌 // 有机器人和真人,真人拿好牌 -// mustRandom 必须随机发牌 -func (this *TienLenSceneData) SendHandCard_Match(mustRandom bool) { +func (this *TienLenSceneData) SendHandCard_Match() { this.poker.Shuffle() buf := this.poker.GetPokerBuf() cardss := map[int][]int32{} @@ -584,7 +583,7 @@ func (this *TienLenSceneData) SendHandCard_Match(mustRandom bool) { } } } - if !mustRandom && len(realPlayers) > 0 && len(robotPlayers) > 0 { + if len(realPlayers) > 0 && len(robotPlayers) > 0 { type gradeInfo struct { id int grade int diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 142d2dc..973af23 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -994,14 +994,10 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) { if len(sceneEx.testPokers) > 1 { sceneEx.SendHandCardOdds() } else { - if sceneEx.WGCreateScene.GetCloseCtrl() { - sceneEx.SendHandCard_Match(true) + if sceneEx.IsMatchScene() || sceneEx.IsCustom() { + sceneEx.SendHandCard_Match() } else { - if sceneEx.IsMatchScene() || sceneEx.IsCustom() { - sceneEx.SendHandCard_Match(false) - } else { - sceneEx.SendHandCardOdds() - } + sceneEx.SendHandCardOdds() } } }