This commit is contained in:
wh_zcy 2023-06-20 10:35:40 +08:00
parent 3b68a13f31
commit f633922659
2 changed files with 45 additions and 7 deletions

View File

@ -258,6 +258,7 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
) )
curExp = ul.exp curExp = ul.exp
for nextLvConf != nil && curExp >= int64(nextLvConf.Exp) { for nextLvConf != nil && curExp >= int64(nextLvConf.Exp) {
curExp = curExp - int64(nextLvConf.Exp) curExp = curExp - int64(nextLvConf.Exp)
curLv++ curLv++
@ -339,7 +340,22 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
return return
} }
if err := ul.session.SendMsg(string(this.module.GetType()), "reschanged", if err := ul.session.SendMsg(string(this.module.GetType()), "reschanged",
&pb.UserResChangedPush{Exp: curExp}); err != nil { &pb.UserResChangedPush{
Gold: ul.Gold,
Ps: ul.Ps,
Vipexp: ul.vipexp,
Diamond: ul.Diamond,
Friend: ul.Friend,
Starcoin: ul.Starcoin,
Arenacoin: ul.Arenacoin,
Moongold: ul.Moongold,
Talent1: ul.Talent1,
Talent2: ul.Talent2,
Talent3: ul.Talent3,
Talent4: ul.Talent4,
Exp: curExp,
Merchantmoney: ul.Merchantmoney,
}); err != nil {
this.module.Error("玩家经验变化 UserResChangedPush推送失败", this.module.Error("玩家经验变化 UserResChangedPush推送失败",
log.Field{Key: "uid", Value: ul.session.GetUserId()}, log.Field{Key: "uid", Value: ul.session.GetUserId()},
log.Field{Key: "exp", Value: curExp}, log.Field{Key: "exp", Value: curExp},
@ -360,4 +376,17 @@ type UserListen struct {
name string name string
vipexp int64 vipexp int64
viplv int32 viplv int32
Gold int64
Diamond int64
Friend int32
Starcoin int64
Guildcoin int64
Arenacoin int32
Ps int32
Moongold int32
Talent1 int32
Talent2 int32
Talent3 int32
Talent4 int32
Merchantmoney int32
} }

View File

@ -725,6 +725,15 @@ func (this *User) EventUserChanged(session comm.IUserSession) {
ul.exp = user.Exp ul.exp = user.Exp
ul.lv = user.Lv ul.lv = user.Lv
ul.name = user.Name ul.name = user.Name
ul.Gold = user.Gold
ul.vipexp = user.Vipexp
ul.Ps = user.Ps
ul.Diamond = user.Diamond
ul.Merchantmoney = user.Merchantmoney
ul.Talent1 = user.Talent1
ul.Talent2 = user.Talent2
ul.Talent3 = user.Talent3
ul.Talent4 = user.Talent4
} }
this.modelUser.EventApp.Dispatch(comm.EventUserChanged, ul) this.modelUser.EventApp.Dispatch(comm.EventUserChanged, ul)
} }