上传好友驱逐代码
This commit is contained in:
parent
b47afba64e
commit
f54b48bb14
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user