diff --git a/modules/practice/api_expulsion.go b/modules/practice/api_expulsion.go index 9d383dad5..22c67610b 100644 --- a/modules/practice/api_expulsion.go +++ b/modules/practice/api_expulsion.go @@ -21,8 +21,8 @@ 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) { var ( - err error - ok bool + err error + // ok bool room *pb.DBPracticeRoom froom *pb.DBPracticeRoom pillar *pb.DBPracticePillar @@ -180,44 +180,44 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls defer func() { this.module.PutUserSession(_session) }() - if _session, ok = this.module.GetUserSession(pillar.Uid); ok { - if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { - return - } - if code = this.module.DispenseRes(_session, append(ants1, ants2...), true); code != pb.ErrorCode_Success { - return - } - if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success { - return - } - } else { - if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { - return - } - if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success { - return - } - res := make([]*pb.UserAssets, 0) - for _, v := range ants1 { - res = append(res, &pb.UserAssets{ - A: v.A, - T: v.T, - N: v.N, - }) - } - for _, v := range ants2 { - res = append(res, &pb.UserAssets{ - A: v.A, - T: v.T, - N: v.N, - }) - } - this.module.mail.SendNewMail(&pb.DBMailData{ - Cid: "Drivethemail", - CreateTime: uint64(configure.Now().Unix()), - Items: res, - }, pillar.Uid) + // if _session, ok = this.module.GetUserSession(pillar.Uid); ok { + // if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { + // return + // } + // if code = this.module.DispenseRes(_session, append(ants1, ants2...), true); code != pb.ErrorCode_Success { + // return + // } + // if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success { + // return + // } + // } else { + if _, code = this.module.ModuleHero.AddHeroExp(_session, pillar.Hero, exp); code != pb.ErrorCode_Success { + return } + if code = this.module.ModuleHero.KungFuHero(_session, pillar.Hero, false, ""); code != pb.ErrorCode_Success { + return + } + res := make([]*pb.UserAssets, 0) + for _, v := range ants1 { + res = append(res, &pb.UserAssets{ + A: v.A, + T: v.T, + N: v.N, + }) + } + for _, v := range ants2 { + res = append(res, &pb.UserAssets{ + A: v.A, + T: v.T, + N: v.N, + }) + } + this.module.mail.SendNewMail(&pb.DBMailData{ + Cid: "Drivethemail", + CreateTime: uint64(configure.Now().Unix()), + Items: res, + }, pillar.Uid) + // } froom.Knapsack[pillar.Teacher] = 0 froom.Knapsack[pillar.Prop] = 0