Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
d80f4178fe
@ -1268,18 +1268,19 @@ func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag
|
|||||||
if record.Redflist[0].Team[i], errdata = this.createBattleRole(heros[i], user.Passonlv, tid, i); errdata != nil {
|
if record.Redflist[0].Team[i], errdata = this.createBattleRole(heros[i], user.Passonlv, tid, i); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
sz := make([]*pb.DySkillData, 0)
|
||||||
|
for _, key := range webuff {
|
||||||
|
sz = append(sz, &pb.DySkillData{
|
||||||
|
SkillID: key,
|
||||||
|
SkillLv: 1, //不纠结 积分boss debuff技能等级只能是1级
|
||||||
|
Param: 0,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
record.Redflist[0].Team[i].BattleBeforeSkill = append(record.Redflist[0].Team[i].BattleBeforeSkill, sz...)
|
||||||
} else {
|
} else {
|
||||||
record.Redflist[0].Team[i] = nil
|
record.Redflist[0].Team[i] = nil
|
||||||
}
|
}
|
||||||
sz := make([]*pb.DySkillData, 0)
|
|
||||||
for _, key := range webuff {
|
|
||||||
sz = append(sz, &pb.DySkillData{
|
|
||||||
SkillID: key,
|
|
||||||
SkillLv: 1, //不纠结 积分boss debuff技能等级只能是1级
|
|
||||||
Param: 0,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
record.Redflist[0].Team[i].BattleBeforeSkill = append(record.Redflist[0].Team[i].BattleBeforeSkill, sz...)
|
|
||||||
}
|
}
|
||||||
//好友的英雄阵营
|
//好友的英雄阵营
|
||||||
for i, v := range req.Format.Friendformat {
|
for i, v := range req.Format.Friendformat {
|
||||||
|
@ -153,6 +153,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
|
|||||||
Buff: req.Report.Info.Buffer,
|
Buff: req.Report.Info.Buffer,
|
||||||
}
|
}
|
||||||
update["carrybuff"] = list.Carrybuff
|
update["carrybuff"] = list.Carrybuff
|
||||||
|
var user *pb.DBUser
|
||||||
|
if user, err = this.module.GetUserForSession(session); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list.Uinfo = comm.GetUserBaseInfo(user)
|
||||||
|
update["uinfo"] = list.Uinfo
|
||||||
|
// 更新base
|
||||||
if err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil {
|
if err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
|
@ -18,9 +18,7 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis
|
|||||||
ranks []*pb.DBIntegralBoss
|
ranks []*pb.DBIntegralBoss
|
||||||
// franks []*pb.DBIntegralBoss
|
// franks []*pb.DBIntegralBoss
|
||||||
players []*pb.DBIntegralRank
|
players []*pb.DBIntegralRank
|
||||||
myself *pb.DBIntegralRank
|
|
||||||
err error
|
err error
|
||||||
bInRank bool // 自己是否入榜
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if errdata = this.RankListCheck(session, req); errdata != nil {
|
if errdata = this.RankListCheck(session, req); errdata != nil {
|
||||||
@ -35,15 +33,6 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, v := range uids {
|
|
||||||
if v == session.GetUserId() {
|
|
||||||
bInRank = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !bInRank {
|
|
||||||
uids = append(uids, session.GetUserId())
|
|
||||||
}
|
|
||||||
|
|
||||||
if ranks, err = this.module.modelIntegral.queryPlayers(uids); err != nil {
|
if ranks, err = this.module.modelIntegral.queryPlayers(uids); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -55,31 +44,13 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis
|
|||||||
}
|
}
|
||||||
players = make([]*pb.DBIntegralRank, len(ranks))
|
players = make([]*pb.DBIntegralRank, len(ranks))
|
||||||
for i, v := range ranks {
|
for i, v := range ranks {
|
||||||
if !bInRank { // 没入榜
|
players[i] = &pb.DBIntegralRank{
|
||||||
if v.Uid == session.GetUserId() {
|
Id: v.Uid,
|
||||||
myself = players[i]
|
Uinfo: v.Uinfo,
|
||||||
} else {
|
Nandu: v.Nandu,
|
||||||
players[i] = &pb.DBIntegralRank{
|
Score: v.Score[req.Nandu],
|
||||||
Id: v.Uid,
|
Line: v.Line[req.Nandu],
|
||||||
Uinfo: v.Uinfo,
|
Buff: v.Carrybuff[req.Nandu].Buff,
|
||||||
Nandu: v.Nandu,
|
|
||||||
Score: v.Score[req.Nandu],
|
|
||||||
Line: v.Line[req.Nandu],
|
|
||||||
Buff: v.Carrybuff[req.Nandu].Buff,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { // 入榜了
|
|
||||||
if v.Uid == session.GetUserId() {
|
|
||||||
myself = players[i]
|
|
||||||
}
|
|
||||||
players[i] = &pb.DBIntegralRank{
|
|
||||||
Id: v.Uid,
|
|
||||||
Uinfo: v.Uinfo,
|
|
||||||
Nandu: v.Nandu,
|
|
||||||
Score: v.Score[req.Nandu],
|
|
||||||
Line: v.Line[req.Nandu],
|
|
||||||
Buff: v.Carrybuff[req.Nandu].Buff,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// // 获取好友
|
// // 获取好友
|
||||||
@ -103,8 +74,7 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
session.SendMsg(string(this.module.GetType()), "ranklist", &pb.IntegralRankListResp{
|
session.SendMsg(string(this.module.GetType()), "ranklist", &pb.IntegralRankListResp{
|
||||||
Ranks: players,
|
Ranks: players,
|
||||||
Myself: myself,
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,11 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p
|
|||||||
Carrybuff: map[int32]*pb.FreightBuff{},
|
Carrybuff: map[int32]*pb.FreightBuff{},
|
||||||
}
|
}
|
||||||
if err = this.Get(uid, result); mgo.MongodbNil == err {
|
if err = this.Get(uid, result); mgo.MongodbNil == err {
|
||||||
|
var user *pb.DBUser
|
||||||
|
user, err = this.module.GetUserForSession(session)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
result.Id = primitive.NewObjectID().Hex()
|
result.Id = primitive.NewObjectID().Hex()
|
||||||
result.Uid = uid
|
result.Uid = uid
|
||||||
result.Buff = make(map[int32]int32)
|
result.Buff = make(map[int32]int32)
|
||||||
@ -63,6 +68,7 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p
|
|||||||
result.Line = make(map[int32]*pb.LineData, 0)
|
result.Line = make(map[int32]*pb.LineData, 0)
|
||||||
result.Achieve = make(map[int32]int32) // 初始化成就
|
result.Achieve = make(map[int32]int32) // 初始化成就
|
||||||
result.Carrybuff = make(map[int32]*pb.FreightBuff) // 初始化成就
|
result.Carrybuff = make(map[int32]*pb.FreightBuff) // 初始化成就
|
||||||
|
result.Uinfo = comm.GetUserBaseInfo(user)
|
||||||
// 获取当前的hid
|
// 获取当前的hid
|
||||||
curTime := configure.Now().Unix()
|
curTime := configure.Now().Unix()
|
||||||
szConf := this.module.configure.GetIntegralITime()
|
szConf := this.module.configure.GetIntegralITime()
|
||||||
|
@ -208,7 +208,7 @@ type FreightBuff struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Buff []int32 `protobuf:"varint,6,rep,packed,name=buff,proto3" json:"buff"`
|
Buff []int32 `protobuf:"varint,1,rep,packed,name=buff,proto3" json:"buff"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *FreightBuff) Reset() {
|
func (x *FreightBuff) Reset() {
|
||||||
@ -403,7 +403,7 @@ var file_integral_integral_db_proto_rawDesc = []byte{
|
|||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x46, 0x72, 0x65, 0x69, 0x67, 0x68,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x46, 0x72, 0x65, 0x69, 0x67, 0x68,
|
||||||
0x74, 0x42, 0x75, 0x66, 0x66, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
0x74, 0x42, 0x75, 0x66, 0x66, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
||||||
0x22, 0x21, 0x0a, 0x0b, 0x46, 0x72, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x75, 0x66, 0x66, 0x12,
|
0x22, 0x21, 0x0a, 0x0b, 0x46, 0x72, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x75, 0x66, 0x66, 0x12,
|
||||||
0x12, 0x0a, 0x04, 0x62, 0x75, 0x66, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62,
|
0x12, 0x0a, 0x04, 0x62, 0x75, 0x66, 0x66, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62,
|
||||||
0x75, 0x66, 0x66, 0x22, 0xa4, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72,
|
0x75, 0x66, 0x66, 0x22, 0xa4, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72,
|
||||||
0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18,
|
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18,
|
||||||
|
@ -499,9 +499,7 @@ type IntegralRankListResp struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Ranks []*DBIntegralRank `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"`
|
Ranks []*DBIntegralRank `protobuf:"bytes,1,rep,name=ranks,proto3" json:"ranks"` // repeated DBIntegralRank friends = 2;
|
||||||
// repeated DBIntegralRank friends = 2;
|
|
||||||
Myself *DBIntegralRank `protobuf:"bytes,2,opt,name=myself,proto3" json:"myself"` // 我自己的数据
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *IntegralRankListResp) Reset() {
|
func (x *IntegralRankListResp) Reset() {
|
||||||
@ -543,13 +541,6 @@ func (x *IntegralRankListResp) GetRanks() []*DBIntegralRank {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *IntegralRankListResp) GetMyself() *DBIntegralRank {
|
|
||||||
if x != nil {
|
|
||||||
return x.Myself
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 领取成就
|
// 领取成就
|
||||||
type IntegralGetAchieveReq struct {
|
type IntegralGetAchieveReq struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -710,21 +701,19 @@ var file_integral_integral_msg_proto_rawDesc = []byte{
|
|||||||
0x61, 0x72, 0x64, 0x22, 0x2b, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52,
|
0x61, 0x72, 0x64, 0x22, 0x2b, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52,
|
||||||
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61,
|
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61,
|
||||||
0x6e, 0x64, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75,
|
0x6e, 0x64, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75,
|
||||||
0x22, 0x66, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b,
|
0x22, 0x3d, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b,
|
||||||
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b,
|
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b,
|
||||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65,
|
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65,
|
||||||
0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x12,
|
0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x22,
|
||||||
0x27, 0x0a, 0x06, 0x6d, 0x79, 0x73, 0x65, 0x6c, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x27, 0x0a, 0x15, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x47, 0x65, 0x74, 0x41, 0x63,
|
||||||
0x0f, 0x2e, 0x44, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x61, 0x6e, 0x6b,
|
0x68, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||||
0x52, 0x06, 0x6d, 0x79, 0x73, 0x65, 0x6c, 0x66, 0x22, 0x27, 0x0a, 0x15, 0x49, 0x6e, 0x74, 0x65,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x16, 0x49, 0x6e, 0x74, 0x65,
|
||||||
0x67, 0x72, 0x61, 0x6c, 0x47, 0x65, 0x74, 0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65,
|
0x67, 0x72, 0x61, 0x6c, 0x47, 0x65, 0x74, 0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65,
|
||||||
0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69,
|
0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
|
||||||
0x64, 0x22, 0x49, 0x0a, 0x16, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x47, 0x65, 0x74,
|
0x69, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28,
|
||||||
0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x61,
|
0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65,
|
0x74, 0x6f, 0x33,
|
||||||
0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04,
|
|
||||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -772,13 +761,12 @@ var file_integral_integral_msg_proto_depIdxs = []int32{
|
|||||||
13, // 7: IntegralGetRewardResp.data:type_name -> DBIntegralBoss
|
13, // 7: IntegralGetRewardResp.data:type_name -> DBIntegralBoss
|
||||||
17, // 8: IntegralGetRewardResp.award:type_name -> UserAtno
|
17, // 8: IntegralGetRewardResp.award:type_name -> UserAtno
|
||||||
18, // 9: IntegralRankListResp.ranks:type_name -> DBIntegralRank
|
18, // 9: IntegralRankListResp.ranks:type_name -> DBIntegralRank
|
||||||
18, // 10: IntegralRankListResp.myself:type_name -> DBIntegralRank
|
17, // 10: IntegralGetAchieveResp.award:type_name -> UserAtno
|
||||||
17, // 11: IntegralGetAchieveResp.award:type_name -> UserAtno
|
11, // [11:11] is the sub-list for method output_type
|
||||||
12, // [12:12] is the sub-list for method output_type
|
11, // [11:11] is the sub-list for method input_type
|
||||||
12, // [12:12] is the sub-list for method input_type
|
11, // [11:11] is the sub-list for extension type_name
|
||||||
12, // [12:12] is the sub-list for extension type_name
|
11, // [11:11] is the sub-list for extension extendee
|
||||||
12, // [12:12] is the sub-list for extension extendee
|
0, // [0:11] is the sub-list for field type_name
|
||||||
0, // [0:12] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_integral_integral_msg_proto_init() }
|
func init() { file_integral_integral_msg_proto_init() }
|
||||||
|
Loading…
Reference in New Issue
Block a user