上传英雄禁用

This commit is contained in:
liwei1dao 2024-03-08 21:11:49 +08:00
parent 87c0724b13
commit ea4cc88714

View File

@ -101,6 +101,7 @@ func (this *Room) disableheros(uid string, index int32) (err error) {
for _, v := range this.members { for _, v := range this.members {
if v.User.Uid != uid { if v.User.Uid != uid {
v.Disable = index v.Disable = index
v.Heros[index] = ""
} }
if v.Disable == -1 { if v.Disable == -1 {
finish = false finish = false
@ -140,16 +141,18 @@ func (this *Room) selectleader(uid string, index int32) (err error) {
Index: index, Index: index,
}) })
if finish { if finish {
// var ( var (
// uinfos []*pb.BaseUserInfo = make([]*pb.BaseUserInfo, 0) uinfos []*pb.BaseUserInfo = make([]*pb.BaseUserInfo, 0)
// formations []*pb.BattleFormation = make([]*pb.BattleFormation, 0) formations []*pb.BattleFormation = make([]*pb.BattleFormation, 0)
// ) sessions []comm.IUserSession = make([]comm.IUserSession, 0)
// uinfos = append(uinfos, this.members[0].User, this.members[1].User) )
// formations = append(formations, uinfos = append(uinfos, this.members[0].User, this.members[1].User)
// &pb.BattleFormation{Leadpos: this.members[0].Leader, Format: this.members[0].Heros}, sessions = append(sessions, this.sessions[0].Clone(), this.sessions[1].Clone())
// &pb.BattleFormation{Leadpos: this.members[1].Leader, Format: this.members[1].Heros}, formations = append(formations,
// ) &pb.BattleFormation{Leadpos: this.members[0].Leader, Format: this.members[0].Heros},
// err = this.module.pvp.AddAndStartRoom(this.Id, pb.PlayType_realarena, this.sessions, uinfos, formations) &pb.BattleFormation{Leadpos: this.members[1].Leader, Format: this.members[1].Heros},
)
err = this.module.pvp.AddAndStartRoom(this.Id, pb.PlayType_realarena, sessions, uinfos, formations)
} }
return return
} }