羁绊等级更新
This commit is contained in:
parent
f6d0dbb7dd
commit
8dca163a32
@ -20,7 +20,6 @@ func (this *apiComp) ActivationFetter(session comm.IUserSession, req *pb.Library
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
rsp := &pb.LibraryActivationFetterResp{}
|
||||
defer session.SendMsg(string(this.module.GetType()), LibraryActivationFetterResp, rsp)
|
||||
fetter := this.module.modelLibrary.getOneLibrary(session.GetUserId(), req.Oid)
|
||||
if fetter == nil {
|
||||
code = pb.ErrorCode_LibraryNoData
|
||||
@ -31,9 +30,13 @@ func (this *apiComp) ActivationFetter(session comm.IUserSession, req *pb.Library
|
||||
return
|
||||
}
|
||||
fetter.Activation = true
|
||||
fetter.Fetterlv = 1
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["activation"] = fetter.Activation
|
||||
mapData["fetterlv"] = 1
|
||||
|
||||
this.module.modelLibrary.modifyLibraryDataByObjId(session.GetUserId(), fetter.Id, mapData)
|
||||
rsp.Data = fetter
|
||||
session.SendMsg(string(this.module.GetType()), LibraryActivationFetterResp, rsp)
|
||||
return
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ func (this *Library) GetLibraryListByHid(uid string, hid string) *pb.DBLibrary {
|
||||
func (this *Library) CheckFetter(uid string, hid string) (dbLibrary []*pb.DBLibrary, fetter []*pb.DBHeroFetter) {
|
||||
|
||||
szFid := this.configure.GetHeroFetterID(hid)
|
||||
for _, fid := range szFid {
|
||||
for fid := range szFid {
|
||||
|
||||
if list := this.GetLibraryListByFid(uid, fid); list == nil { // 没有这条羁绊数据
|
||||
tmp := &pb.DBLibrary{ // 创建一条羁绊数据
|
||||
@ -132,27 +132,6 @@ func (this *Library) CheckFetter(uid string, hid string) (dbLibrary []*pb.DBLibr
|
||||
return
|
||||
}
|
||||
|
||||
//通过羁绊id 创建多个羁绊信息
|
||||
func (this *Library) CreateLibrary(uid string, fid int32, heroConfId string) (code pb.ErrorCode, obj *pb.DBLibrary) {
|
||||
obj = &pb.DBLibrary{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
Fid: fid,
|
||||
Herofetter: map[string]string{},
|
||||
Prize: map[int32]int32{},
|
||||
}
|
||||
|
||||
conf := this.configure.GetFriendData(fid, 1)
|
||||
if conf != nil {
|
||||
|
||||
if err := this.modelLibrary.createLibrary(uid, obj); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
}
|
||||
obj.Herofetter[heroConfId] = obj.Id
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
func (this *Library) ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (code pb.ErrorCode) {
|
||||
err := this.modelFetter.modifyHeroFetterDataByObjId(uid, obj, data)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user