Merge remote-tracking branch 'origin/develop' into dev_slots

This commit is contained in:
tomas 2024-10-18 09:23:41 +08:00
commit 53e02f9c1f
5 changed files with 8 additions and 11 deletions

View File

@ -1267,6 +1267,7 @@ func (this *Player) GetSkillAdd(id int32) int32 {
// 增加或减少道具 // 增加或减少道具
// 同步到 worldsrv // 同步到 worldsrv
func (this *Player) AddItems(args *model.AddItemParam) { func (this *Player) AddItems(args *model.AddItemParam) {
args.IsGame = true
changeItem := map[int32]int64{} changeItem := map[int32]int64{}
for _, v := range args.Change { for _, v := range args.Change {
item := srvdata.GameItemMgr.Get(this.Platform, v.ItemId) item := srvdata.GameItemMgr.Get(this.Platform, v.ItemId)

View File

@ -561,8 +561,7 @@ func (this *TienLenSceneData) GetFreeGameSceneType() int32 {
// 比赛场发牌 // 比赛场发牌
// 纯真人,随机发牌 // 纯真人,随机发牌
// 有机器人和真人,真人拿好牌 // 有机器人和真人,真人拿好牌
// mustRandom 必须随机发牌 func (this *TienLenSceneData) SendHandCard_Match() {
func (this *TienLenSceneData) SendHandCard_Match(mustRandom bool) {
this.poker.Shuffle() this.poker.Shuffle()
buf := this.poker.GetPokerBuf() buf := this.poker.GetPokerBuf()
cardss := map[int][]int32{} 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 { type gradeInfo struct {
id int id int
grade int grade int

View File

@ -994,14 +994,10 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) {
if len(sceneEx.testPokers) > 1 { if len(sceneEx.testPokers) > 1 {
sceneEx.SendHandCardOdds() sceneEx.SendHandCardOdds()
} else { } else {
if sceneEx.WGCreateScene.GetCloseCtrl() { if sceneEx.IsMatchScene() || sceneEx.IsCustom() {
sceneEx.SendHandCard_Match(true) sceneEx.SendHandCard_Match()
} else { } else {
if sceneEx.IsMatchScene() || sceneEx.IsCustom() { sceneEx.SendHandCardOdds()
sceneEx.SendHandCard_Match(false)
} else {
sceneEx.SendHandCardOdds()
}
} }
} }
} }

View File

@ -84,6 +84,7 @@ type AddItemParam struct {
GameId, GameFreeId int64 // 游戏id,场次id GameId, GameFreeId int64 // 游戏id,场次id
LogId string // 撤销的id,道具兑换失败 LogId string // 撤销的id,道具兑换失败
RoomConfigId int32 // 房间配置id RoomConfigId int32 // 房间配置id
IsGame bool // 是否为gamesrv的操作
} }
type ChangeItemParam struct { type ChangeItemParam struct {

View File

@ -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) b, err := netlib.Gob.Marshal(items)
if err != nil { if err != nil {
logger.Logger.Errorf("AddItems Marshal error(%v)", err) logger.Logger.Errorf("AddItems Marshal error(%v)", err)