This commit is contained in:
meixiongfeng 2023-11-24 21:55:03 +08:00
commit 7ecafe5c19

View File

@ -50,6 +50,11 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.WhackamoleAwardReq
if errdata, award = this.module.DispenseAtno(session, atns, true); errdata != nil { if errdata, award = this.module.DispenseAtno(session, atns, true); errdata != nil {
return return
} }
info.Levels[req.Id]++
this.module.model.Change(session.GetUserId(), map[string]interface{}{
"levels": info.Levels,
})
session.SendMsg(string(this.module.GetType()), "award", &pb.WhackamoleAwardResp{Id: req.Id, Award: award}) session.SendMsg(string(this.module.GetType()), "award", &pb.WhackamoleAwardResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "WhackamoleAwardReq", award) this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "WhackamoleAwardReq", award)