Compare commits
2 Commits
5cc19eae0d
...
958a121872
Author | SHA1 | Date | |
---|---|---|---|
958a121872 | |||
f633922659 |
@ -258,6 +258,7 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
|
||||
)
|
||||
|
||||
curExp = ul.exp
|
||||
|
||||
for nextLvConf != nil && curExp >= int64(nextLvConf.Exp) {
|
||||
curExp = curExp - int64(nextLvConf.Exp)
|
||||
curLv++
|
||||
@ -339,7 +340,22 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
|
||||
return
|
||||
}
|
||||
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推送失败",
|
||||
log.Field{Key: "uid", Value: ul.session.GetUserId()},
|
||||
log.Field{Key: "exp", Value: curExp},
|
||||
@ -354,10 +370,23 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
|
||||
// 玩家信息监听
|
||||
type UserListen struct {
|
||||
event_v2.Event
|
||||
session comm.IUserSession
|
||||
exp int64
|
||||
lv int32
|
||||
name string
|
||||
vipexp int64
|
||||
viplv int32
|
||||
session comm.IUserSession
|
||||
exp int64
|
||||
lv int32
|
||||
name string
|
||||
vipexp int64
|
||||
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
|
||||
}
|
||||
|
@ -725,6 +725,15 @@ func (this *User) EventUserChanged(session comm.IUserSession) {
|
||||
ul.exp = user.Exp
|
||||
ul.lv = user.Lv
|
||||
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user