上传登录代码

This commit is contained in:
liwei1dao 2023-03-08 14:51:46 +08:00
parent b11fb0b493
commit e8896712ac
6 changed files with 10 additions and 6 deletions

View File

@ -157,7 +157,7 @@ func (this *Arena) GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.
if ais, err = this.modelArena.matcheAI(info.Dan, 1); err != nil && err != mgo.MongodbNil {
return
}
if len(players) > 0 {
if len(ais) > 0 {
captain = ais[0].Defend.Leadpos
if rules, code = this.battle.CreateRolesByHeros(ais[0].Defend.Formt); code != pb.ErrorCode_Success {
err = fmt.Errorf("AI CreateRolesByHeros fail:%d", code)

View File

@ -268,10 +268,12 @@ func (this *Battle) CreateRolesByFormat(fid int32) (captain int32, roles []*pb.B
func (this *Battle) CreateRolesByHeros(heros []*pb.DBHero) (roles []*pb.BattleRole, code pb.ErrorCode) {
roles = make([]*pb.BattleRole, len(heros))
for i, v := range heros {
if v != nil {
if roles[i], code = this.modelBattle.createBattleRole(v, 100+i, i); code != pb.ErrorCode_Success {
return
}
}
}
return
}

View File

@ -541,7 +541,7 @@ func (this *ModelItemsComp) recoverTicket(session comm.IUserSession) (code pb.Er
}
global := this.module.configure.GetGlobalConf()
playerlv := this.module.configure.GetPlayerlvConf(user.Lv)
ticket = int32(this.module.ModuleItems.QueryItemAmount(info.Uid, comm.UnifiedTicket))
ticket = int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), comm.UnifiedTicket))
if ticket < global.DreamlandFightnum && info.Recovertimeunifiedticket > 0 {
duration = configure.Now().Sub(time.Unix(info.Recovertimeunifiedticket, 0))
ticketNum = int32(math.Floor(duration.Seconds() / float64(global.CopsRecoveryTime)))

View File

@ -35,6 +35,7 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
result = &pb.DBPracticeRoom{}
if err = this.Get(uid, result); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
if err == mgo.MongodbNil {
result = &pb.DBPracticeRoom{
@ -51,6 +52,7 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
Statuers: make([]*pb.DBPracticeStatuer, 0),
}
if err = this.refreshnpc(result); err != nil {
this.module.Errorln(err)
return
}
if err = this.Add(uid, result); err != nil {

View File

@ -279,7 +279,7 @@ type BattleRole struct {
MainSuitSkill int32 `protobuf:"varint,8,opt,name=mainSuitSkill,proto3" json:"mainSuitSkill" bson:"mainSuitSkill"` /// 主套装技能
SubSuitSkill int32 `protobuf:"varint,9,opt,name=subSuitSkill,proto3" json:"subSuitSkill" bson:"subSuitSkill"` /// 副套装技能
NormalSkill []*SkillData `protobuf:"bytes,10,rep,name=normalSkill,proto3" json:"normalSkill" bson:"normalSkill"` //普通技能
EquipSkill []*SkillData `protobuf:"bytes,11,rep,name=equipSkill,proto3" json:"equipSkill" bson:"normalSkill"` //普通技能
EquipSkill []*SkillData `protobuf:"bytes,11,rep,name=equipSkill,proto3" json:"equipSkill" bson:"equipSkill"` //普通技能
PandaBuff int32 `protobuf:"varint,12,opt,name=PandaBuff,proto3" json:"PandaBuff"` //熊猫buff技能id
Property map[string]int32 `protobuf:"bytes,13,rep,name=property,proto3" json:"property" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 属性相关
Ishelp bool `protobuf:"varint,14,opt,name=ishelp,proto3" json:"ishelp"` //是否是助战英雄

View File

@ -287,7 +287,7 @@ type DBPracticeRoom struct {
Pillarf *DBPracticePillar `protobuf:"bytes,11,opt,name=pillarf,proto3" json:"pillarf"` //好友柱子
Statuers []*DBPracticeStatuer `protobuf:"bytes,12,rep,name=statuers,proto3" json:"statuers"` //武馆雕像
Currnpc int32 `protobuf:"varint,13,opt,name=currnpc,proto3" json:"currnpc"` //当前npc
Npcstate int32 `protobuf:"varint,14,opt,name=npcstate,proto3" json:"npcstate"` //npc状态 0 未挑战 1 挑战失败 2挑战成功
Npcstate int32 `protobuf:"varint,14,opt,name=npcstate,proto3" json:"npcstate"` //npc状态 0 未挑战 1 挑战失败 2挑战成功 3 CD中
Refresh int64 `protobuf:"varint,15,opt,name=refresh,proto3" json:"refresh"` //刷新时间
Battlenum int32 `protobuf:"varint,16,opt,name=battlenum,proto3" json:"battlenum"` //战斗次数
Captain int32 `protobuf:"varint,17,opt,name=captain,proto3" json:"captain"` //战斗征信队长位