Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
d78785fdfd
@ -56,14 +56,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
|
||||
}
|
||||
// 校验通过
|
||||
|
||||
if req.Report != nil { // 战斗失败
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
isWin = false
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
if !isWin { // 战斗失败直接返回
|
||||
// 返还
|
||||
mainline.Ps = 0
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
"go_dreamfactory/utils"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
@ -410,17 +411,34 @@ func (this *Privilege) SendDailyPrivilegeMail(session comm.IUserSession, cId []i
|
||||
}
|
||||
}
|
||||
func (this *Privilege) GetCountByPrivilegeId(uid string, pId int32) (count int32) {
|
||||
vip, err := this.modelVip.getVipList(uid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if v, ok := vip.Privilege[pId]; ok {
|
||||
data := this.configure.GetPrivilegeByType(pId)
|
||||
for _, v1 := range v.PrivilegeID {
|
||||
if c, ok1 := data[v1]; ok1 {
|
||||
count += c
|
||||
if this.IsCross() { // 跨服情况
|
||||
if model, err := this.GetDBModuleByUid(uid, comm.TableVip, time.Hour); err == nil {
|
||||
vip := &pb.DBVip{}
|
||||
if err = model.Get(uid, vip); err == nil {
|
||||
if v, ok := vip.Privilege[pId]; ok {
|
||||
data := this.configure.GetPrivilegeByType(pId)
|
||||
for _, v1 := range v.PrivilegeID {
|
||||
if c, ok1 := data[v1]; ok1 {
|
||||
count += c
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
vip, err := this.modelVip.getVipList(uid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if v, ok := vip.Privilege[pId]; ok {
|
||||
data := this.configure.GetPrivilegeByType(pId)
|
||||
for _, v1 := range v.PrivilegeID {
|
||||
if c, ok1 := data[v1]; ok1 {
|
||||
count += c
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
||||
for _, v1 := range atno {
|
||||
if v1.A == "equp" {
|
||||
cfg := this.configure.GetEquipmentConfigureById(v1.T)
|
||||
if cfg.Star == v {
|
||||
if cfg != nil && cfg.Star == v {
|
||||
del = append(del, v1.O)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user