From 046461d4acd8f61f2cb73fe803a5ac25c81b7240 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Mon, 21 Oct 2024 10:52:17 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=BC=80=E5=90=AF=E7=A4=BC=E7=9B=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/programs.txt | 3 +-- worldsrv/action_bag.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/shell/programs.txt b/shell/programs.txt index f49d1bc..2155807 100644 --- a/shell/programs.txt +++ b/shell/programs.txt @@ -4,5 +4,4 @@ gatesrv worldsrv gamesrv robot -ranksrv -machine \ No newline at end of file +ranksrv \ No newline at end of file diff --git a/worldsrv/action_bag.go b/worldsrv/action_bag.go index 76a4dab..95b2249 100644 --- a/worldsrv/action_bag.go +++ b/worldsrv/action_bag.go @@ -195,7 +195,6 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e } if !p.IsRob && tp1 >= 0 { mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_CollectBox, tp1, v.ItemNum)) - mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_CollectBox, 1)) } } } @@ -270,6 +269,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e } } gainFunc(common.GainWay_Collect, "player", "集卡活动") + mq.Write(model.GenerateActivityLog(p.SnId, p.Platform, model.ActivityLog_CollectBox, 1)) default: logger.Logger.Warnf("道具使用未定义", msg.ItemId) From 69caf194912bc7716347149734758a0962df96a4 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Mon, 21 Oct 2024 11:40:58 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- machine/action/action_server.go | 2 +- machine/machinedoll/command.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/machine/action/action_server.go b/machine/action/action_server.go index a6ad565..23e8450 100644 --- a/machine/action/action_server.go +++ b/machine/action/action_server.go @@ -135,7 +135,7 @@ func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data inte // 下抓 func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interface{}) error { - logger.Logger.Tracef("SMDollMachineGrabHandler %v", data) + fmt.Println("下抓SMDollMachineGrabHandler %v", data) msg, ok := data.(*machine.SMDollMachineGrab) if !ok { return nil diff --git a/machine/machinedoll/command.go b/machine/machinedoll/command.go index 3bb9bb2..bbe2a0f 100644 --- a/machine/machinedoll/command.go +++ b/machine/machinedoll/command.go @@ -382,8 +382,8 @@ var data = []byte{ 0x65, //0 几币几玩 0x00, //1 几币几玩占用位 0x2D, //2 游戏时间 - 0x01, //3 出奖模式0 无概率 1 随机模式 2 固定模式 3 冠兴模式 - 0x0A, //4 出奖概率 + 0x00, //3 出奖模式0 无概率 1 随机模式 2 固定模式 3 冠兴模式 + 0x14, //4 出奖概率 0x00, //5 出奖概率占用位 0x00, //6 空中抓物 0关闭 1开启 0x00, //7 连续投币赠送 范围0~100 From 147f95685758235c759447a2ff4df0869947f541 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 13:54:36 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E3=80=90=E5=A8=83=E5=A8=83=E6=9C=BA?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E6=A6=82=E7=8E=87=E5=85=AC=E5=BC=8F=E3=80=91?= =?UTF-8?q?=20https://www.tapd.cn/31044302/prong/stories/view/113104430200?= =?UTF-8?q?1001287?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scene_clawdoll.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index 1c60d81..efa13c4 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -150,10 +150,12 @@ func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) { return } - if len(this.players) <= 0 { - logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) - // 发送http Get请求 关闭直播间流 - operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) + if !rule.DebugSwitch { + if len(this.players) <= 0 { + logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) + // 发送http Get请求 关闭直播间流 + operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) + } } } @@ -349,18 +351,24 @@ func (this *SceneEx) GetPlayGrabType(player *PlayerEx) int32 { machineId := this.GetDBGameFree().GetId() % 6080000 machineInfo := this.GetMachineServerInfo(machineId, player.Platform) if machineInfo == nil { - logger.Logger.Errorf("GetPlayGrabType machineId: %v, platform: %v", machineId, player.Platform) + logger.Logger.Errorf("Clawdoll GetPlayGrabType machineId: %v, platform: %v", machineId, player.Platform) return rule.ClawWeak } ProfitRate := common.RandFloat(machineInfo.ProfitMin, machineInfo.ProfitMax) - strongRate := machineInfo.CatchPrice/machineInfo.BuyPrice*ProfitRate*float64(this.PayCoinCount) - 1 + strongRate := (machineInfo.CatchPrice/(machineInfo.BuyPrice*ProfitRate))*float64(this.PayCoinCount) - 1 + + logger.Logger.Tracef("Clawdoll GetPlayGrabType: SnId: %v, PayCoinCount:%v, ProfitRate:%v, strongRate:%v", player.SnId, this.PayCoinCount, ProfitRate, strongRate) + if strongRate <= 0.00000 { return rule.ClawWeak } else if strongRate > 0.00000 && strongRate <= 0.99999 { // 再次随机 newRate := common.RandFromRangeInt64(0, 100) - if int64(strongRate*100) > newRate { + logger.Logger.Tracef("Clawdoll GetPlayGrabType: newRate:%v, SnId: %v, PayCoinCount:%v, ProfitRate:%v, strongRate:%v ", newRate, player.SnId, this.PayCoinCount, ProfitRate, strongRate) + + if int64(strongRate*100) >= newRate { + logger.Logger.Tracef("Clawdoll GetPlayGrabType: SnId: %v gain ClawStrong, PayCoinCount:%v", player.SnId, this.PayCoinCount) return rule.ClawStrong } else { return rule.ClawWeak From dde83e46a6b501cb26d07d550fc2a405b2d3ccf9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 14:30:53 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E3=80=90=E5=A8=83=E5=A8=83=E6=9C=BA?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E6=A6=82=E7=8E=87=E5=85=AC=E5=BC=8F=E3=80=91?= =?UTF-8?q?=20https://www.tapd.cn/31044302/prong/stories/view/113104430200?= =?UTF-8?q?1001287?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/action_clawdoll.go | 23 ----------- gamesrv/clawdoll/scene_clawdoll.go | 11 ++--- gamesrv/clawdoll/scenepolicy_clawdoll.go | 51 ------------------------ 3 files changed, 4 insertions(+), 81 deletions(-) diff --git a/gamesrv/clawdoll/action_clawdoll.go b/gamesrv/clawdoll/action_clawdoll.go index e01c784..3da5a08 100644 --- a/gamesrv/clawdoll/action_clawdoll.go +++ b/gamesrv/clawdoll/action_clawdoll.go @@ -8,7 +8,6 @@ import ( "mongo.games.com/game/model" "mongo.games.com/game/protocol/clawdoll" "mongo.games.com/game/protocol/machine" - "mongo.games.com/game/srvdata" "mongo.games.com/goserver/core/basic" "mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/netlib" @@ -240,28 +239,6 @@ func (h *CSGetPlayerLogHandler) Process(s *netlib.Session, packetid int, data in var err error var ItemLogs []model.ClawdollSuccessItemLog - if rule.DebugSwitch { - var items []*model.Item - itemData := srvdata.GameItemMgr.Get(p.Platform, common.ItemIDClawdoll) - if itemData != nil { - items = append(items, &model.Item{ - ItemId: common.ItemIDClawdoll, - ItemNum: int64(machineInfo.CostItemNum), - }) - } - - p.AddItems(&model.AddItemParam{ - Platform: p.Platform, - SnId: p.SnId, - Change: items, - GainWay: common.GainWayClawdollCostItem, - Operator: "system", - Remark: "娃娃机上分扣除道具", - GameId: int64(sceneEx.GameId), - GameFreeId: int64(sceneEx.GetGameFreeId()), - }) - } - //娃娃机道具使用日志 task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { ItemLogs, err = model.GetClawdollSuccessItemLog(p.Platform, p.SnId) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index efa13c4..a1d6849 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -150,14 +150,11 @@ func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) { return } - if !rule.DebugSwitch { - if len(this.players) <= 0 { - logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) - // 发送http Get请求 关闭直播间流 - operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) - } + if len(this.players) <= 0 { + logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) + // 发送http Get请求 关闭直播间流 + operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) } - } func (this *SceneEx) SceneDestroy(force bool) { //销毁房间 diff --git a/gamesrv/clawdoll/scenepolicy_clawdoll.go b/gamesrv/clawdoll/scenepolicy_clawdoll.go index 188dab5..7a5fbcc 100644 --- a/gamesrv/clawdoll/scenepolicy_clawdoll.go +++ b/gamesrv/clawdoll/scenepolicy_clawdoll.go @@ -530,23 +530,6 @@ func (this *StateWait) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par // 1-前 2-后 3-左 4-右 5-投币 sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonPayCoin) - if rule.DebugSwitch { - playerEx.CostPlayCoin() - - sceneEx.playingSnid = p.SnId - - //发送向前移动指令 - //sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonBack) - - s.ChangeSceneState(rule.ClawDollSceneStateStart) - sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart)) - - ClawdollBroadcastRoomState(s) - ClawdollSendPlayerInfo(s) - - ClawdollBroadcastPlayingInfo(s) - } - logger.Logger.Trace("(ClawDoll this *StateWait) OnPlayerOp payCoin, sceneId=", s.GetSceneId(), " player=", p.SnId, " machineId=", sceneEx.machineId) //sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params) @@ -692,24 +675,6 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para //1-弱力抓 2 -强力抓 sceneEx.OnPlayerSMGrabOp(p.SnId, int32(sceneEx.machineId), grapType) - if rule.DebugSwitch { - if sceneEx.RoundId/2 == 1 { - // 获得娃娃卡 - playerEx.CatchCardClawdoll() - - playerEx.IsWin = true - - } else { - playerEx.IsWin = false - } - - s.ChangeSceneState(rule.ClawDollSceneStateBilled) - sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateBilled)) - - ClawdollBroadcastRoomState(s) - ClawdollSendPlayerInfo(s) - } - sceneEx.Gaming = false case rule.ClawDollPlayerOpMove: @@ -934,22 +899,6 @@ func (this *StateWaitPayCoin) OnPlayerOp(s *base.Scene, p *base.Player, opcode i playerEx.ReStartGame() sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params) - if rule.DebugSwitch { - playerEx.CostPlayCoin() - - sceneEx.playingSnid = p.SnId - - //发送向前移动指令 - //sceneEx.OnPlayerSMPerateOp(p.SnId, int32(sceneEx.machineId), rule.ButtonBack) - - s.ChangeSceneState(rule.ClawDollSceneStateStart) - sceneEx.SetPlayingState(int32(rule.ClawDollSceneStateStart)) - - ClawdollBroadcastRoomState(s) - ClawdollSendPlayerInfo(s) - - ClawdollBroadcastPlayingInfo(s) - } case rule.ClawDollPlayerCancelPayCoin: if sceneEx.playingSnid != playerEx.SnId { From 50e9d4569370b376ebde1dc261c61fae0f075fae Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 21 Oct 2024 14:35:18 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B4=BB=E5=8A=A8mq=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapi/deprecated.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webapi/deprecated.go b/webapi/deprecated.go index 4540418..bbffa29 100644 --- a/webapi/deprecated.go +++ b/webapi/deprecated.go @@ -2,10 +2,14 @@ package webapi import ( "errors" + "time" + + "mongo.games.com/goserver/core/logger" + + "mongo.games.com/game/model" + "mongo.games.com/game/mq" "mongo.games.com/game/proto" "mongo.games.com/game/protocol/webapi" - "mongo.games.com/goserver/core/logger" - "time" ) type PlayerStatement struct { @@ -141,6 +145,7 @@ func API_CreateOrder(appId, orderId string, configid, SnId, shopId int32, platfo logger.Logger.Error("API_CreateOrder Unmarshal err:", err) return nil } + mq.Write(model.GenerateActivityLog(SnId, platform, buyType, 0)) return ret } From 7343ab7ec08f074f3dd90db2453c2c0c8b53a5a8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 14:42:29 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E3=80=90=E5=A8=83=E5=A8=83=E6=9C=BA?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E6=A6=82=E7=8E=87=E5=85=AC=E5=BC=8F=E3=80=91?= =?UTF-8?q?=20https://www.tapd.cn/31044302/prong/stories/view/113104430200?= =?UTF-8?q?1001287?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scenepolicy_clawdoll.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamesrv/clawdoll/scenepolicy_clawdoll.go b/gamesrv/clawdoll/scenepolicy_clawdoll.go index 7a5fbcc..6b2d895 100644 --- a/gamesrv/clawdoll/scenepolicy_clawdoll.go +++ b/gamesrv/clawdoll/scenepolicy_clawdoll.go @@ -56,6 +56,10 @@ func (this *PolicyClawdoll) OnStart(s *base.Scene) { func (this *PolicyClawdoll) OnStop(s *base.Scene) { logger.Logger.Trace("(this *PolicyClawdoll) OnStop , sceneId=", s.GetSceneId()) + sceneEx, ok := s.ExtraData.(*SceneEx) + if ok { + sceneEx.ShutDown() + } } func (this *PolicyClawdoll) OnTick(s *base.Scene) { From 521a1e1c5875da37bbea9d8141ae6063fb2fdd21 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 14:48:37 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E3=80=90=E5=A8=83=E5=A8=83=E6=9C=BA?= =?UTF-8?q?=E6=8A=93=E5=8F=96=E6=A6=82=E7=8E=87=E5=85=AC=E5=BC=8F=E3=80=91?= =?UTF-8?q?=20https://www.tapd.cn/31044302/prong/stories/view/113104430200?= =?UTF-8?q?1001287?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scene_clawdoll.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index a1d6849..e518705 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -525,7 +525,7 @@ func (this *SceneEx) SavePayCoinCount(asyn bool) { machineId := this.GetDBGameFree().GetId() PayCoinCountDBKey := fmt.Sprintf("Clawdoll_PayCoinCount_%v", machineId) - saveBuff := strconv.Itoa(int(machineId)) + saveBuff := strconv.Itoa(int(this.PayCoinCount)) if asyn { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { return model.UptStrKVGameData(PayCoinCountDBKey, string(saveBuff)) From 5807aebce0b0fa7215bf5821fe0f62ba093df8ad Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 15:13:22 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scene_clawdoll.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index e518705..d4762e0 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -241,6 +241,8 @@ func (this *SceneEx) init() bool { this.Clear() this.PayCoinCount = this.LoadPayCoinCount() + + this.PayCoinCount = 21 return true } @@ -437,6 +439,8 @@ func (this *SceneEx) TimeOutPlayGrab() bool { this.PayCoinCount = 0 } + logger.Logger.Trace("ClawDoll StatePlayGame OnPlayerOp Grab-----SnId:", playerEx.SnId, " grapType: ", grapType) + this.OnPlayerSMGrabOp(this.playingSnid, int32(this.machineId), grapType) } From 944dba45d8ef51dc5eff422d73db88a1ed7d2c4d Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 15:15:12 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scene_clawdoll.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index d4762e0..a725773 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -241,8 +241,6 @@ func (this *SceneEx) init() bool { this.Clear() this.PayCoinCount = this.LoadPayCoinCount() - - this.PayCoinCount = 21 return true }