上传好友驱逐代码
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) {
|
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,44 +180,44 @@ 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
|
||||||
}
|
|
||||||
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 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.Teacher] = 0
|
||||||
froom.Knapsack[pillar.Prop] = 0
|
froom.Knapsack[pillar.Prop] = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user