1
This commit is contained in:
parent
42063e9cd9
commit
e390bcfb03
@ -25,11 +25,19 @@ func (this *buff) List(accountId string) (error, []*model.Buff) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *buff) Add(accountId string, buffList []int32) {
|
func (this *buff) Add(accountId string, buffList []int32) {
|
||||||
|
nowTime := int32(f5.GetApp().GetRealSeconds())
|
||||||
for buffId := range(buffList) {
|
for buffId := range(buffList) {
|
||||||
buffMeta := mt.Table.Buff.GetById(int64(buffId))
|
buffMeta := mt.Table.Buff.GetById(int64(buffId))
|
||||||
if buffMeta != nil {
|
if buffMeta != nil {
|
||||||
|
buffModel := new(model.Buff)
|
||||||
if buffMeta.GetCanStack() == 0 {
|
if buffMeta.GetCanStack() == 0 {
|
||||||
|
buffModel.AccountId = accountId
|
||||||
|
buffModel.BuffId = buffMeta.GetBuffId()
|
||||||
|
buffModel.StartTime = nowTime
|
||||||
|
buffModel.EffectiveTime = buffMeta.GetDurationTime()
|
||||||
|
buffModel.CreateTime = nowTime
|
||||||
|
buffModel.ModifyTime = nowTime
|
||||||
|
buffModel.Create()
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user