From bf35dce1b23baeed17b0fc7354a5b4439aa4496e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 15 Dec 2022 11:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6=E6=98=AF?= =?UTF-8?q?=E6=96=B0=E8=8E=B7=E5=BE=97=E7=9A=84=E8=8B=B1=E9=9B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 ++ modules/user/module.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index 04889b95f..bb5b5fc4a 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -119,6 +119,8 @@ type ( CrossSearchUser(nickname string) ([]*pb.DBUser, error) // 搜索远程用户 SearchRmoteUser(nickname string) ([]*pb.DBUser, error) + // 检查是不是新获得的英雄 + CheckTujianHero(session IUserSession, heros []string) []bool } //武器模块 IEquipment interface { diff --git a/modules/user/module.go b/modules/user/module.go index 4dc28e9d6..e910a920a 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -562,3 +562,17 @@ func (this *User) RpcGetCrossUserSession(ctx context.Context, req *pb.UIdReq, re func (this *User) RpcQueryUser(ctx context.Context, req *pb.NameReq, reply *pb.UserDataListResp) error { return this.queryUserFromRemoteDb(req.Name, reply) } +func (this *User) CheckTujianHero(session comm.IUserSession, heros []string) []bool { + sz := make([]bool, len(heros)) + + userEx, err := this.GetUserExpand(session.GetUserId()) + if err != nil { + return sz + } + for i, heroid := range heros { + if _, ok := userEx.Tujian[heroid]; ok { + sz[i] = true + } + } + return sz +}