From a49b02d3a9d51c732e735758786a82811e9a721d Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <179233648@qq.com> Date: Sat, 28 Sep 2024 10:32:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E5=85=85?= =?UTF-8?q?=E5=80=BC=E8=AE=B0=E5=BD=95bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbproxy/svc/l_itemlog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbproxy/svc/l_itemlog.go b/dbproxy/svc/l_itemlog.go index e3a1ddd..35f295c 100644 --- a/dbproxy/svc/l_itemlog.go +++ b/dbproxy/svc/l_itemlog.go @@ -116,11 +116,11 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes) } func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) { - var sql []bson.M var Logs []model.RetClawdollItemLog for _, typeId := range args.TypeIds { var SubLogs []model.RetClawdollItemLog + var sql []bson.M sql = append(sql, bson.M{"snid": args.Snid, "typeid": typeId}) switch typeId { From b5099d9c37af75998d3e59e0ffd3cefec9435b04 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Sat, 28 Sep 2024 12:02:57 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=91=E6=8D=A2=E8=AE=B0=E5=BD=95BUG?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_bag.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldsrv/action_bag.go b/worldsrv/action_bag.go index 66a00a0..b20697d 100644 --- a/worldsrv/action_bag.go +++ b/worldsrv/action_bag.go @@ -626,9 +626,11 @@ func CSDollChange(s *netlib.Session, packetid int, data interface{}, sid int64) }) logger.Logger.Trace("背包内使用兑换娃娃卡 bagInfo = ", bagInfo) pack.RetCode = rest + if isF { + itemId := item.ItemId task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - dollLog := model.NewDbBagChangeDoll(p.Platform, p.SnId, item.ItemId, 1, 0, "", msg.Addr, msg.UserName, msg.UserTel) + dollLog := model.NewDbBagChangeDoll(p.Platform, p.SnId, itemId, 1, 0, "", msg.Addr, msg.UserName, msg.UserTel) return model.InsertDbBagChangeDollLog(dollLog) }), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) { if data != nil { From f642c3263195fdaffbfa6ec847c30db4a9eca2d0 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Sat, 28 Sep 2024 14:32:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_bag.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/worldsrv/action_bag.go b/worldsrv/action_bag.go index b20697d..f5d68c7 100644 --- a/worldsrv/action_bag.go +++ b/worldsrv/action_bag.go @@ -633,9 +633,6 @@ func CSDollChange(s *netlib.Session, packetid int, data interface{}, sid int64) dollLog := model.NewDbBagChangeDoll(p.Platform, p.SnId, itemId, 1, 0, "", msg.Addr, msg.UserName, msg.UserTel) return model.InsertDbBagChangeDollLog(dollLog) }), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) { - if data != nil { - logger.Logger.Errorf("CSDollChange err: %v", data) - } }), "CSDollChange").Start() } From bbae2da8dae96ae5f8fb4c7e0d9289f314d0f97a Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <179233648@qq.com> Date: Sat, 28 Sep 2024 17:48:48 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E5=85=91?= =?UTF-8?q?=E6=8D=A2=E8=AE=B0=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbproxy/svc/l_itemlog.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbproxy/svc/l_itemlog.go b/dbproxy/svc/l_itemlog.go index 35f295c..521675a 100644 --- a/dbproxy/svc/l_itemlog.go +++ b/dbproxy/svc/l_itemlog.go @@ -117,6 +117,7 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes) func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) { + limitDataNum := 200 var Logs []model.RetClawdollItemLog for _, typeId := range args.TypeIds { var SubLogs []model.RetClawdollItemLog @@ -137,7 +138,7 @@ func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *m return } - err = c.Find(bson.M{"$and": sql}).Select(bson.M{"itemid": 1, "createts": 1, "typeid": 1, "count": 1, "logtype": 1}).All(&SubLogs) + err = c.Find(bson.M{"$and": sql}).Sort("-createts").Limit(limitDataNum).Select(bson.M{"itemid": 1, "createts": 1, "typeid": 1, "count": 1, "logtype": 1}).All(&SubLogs) Logs = append(Logs, SubLogs...) } @@ -155,8 +156,9 @@ func (svc *ItemLogSvc) GetClawdollSuccessItemLog(args *model.ClawdollSuccessItem return } + limitDataNum := 300 var datas []model.ItemLog - err = c.Find(cond).All(&datas) + err = c.Find(cond).Sort("-createts").Limit(limitDataNum).All(&datas) if err != nil { logger.Logger.Error("GetClawdollSuccessItemLog error: ", err) return err From a48a9fede405309afdf31fc6022c60984bed61a7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <179233648@qq.com> Date: Sat, 28 Sep 2024 18:31:09 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=A8=83=E5=A8=83=E5=8D=A1=E4=B8=8B?= =?UTF-8?q?=E6=8A=93=E8=8E=B7=E5=BE=97=E5=A8=83=E5=A8=83=E5=8D=A1=E6=94=B9?= =?UTF-8?q?=E5=9B=9E=E6=AD=A3=E5=B8=B8=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/action_clawdoll.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gamesrv/clawdoll/action_clawdoll.go b/gamesrv/clawdoll/action_clawdoll.go index 75837bb..3da5a08 100644 --- a/gamesrv/clawdoll/action_clawdoll.go +++ b/gamesrv/clawdoll/action_clawdoll.go @@ -109,6 +109,7 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data case 2: if msg.Result == 1 { // 获得娃娃卡 + playerEx.CatchCardClawdoll() playerEx.IsWin = true logger.Logger.Tracef("下抓成功!!!!!!!!!!!!snid = %v", msg.Snid) @@ -118,8 +119,6 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data playerEx.IsWin = false } - playerEx.CatchCardClawdoll() - logger.Logger.Tracef("ClawDoll StatePlayGame OnPlayerOp Grab response, SnId= %v", msg.Snid) s.ChangeSceneState(rule.ClawDollSceneStateBilled)