上传好友驱逐代码

This commit is contained in:
liwei1dao 2023-03-31 20:13:29 +08:00
parent b47afba64e
commit f54b48bb14

View File

@ -22,7 +22,7 @@ func (this *apiComp) ExpulsionCheck(session comm.IUserSession, req *pb.PracticeE
func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpulsionReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpulsionReq) (code pb.ErrorCode, data proto.Message) {
var ( var (
err error err error
ok bool // ok bool
room *pb.DBPracticeRoom room *pb.DBPracticeRoom
froom *pb.DBPracticeRoom froom *pb.DBPracticeRoom
pillar *pb.DBPracticePillar pillar *pb.DBPracticePillar
@ -180,17 +180,17 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
defer func() { defer func() {
this.module.PutUserSession(_session) this.module.PutUserSession(_session)
}() }()
if _session, ok = this.module.GetUserSession(pillar.Uid); ok { // if _session, ok = this.module.GetUserSession(pillar.Uid); ok {
if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { // if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success {
return // return
} // }
if code = this.module.DispenseRes(_session, append(ants1, ants2...), true); code != pb.ErrorCode_Success { // if code = this.module.DispenseRes(_session, append(ants1, ants2...), true); code != pb.ErrorCode_Success {
return // return
} // }
if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success { // if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success {
return // return
} // }
} else { // } else {
if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success {
return return
} }
@ -217,7 +217,7 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
CreateTime: uint64(configure.Now().Unix()), CreateTime: uint64(configure.Now().Unix()),
Items: res, Items: res,
}, pillar.Uid) }, pillar.Uid)
} // }
froom.Knapsack[pillar.Teacher] = 0 froom.Knapsack[pillar.Teacher] = 0
froom.Knapsack[pillar.Prop] = 0 froom.Knapsack[pillar.Prop] = 0