From 33af640bd48ede49ef043f2db17c149dd3bdc02b Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 1 Sep 2022 15:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=9C=88=E5=AD=90=E7=A7=98?= =?UTF-8?q?=E5=A2=83=E6=B5=8B=E8=AF=95=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_msgdistrib.json | 15 +++++++++++++++ modules/moonfantasy/api_trigger.go | 4 ++-- modules/moonfantasy/modelDream.go | 5 +++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/json/game_msgdistrib.json b/bin/json/game_msgdistrib.json index b8f2453ec..d6aeafb4c 100644 --- a/bin/json/game_msgdistrib.json +++ b/bin/json/game_msgdistrib.json @@ -38,5 +38,20 @@ "msgid": "chat.send", "routrules": "~/worker", "describe": "聊天消息发送" + }, + { + "msgid": "forum.like", + "routrules": "~/worker", + "describe": "论坛点赞入口" + }, + { + "msgid": "moonfantasy.trigger", + "routrules": "~/worker", + "describe": "月之秘境触发接口" + }, + { + "msgid": "moonfantasy.dare", + "routrules": "~/worker", + "describe": "月之秘境参战接口" } ] \ No newline at end of file diff --git a/modules/moonfantasy/api_trigger.go b/modules/moonfantasy/api_trigger.go index 9b3574bdc..963312764 100644 --- a/modules/moonfantasy/api_trigger.go +++ b/modules/moonfantasy/api_trigger.go @@ -8,7 +8,6 @@ import ( "math/big" "time" - "go.mongodb.org/mongo-driver/mongo" "google.golang.org/protobuf/proto" ) @@ -39,7 +38,7 @@ func (this *apiComp) Trigger(session comm.IUserSession, req *pb.MoonfantasyTrigg issucc = false } if issucc { - if uexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil && err != mongo.ErrNoDocuments { + if uexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { code = pb.ErrorCode_DBError this.module.Errorln(err) return @@ -72,6 +71,7 @@ func (this *apiComp) Trigger(session comm.IUserSession, req *pb.MoonfantasyTrigg Avatar: req.Avatar, Uname: req.Uname, Slv: req.Ulv, + Stag: session.GetServiecTag(), AppendInt: int64(mdata.Monster), AppendStr: mdata.Id, } diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index eb70cc4be..e8d4cbc2e 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -3,6 +3,7 @@ package moonfantasy import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" "go_dreamfactory/modules" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -65,8 +66,8 @@ func (this *modelDreamComp) noticeuserfriend(stag, uid string, chat *pb.DBChat) err error ) model := db.NewDBModel(comm.TableFriend, 0, db.ServerDBConn(stag)) - friend := &pb.DBFriend{Uid: uid} - if err = model.Get(uid, friend); err != nil { + friend := &pb.DBFriend{Uid: uid, FriendIds: make([]string, 0)} + if err = model.Get(uid, friend); err != nil && err != mgo.MongodbNil { this.module.Errorln(err) return }