上传武馆状态同步

This commit is contained in:
liwei1dao 2023-04-11 13:54:50 +08:00
parent feb0564e27
commit d285bad3a9
2 changed files with 22 additions and 0 deletions

View File

@ -88,6 +88,17 @@ func (this *apiComp) Loot(session comm.IUserSession, req *pb.PracticeLootReq) (c
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
"knapsack": room.Knapsack,
})
if _session, ok := this.module.GetUserSession(req.Friend); ok {
_session.SendMsg(string(this.module.GetType()), "rommchange", &pb.PracticeRommChangePush{Info: froom})
if err = _session.Push(); err != nil {
this.module.Errorln(err)
}
this.module.PutUserSession(_session)
} else {
this.module.PutUserSession(_session)
}
session.SendMsg(string(this.module.GetType()), "loot", &pb.PracticeLootResp{Friend: req.Friend, Pillar: froom.Pillarf})
return
}

View File

@ -236,6 +236,17 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
this.module.modelPandata.Change(req.Friend, map[string]interface{}{
filed: pillar,
})
if _session, ok := this.module.GetUserSession(req.Friend); ok {
_session.SendMsg(string(this.module.GetType()), "rommchange", &pb.PracticeRommChangePush{Info: froom})
if err = _session.Push(); err != nil {
this.module.Errorln(err)
}
this.module.PutUserSession(_session)
} else {
this.module.PutUserSession(_session)
}
}
go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype135, minutes))
session.SendMsg(string(this.module.GetType()), "receive", &pb.PracticeReceiveResp{Pillar: pillar, Knapsack: room.Knapsack})