Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
153ffd253f
@ -36,6 +36,6 @@ func (this *apiComp) ActivationFetter(session comm.IUserSession, req *pb.Library
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["activation"] = fetter.Activation
|
||||
this.module.modelLibrary.modifyLibraryDataByObjId(session.GetUserId(), fetter.Id, mapData)
|
||||
|
||||
rsp.Data = fetter
|
||||
return
|
||||
}
|
||||
|
@ -22,13 +22,13 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.LibraryGetRewa
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
rsp := &pb.LibraryGetListResp{}
|
||||
defer session.SendMsg(string(this.module.GetType()), LibraryGetListResp, rsp)
|
||||
defer session.SendMsg(string(this.module.GetType()), LibraryGetRewardResp, rsp)
|
||||
fetter := this.module.getLibraryByObjID(session.GetUserId(), req.ObjId)
|
||||
if fetter == nil {
|
||||
code = pb.ErrorCode_LibraryNoData
|
||||
return
|
||||
}
|
||||
conf := this.configure.GetLibraryFetter(fetter.Fid, req.Fetterlv)
|
||||
conf := this.module.configure.GetLibraryFetter(fetter.Fid, req.Fetterlv)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
|
@ -66,8 +66,7 @@ func (this *Library) GetLibraryListByFid(uid string, fid int32) *pb.DBLibrary {
|
||||
}
|
||||
|
||||
//通过羁绊id 创建多个羁绊信息
|
||||
func (this *Library) CreateLibrary(uid string, fids []int32, heroConfId string) (code pb.ErrorCode, objLibrary []*pb.DBLibrary) {
|
||||
for _, fid := range fids {
|
||||
func (this *Library) CreateLibrary(uid string, fid int32, heroConfId string) (code pb.ErrorCode, objLibrary []*pb.DBLibrary) {
|
||||
obj := &pb.DBLibrary{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
@ -87,11 +86,10 @@ func (this *Library) CreateLibrary(uid string, fids []int32, heroConfId string)
|
||||
}
|
||||
if err := this.modelLibrary.createLibrary(uid, obj); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
break
|
||||
|
||||
}
|
||||
objLibrary = append(objLibrary, obj)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
@ -108,7 +106,7 @@ func (this *Library) GetHeroFetterList(uid string) []*pb.DBHeroFetter {
|
||||
|
||||
// 创建一条英雄羁绊信息
|
||||
func (this *Library) createHeroFetter(uid string, heroConfId string) (code pb.ErrorCode) {
|
||||
|
||||
this.modelFetter.getHeroFetterList(uid)
|
||||
obj := &pb.DBHeroFetter{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
@ -149,12 +147,12 @@ func (this *Library) AddHeroFetterData(uid string, heroConfId string) {
|
||||
obj := this.GetLibraryListByFid(uid, fid)
|
||||
if obj == nil { // 没有羁绊信息
|
||||
this.createHeroFetter(uid, heroConfId)
|
||||
this.CreateLibrary(uid, []int32{fid}, heroConfId)
|
||||
this.CreateLibrary(uid, fid, heroConfId)
|
||||
|
||||
} else { // 羁绊信息中没有这个heroid 也需要加进来
|
||||
for k, v := range obj.Hero {
|
||||
if v == 0 && k == heroConfId {
|
||||
v = 1
|
||||
obj.Hero[k] = 1
|
||||
}
|
||||
}
|
||||
// 重新计算最低等级
|
||||
|
@ -20,7 +20,7 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
//获取装备列表请求
|
||||
//获取秘境列表请求
|
||||
type MoonfantasyGetListReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -59,7 +59,7 @@ func (*MoonfantasyGetListReq) Descriptor() ([]byte, []int) {
|
||||
return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
//获取装备列表请求 回应
|
||||
//获取秘境列表请求 回应
|
||||
type MoonfantasyGetListResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -123,7 +123,7 @@ func (x *MoonfantasyGetListResp) GetDfantasys() []*DBMoonFantasy {
|
||||
return nil
|
||||
}
|
||||
|
||||
///触发秘境
|
||||
///推送触发秘境
|
||||
type MoonfantasyTriggerPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
Loading…
Reference in New Issue
Block a user