Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
parent
a71bfecd2b
commit
73b894f1b0
@ -13,13 +13,7 @@ func (this *apiComp) ResonanceUseEnergyCheck(session comm.IUserSession, req *pb.
|
|||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// for _, v := range req.Energy {
|
|
||||||
// if v.UseEnergy < 0 || (v.UseType != comm.ResonanceAtkPro && v.UseType != comm.ResonanceHpPro && v.UseType != comm.ResonanceDefPro) {
|
|
||||||
// code = pb.ErrorCode_ReqParameterError
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ func (this *apiComp) TalentList(session comm.IUserSession, req *pb.HeroTalentLis
|
|||||||
rsp := &pb.HeroTalentListResp{}
|
rsp := &pb.HeroTalentListResp{}
|
||||||
if rsp.Telnet, err = this.module.modelTalent.GetHerotalent(session.GetUserId()); err != nil {
|
if rsp.Telnet, err = this.module.modelTalent.GetHerotalent(session.GetUserId()); err != nil {
|
||||||
fmt.Printf("GetHerotalenterr: %v\n", err)
|
fmt.Printf("GetHerotalenterr: %v\n", err)
|
||||||
code = pb.ErrorCode_DBError
|
//code = pb.ErrorCode_DBError
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), HeroTalentListResp, rsp)
|
session.SendMsg(string(this.module.GetType()), HeroTalentListResp, rsp)
|
||||||
return
|
return
|
||||||
|
@ -216,6 +216,36 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string,
|
|||||||
if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 || amount == 0 {
|
if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 || amount == 0 {
|
||||||
return pb.ErrorCode_ReqParameterError
|
return pb.ErrorCode_ReqParameterError
|
||||||
}
|
}
|
||||||
|
// 等级校验
|
||||||
|
conf := this.configure.GetHeroConfig(heroConfId)
|
||||||
|
if conf == nil {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cid := heroConfId
|
||||||
|
maxStar := conf.Star
|
||||||
|
starConf := this.configure.GetHeroStarupConfig(cid, conf.Star)
|
||||||
|
if starConf == nil {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取最大星级
|
||||||
|
for i := 1; ; i++ {
|
||||||
|
starConf := this.configure.GetHeroStarupConfig(cid, conf.Star+int32(i))
|
||||||
|
if starConf == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if starConf != nil && starConf.Gold == 0 {
|
||||||
|
maxStar = star + int32(i)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maxLv := this.configure.GetHeroStargrowConfigByStar(maxStar) // 最大等级
|
||||||
|
if star > maxStar || lv > maxLv {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
return
|
||||||
|
}
|
||||||
hero, err := this.modelHero.createOneHero(session.GetUserId(), heroConfId)
|
hero, err := this.modelHero.createOneHero(session.GetUserId(), heroConfId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return pb.ErrorCode_HeroCreate
|
return pb.ErrorCode_HeroCreate
|
||||||
@ -502,7 +532,6 @@ func (this *Hero) ContinuousRestriction(uid string, heroCid string, drawCount in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -687,7 +716,5 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (code pb.ErrorCode) {
|
|||||||
if len(changeHero) > 0 {
|
if len(changeHero) > 0 {
|
||||||
session.SendMsg("hero", "change", &pb.HeroChangePush{List: changeHero})
|
session.SendMsg("hero", "change", &pb.HeroChangePush{List: changeHero})
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,19 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
|||||||
} else {
|
} else {
|
||||||
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
||||||
}
|
}
|
||||||
|
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||||
|
newData := &pb.DBPagodaRecord{
|
||||||
|
Id: primitive.NewObjectID().Hex(),
|
||||||
|
Uid: session.GetUserId(),
|
||||||
|
PagodaId: pagoda.PagodaId,
|
||||||
|
Type: pagoda.Type,
|
||||||
|
Nickname: userinfo.Name,
|
||||||
|
Icon: "", // icon 暂无
|
||||||
|
Lv: userinfo.Lv,
|
||||||
|
CostTime: req.Report.Costtime,
|
||||||
|
}
|
||||||
|
costTime = newData.CostTime
|
||||||
|
this.module.modulerank.AddPagodaRecord(session.GetUserId(), newData)
|
||||||
//this.module.modulerank.SetNormalPagodaRankList("pagodaRank", pagoda.PagodaId<<16-costTime, session.GetUserId())
|
//this.module.modulerank.SetNormalPagodaRankList("pagodaRank", pagoda.PagodaId<<16-costTime, session.GetUserId())
|
||||||
|
|
||||||
// 普通塔通关了
|
// 普通塔通关了
|
||||||
|
@ -39,6 +39,12 @@ func (this *ModelRank) GetRankData() (data []*pb.DBPagodaRecord, err error) {
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *ModelRank) AddPagodaRecord(uid string, record *pb.DBPagodaRecord) (err error) {
|
||||||
|
err = this.AddList(uid, record.Id, record)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRecord {
|
func (this *ModelRank) getPagodaRankList(uid string) []*pb.DBPagodaRecord {
|
||||||
pagodaRank := make([]*pb.DBPagodaRecord, 0)
|
pagodaRank := make([]*pb.DBPagodaRecord, 0)
|
||||||
err := this.GetList(uid, &pagodaRank)
|
err := this.GetList(uid, &pagodaRank)
|
||||||
|
@ -15,10 +15,8 @@ func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.PrivilegeGe
|
|||||||
|
|
||||||
///获取特权列表
|
///获取特权列表
|
||||||
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.PrivilegeGetListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.PrivilegeGetListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
list, err := this.module.modelPrivilege.getPrivilegeList(session.GetUserId())
|
list, _ := this.module.modelPrivilege.getPrivilegeList(session.GetUserId())
|
||||||
if err != nil {
|
|
||||||
this.module.Errorf("can't get privilege list :%v", err)
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.module.GetType()), PrivilegeGetListResp, &pb.PrivilegeGetListResp{Data: list})
|
session.SendMsg(string(this.module.GetType()), PrivilegeGetListResp, &pb.PrivilegeGetListResp{Data: list})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,8 @@ func (this *apiComp) VipListCheck(session comm.IUserSession, req *pb.PrivilegeVi
|
|||||||
|
|
||||||
///获取特权列表
|
///获取特权列表
|
||||||
func (this *apiComp) VipList(session comm.IUserSession, req *pb.PrivilegeVipListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) VipList(session comm.IUserSession, req *pb.PrivilegeVipListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
list, err := this.module.modelVip.getVipList(session.GetUserId())
|
list, _ := this.module.modelVip.getVipList(session.GetUserId())
|
||||||
if err != nil {
|
|
||||||
this.module.Errorf("can't get privilege list :%v", err)
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.module.GetType()), PrivilegeVipListResp, &pb.PrivilegeVipListResp{Data: list})
|
session.SendMsg(string(this.module.GetType()), PrivilegeVipListResp, &pb.PrivilegeVipListResp{Data: list})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3
|
|||||||
Reward: map[int32]bool{},
|
Reward: map[int32]bool{},
|
||||||
Privilege: map[int32]*pb.PrivilegeList{},
|
Privilege: map[int32]*pb.PrivilegeList{},
|
||||||
CTime: configure.Now().Unix(),
|
CTime: configure.Now().Unix(),
|
||||||
RewardTime: 0,
|
RewardTime: configure.Now().Unix(),
|
||||||
}
|
}
|
||||||
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
|
if err = this.modelVip.addVipData(session.GetUserId(), vip); err != nil {
|
||||||
this.Errorf("err:%v", err)
|
this.Errorf("err:%v", err)
|
||||||
@ -360,12 +360,23 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 发放每日福利
|
||||||
|
var res []*pb.UserAssets
|
||||||
|
for _, v := range conf.Daygift {
|
||||||
|
res = append(res, &pb.UserAssets{
|
||||||
|
A: v.A,
|
||||||
|
T: v.T,
|
||||||
|
N: v.N,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.mail.SendMailByCid(session, comm.VipDaily, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update["privilege"] = vip.Privilege
|
update["privilege"] = vip.Privilege
|
||||||
this.modelVip.modifyVipData(session.GetUserId(), update)
|
this.modelVip.modifyVipData(session.GetUserId(), update)
|
||||||
|
|
||||||
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip})
|
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送特权每日奖励
|
// 发送特权每日奖励
|
||||||
|
Loading…
Reference in New Issue
Block a user