Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
7e63436373
@ -26331,7 +26331,7 @@
|
|||||||
"key": "buried_buried_condi_tasktxt_938",
|
"key": "buried_buried_condi_tasktxt_938",
|
||||||
"text": "当日消耗100点体力"
|
"text": "当日消耗100点体力"
|
||||||
},
|
},
|
||||||
"type": 303,
|
"type": 213,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
"head": {
|
"head": {
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -26397,7 +26397,7 @@
|
|||||||
"key": "buried_buried_condi_tasktxt_941",
|
"key": "buried_buried_condi_tasktxt_941",
|
||||||
"text": "当日消耗30点体力"
|
"text": "当日消耗30点体力"
|
||||||
},
|
},
|
||||||
"type": 303,
|
"type": 213,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
"head": {
|
"head": {
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -26551,7 +26551,7 @@
|
|||||||
"key": "buried_buried_condi_tasktxt_941",
|
"key": "buried_buried_condi_tasktxt_941",
|
||||||
"text": "当日消耗100点体力"
|
"text": "当日消耗100点体力"
|
||||||
},
|
},
|
||||||
"type": 303,
|
"type": 213,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
"head": {
|
"head": {
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -26705,7 +26705,7 @@
|
|||||||
"key": "buried_buried_condi_tasktxt_941",
|
"key": "buried_buried_condi_tasktxt_941",
|
||||||
"text": "当日消耗300点体力"
|
"text": "当日消耗300点体力"
|
||||||
},
|
},
|
||||||
"type": 303,
|
"type": 213,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
"head": {
|
"head": {
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
|
@ -1196,29 +1196,34 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 300,
|
"id": 210,
|
||||||
"insert": 1,
|
"insert": 1,
|
||||||
"filter": [
|
"filter": [
|
||||||
"eq"
|
"eq"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 301,
|
"id": 211,
|
||||||
"insert": 1,
|
"insert": 1,
|
||||||
"filter": [
|
"filter": [
|
||||||
"eq"
|
"eq"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 302,
|
"id": 212,
|
||||||
"insert": 1,
|
"insert": 1,
|
||||||
"filter": [
|
"filter": [
|
||||||
"eq"
|
"eq"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 303,
|
"id": 213,
|
||||||
"insert": 1,
|
"insert": 2,
|
||||||
|
"filter": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 214,
|
||||||
|
"insert": 2,
|
||||||
"filter": []
|
"filter": []
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -10,10 +10,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000004
|
||||||
],
|
],
|
||||||
"condition": 60000004,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -38,10 +38,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000005
|
||||||
],
|
],
|
||||||
"condition": 60000005,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -66,10 +66,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000006
|
||||||
],
|
],
|
||||||
"condition": 60000006,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -94,10 +94,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000007
|
||||||
],
|
],
|
||||||
"condition": 60000007,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -122,10 +122,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000008
|
||||||
],
|
],
|
||||||
"condition": 60000008,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -150,10 +150,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
60000009
|
||||||
],
|
],
|
||||||
"condition": 60000009,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -178,10 +178,10 @@
|
|||||||
"text": "月末狂欢,冰点特价"
|
"text": "月末狂欢,冰点特价"
|
||||||
},
|
},
|
||||||
"resource": "",
|
"resource": "",
|
||||||
"integral": [
|
"condition": [
|
||||||
3000
|
70000001
|
||||||
],
|
],
|
||||||
"condition": 70000001,
|
"condition_or": [],
|
||||||
"lbid": [
|
"lbid": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
|
@ -741,11 +741,9 @@ const (
|
|||||||
Rtype101 TaskType = 101 //获得X星职业武器N件(历史)(从创号开始记录,每获得1件X星职业武器则进度+1)
|
Rtype101 TaskType = 101 //获得X星职业武器N件(历史)(从创号开始记录,每获得1件X星职业武器则进度+1)
|
||||||
Rtype102 TaskType = 102 //阵营饰品强化成功N次(历史)(从创号开始记录,强化成功进度+1)
|
Rtype102 TaskType = 102 //阵营饰品强化成功N次(历史)(从创号开始记录,强化成功进度+1)
|
||||||
Rtype103 TaskType = 103 //获得X星阵营饰品N件(历史)(从创号开始记录,每获得1件X星阵营饰品则进度+1)
|
Rtype103 TaskType = 103 //获得X星阵营饰品N件(历史)(从创号开始记录,每获得1件X星阵营饰品则进度+1)
|
||||||
//消费N个钻石(历史)(从创号开始记录,每次消耗钻石增加消耗额的进度)
|
Rtype104 TaskType = 104 //消费N个钻石(历史)(从创号开始记录,每次消耗钻石增加消耗额的进度)
|
||||||
Rtype104 TaskType = 104
|
|
||||||
Rtype105 TaskType = 105 //商店刷新N次(从接到任务开始,每次刷新商店进度+1)
|
Rtype105 TaskType = 105 //商店刷新N次(从接到任务开始,每次刷新商店进度+1)
|
||||||
Rtype106 TaskType = 106 //跨服聊天发言N次(从接到任务开始,每次跨服发言成功进度+1)
|
Rtype106 TaskType = 106 //跨服聊天发言N次(从接到任务开始,每次跨服发言成功进度+1)
|
||||||
|
|
||||||
Rtype108 TaskType = 108 //助战英雄被使用X次(从接到任务开始,每被使用1次则进度+1)
|
Rtype108 TaskType = 108 //助战英雄被使用X次(从接到任务开始,每被使用1次则进度+1)
|
||||||
Rtype109 TaskType = 109 //加入公会(打开任务时,检查是否加入了公会,加入则完成)
|
Rtype109 TaskType = 109 //加入公会(打开任务时,检查是否加入了公会,加入则完成)
|
||||||
Rtype110 TaskType = 110 //激活X个英雄图鉴(打开任务时,检查英雄图鉴激活数量并计入进度,达到了任务所需个数则完成任务。)
|
Rtype110 TaskType = 110 //激活X个英雄图鉴(打开任务时,检查英雄图鉴激活数量并计入进度,达到了任务所需个数则完成任务。)
|
||||||
@ -842,6 +840,7 @@ const (
|
|||||||
Rtype211 TaskType = 211 // 向指定X城市,贩卖价值X虚拟币以上的对应城市急需货物
|
Rtype211 TaskType = 211 // 向指定X城市,贩卖价值X虚拟币以上的对应城市急需货物
|
||||||
Rtype212 TaskType = 212 // 接取任务后,商队抵达指定城市
|
Rtype212 TaskType = 212 // 接取任务后,商队抵达指定城市
|
||||||
Rtype213 TaskType = 213 // 消耗X体力
|
Rtype213 TaskType = 213 // 消耗X体力
|
||||||
|
Rtype214 TaskType = 214 // 获得x充值积分
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
MailLineEasy int32 = 1 // 简单
|
MailLineEasy int32 = 1 // 简单
|
||||||
|
@ -596,7 +596,7 @@ func (this *Buried) trigger(session comm.IUserSession, burieds ...*pb.BuriedPara
|
|||||||
} else {
|
} else {
|
||||||
this.wtask.BuriedsNotify(session, changes)
|
this.wtask.BuriedsNotify(session, changes)
|
||||||
this.smithy.BuriedsNotify(session, changes)
|
this.smithy.BuriedsNotify(session, changes)
|
||||||
this.sociaty.BuriedsNotify(session, changes)
|
// this.sociaty.BuriedsNotify(session, changes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,17 +394,6 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
|
|||||||
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 统计今天消耗的体力
|
|
||||||
if k == "ps" && v < 0 {
|
|
||||||
if userexpand, err := this.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
|
||||||
userexpand.ConsumPs += (-v)
|
|
||||||
this.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
|
|
||||||
"consumPs": userexpand.ConsumPs,
|
|
||||||
})
|
|
||||||
|
|
||||||
go this.ModuleUiGame.HDPSTodayConsum(session.GetUserId(), userexpand.ConsumPs) //
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for k, v := range items {
|
for k, v := range items {
|
||||||
amount := this.ModuleItems.QueryItemAmount(session.GetUserId(), k)
|
amount := this.ModuleItems.QueryItemAmount(session.GetUserId(), k)
|
||||||
@ -426,10 +415,6 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.Debug("消耗玩家资源", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "attrs", Value: attrs})
|
this.Debug("消耗玩家资源", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "attrs", Value: attrs})
|
||||||
if count, ok := attrs[comm.ResDiamond]; ok {
|
|
||||||
// this.ModuleBuried.SendToRtask(session, comm.Rtype104, -count)
|
|
||||||
go this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype104, -count))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if len(items) > 0 {
|
if len(items) > 0 {
|
||||||
_, errdata = this.ModuleItems.AddItems(session, items, bPush)
|
_, errdata = this.ModuleItems.AddItems(session, items, bPush)
|
||||||
|
@ -95,14 +95,16 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat
|
|||||||
// 埋点通知
|
// 埋点通知
|
||||||
func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.ConIProgress) {
|
func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.ConIProgress) {
|
||||||
var (
|
var (
|
||||||
confs []*cfg.GamePushGiftData
|
confs []*cfg.GamePushGiftData
|
||||||
info *pb.DBPushGiftbag
|
info *pb.DBPushGiftbag
|
||||||
user *pb.DBUser
|
user *pb.DBUser
|
||||||
condisMap map[int32]*pb.ConIProgress = make(map[int32]*pb.ConIProgress)
|
condisMap map[int32]*pb.ConIProgress = make(map[int32]*pb.ConIProgress)
|
||||||
targets map[int32]*cfg.GamePushGiftData = make(map[int32]*cfg.GamePushGiftData)
|
comdisScils []int32 = make([]int32, 0)
|
||||||
item []*pb.DBPushGiftbagItem
|
targets map[int32]*cfg.GamePushGiftData = make(map[int32]*cfg.GamePushGiftData)
|
||||||
ok bool
|
conIProgress *pb.ConIProgress
|
||||||
err error
|
item []*pb.DBPushGiftbagItem
|
||||||
|
ok bool
|
||||||
|
err error
|
||||||
)
|
)
|
||||||
this.Debug("收到子任务进度变化推送", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "condis", Value: condis})
|
this.Debug("收到子任务进度变化推送", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "condis", Value: condis})
|
||||||
if confs, err = this.configure.getGamePushGift(); err != nil {
|
if confs, err = this.configure.getGamePushGift(); err != nil {
|
||||||
@ -122,24 +124,71 @@ func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.C
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range confs {
|
for _, v := range confs {
|
||||||
if _, ok = condisMap[v.Condition]; ok && user.Integral >= int64(v.Integral[0]) && user.Integral <= int64(v.Integral[1]) {
|
for _, v1 := range v.Condition {
|
||||||
targets[v.Id] = v
|
if _, ok = condisMap[v1]; ok {
|
||||||
|
targets[v.Id] = v
|
||||||
|
comdisScils = append(comdisScils, v.Condition...)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range comdisScils {
|
||||||
|
if _, ok = condisMap[v]; !ok { //条件不全需要查询全部条件
|
||||||
|
if condis, err = this.ModuleBuried.CheckCondition(session.GetUserId(), comdisScils...); err != nil {
|
||||||
|
this.Error("校验玩家子任务进度数据 失败", log.Field{Key: "err", Value: err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
condisMap = make(map[int32]*pb.ConIProgress)
|
||||||
|
for _, v := range condis {
|
||||||
|
condisMap[v.Conid] = v
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v := range targets {
|
||||||
|
for _, cid := range v.Condition {
|
||||||
|
if conIProgress, ok = condisMap[cid]; !ok || conIProgress.State == pb.BuriedItemFinishState_buried_unfinish { //未完成
|
||||||
|
delete(targets, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, cid := range v.ConditionOr {
|
||||||
|
if conIProgress, ok = condisMap[cid]; ok && conIProgress.State == pb.BuriedItemFinishState_buried_finish { //完成一个即可
|
||||||
|
ok = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
ok = false
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
delete(targets, k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(targets) > 0 {
|
if len(targets) > 0 {
|
||||||
item = make([]*pb.DBPushGiftbagItem, 0)
|
item = make([]*pb.DBPushGiftbagItem, 0)
|
||||||
for _, v := range info.Item {
|
for _, target := range targets {
|
||||||
if _, ok = targets[v.Id]; ok {
|
ok = false
|
||||||
v.Stime = configure.Now().Unix()
|
for _, v := range info.Item {
|
||||||
} else {
|
if target.Id == v.Id {
|
||||||
|
v.Stime = configure.Now().Unix()
|
||||||
|
ok = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
item = append(item, &pb.DBPushGiftbagItem{
|
item = append(item, &pb.DBPushGiftbagItem{
|
||||||
Id: v.Id,
|
Id: target.Id,
|
||||||
Stime: configure.Now().Unix(),
|
Stime: configure.Now().Unix(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info.Item = append(info.Item, item...)
|
if len(item) > 0 {
|
||||||
|
info.Item = append(info.Item, item...)
|
||||||
|
}
|
||||||
|
this.model.Change(session.GetUserId(), map[string]interface{}{
|
||||||
|
"item": info.Item,
|
||||||
|
})
|
||||||
session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item})
|
session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,21 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.StorylineComple
|
|||||||
} else if conf.Leveltype == 4 {
|
} else if conf.Leveltype == 4 {
|
||||||
item.Level[req.Level] = 1
|
item.Level[req.Level] = 1
|
||||||
item.Chapter[conf.Chapter] = configure.Now().Unix()
|
item.Chapter[conf.Chapter] = configure.Now().Unix()
|
||||||
|
} else if conf.Leveltype == 5 {
|
||||||
|
if req.Report != nil {
|
||||||
|
if errdata, iswin = this.module.battle.CheckBattleReport(session, req.Report); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !iswin {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
Message: "battle no win!",
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item.Level[req.Level] = 1
|
||||||
} else {
|
} else {
|
||||||
item.Level[req.Level] = 1
|
item.Level[req.Level] = 1
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,6 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype68, -(add)))
|
|
||||||
}
|
}
|
||||||
change.Gold += int64(add)
|
change.Gold += int64(add)
|
||||||
case comm.ResExp:
|
case comm.ResExp:
|
||||||
@ -546,6 +545,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
change.Ps += add
|
change.Ps += add
|
||||||
|
userEx.ConsumPs += -add
|
||||||
} else {
|
} else {
|
||||||
if change.Ps+add > ggd.PsUl {
|
if change.Ps+add > ggd.PsUl {
|
||||||
change.Ps = ggd.PsUl
|
change.Ps = ggd.PsUl
|
||||||
@ -652,6 +652,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
|
|||||||
comm.ResFriend: change.Friend,
|
comm.ResFriend: change.Friend,
|
||||||
comm.SociatyCoin: change.Guildcoin,
|
comm.SociatyCoin: change.Guildcoin,
|
||||||
comm.ArenaCoin: change.Arenacoin,
|
comm.ArenaCoin: change.Arenacoin,
|
||||||
|
"consumPs": userEx.ConsumPs,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := this.modelUser.updateUserAttr(uid, update); err != nil {
|
if err := this.modelUser.updateUserAttr(uid, update); err != nil {
|
||||||
@ -696,27 +697,47 @@ func (this *User) AddAttributeValue(session comm.IUserSession, attr string, add
|
|||||||
|
|
||||||
// 用户资源
|
// 用户资源
|
||||||
func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string]int32, bPush bool) (errdata *pb.ErrorData) {
|
func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string]int32, bPush bool) (errdata *pb.ErrorData) {
|
||||||
|
var (
|
||||||
|
expChange bool
|
||||||
|
vipExpChange bool
|
||||||
|
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
||||||
|
_change *pb.UserResChangedPush
|
||||||
|
)
|
||||||
for key, add := range attrs {
|
for key, add := range attrs {
|
||||||
var _change *pb.UserResChangedPush
|
|
||||||
_change, errdata = this.change(session, key, add)
|
_change, errdata = this.change(session, key, add)
|
||||||
if errdata != nil {
|
if errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _change == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if bPush { //推送玩家账号信息变化消息
|
|
||||||
session.SendMsg(string(this.GetType()), "reschanged", _change)
|
|
||||||
}
|
|
||||||
if key == comm.ResExp {
|
if key == comm.ResExp {
|
||||||
this.ModuleUser.EventUserChanged(session)
|
expChange = true
|
||||||
} else if key == comm.VipExp {
|
} else if key == comm.VipExp {
|
||||||
this.ModuleUser.EventUserVipChanged(session)
|
vipExpChange = true
|
||||||
|
}
|
||||||
|
if key == comm.ResPs && add < 0 { //消耗体力
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype213, -add))
|
||||||
|
}
|
||||||
|
if key == comm.ResGold && add < 0 { //消耗体力
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype68, -add))
|
||||||
|
}
|
||||||
|
if key == comm.ResDiamond && add < 0 { //消耗钻石
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype104, -add))
|
||||||
|
}
|
||||||
|
if key == comm.Integral && add > 0 { //积分获取
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype214, add))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if bPush { //推送玩家账号信息变化消息
|
||||||
|
session.SendMsg(string(this.GetType()), "reschanged", _change)
|
||||||
|
}
|
||||||
|
if expChange {
|
||||||
|
this.ModuleUser.EventUserChanged(session)
|
||||||
|
}
|
||||||
|
if vipExpChange {
|
||||||
|
this.ModuleUser.EventUserVipChanged(session)
|
||||||
|
}
|
||||||
|
if len(tasks) > 0 {
|
||||||
|
go this.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,4 +86,9 @@ const (
|
|||||||
GameBuffType_SHILED_CAN_ADD = 93
|
GameBuffType_SHILED_CAN_ADD = 93
|
||||||
GameBuffType_SPECIAL_SHIELD = 94
|
GameBuffType_SPECIAL_SHIELD = 94
|
||||||
GameBuffType_PROB_RESISTBUFF = 95
|
GameBuffType_PROB_RESISTBUFF = 95
|
||||||
|
GameBuffType_HAS_BUFF_MODIFY_EFFECT_RESIST = 96
|
||||||
|
GameBuffType_ADJUST_PRO_BY_DMG = 97
|
||||||
|
GameBuffType_BE_DMG_ADD_ONCE_PER_PERSON = 98
|
||||||
|
GameBuffType_IGNORE_EFFECT_RESIST = 99
|
||||||
|
GameBuffType_IGNORE_IMMUNITY = 100
|
||||||
)
|
)
|
||||||
|
@ -118,5 +118,6 @@ const (
|
|||||||
GamePropertyType_Shield_Per = 106
|
GamePropertyType_Shield_Per = 106
|
||||||
GamePropertyType_Base_Shield = 107
|
GamePropertyType_Base_Shield = 107
|
||||||
GamePropertyType_Ext_Shield = 108
|
GamePropertyType_Ext_Shield = 108
|
||||||
GamePropertyType_Max = 109
|
GamePropertyType_TreCrit = 109
|
||||||
|
GamePropertyType_Max = 110
|
||||||
)
|
)
|
||||||
|
@ -15,8 +15,8 @@ type GamePushGiftData struct {
|
|||||||
Name string
|
Name string
|
||||||
Title string
|
Title string
|
||||||
Resource string
|
Resource string
|
||||||
Integral []int32
|
Condition []int32
|
||||||
Condition int32
|
ConditionOr []int32
|
||||||
Lbid []*Gameatn
|
Lbid []*Gameatn
|
||||||
Time int32
|
Time int32
|
||||||
Rebate int32
|
Rebate int32
|
||||||
@ -39,18 +39,31 @@ func (_v *GamePushGiftData)Deserialize(_buf map[string]interface{}) (err error)
|
|||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
if _arr_, _ok_ = _buf["integral"].([]interface{}); !_ok_ { err = errors.New("integral error"); return }
|
if _arr_, _ok_ = _buf["condition"].([]interface{}); !_ok_ { err = errors.New("condition error"); return }
|
||||||
|
|
||||||
_v.Integral = make([]int32, 0, len(_arr_))
|
_v.Condition = make([]int32, 0, len(_arr_))
|
||||||
|
|
||||||
for _, _e_ := range _arr_ {
|
for _, _e_ := range _arr_ {
|
||||||
var _list_v_ int32
|
var _list_v_ int32
|
||||||
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
|
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
|
||||||
_v.Integral = append(_v.Integral, _list_v_)
|
_v.Condition = append(_v.Condition, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["condition_or"].([]interface{}); !_ok_ { err = errors.New("condition_or error"); return }
|
||||||
|
|
||||||
|
_v.ConditionOr = make([]int32, 0, len(_arr_))
|
||||||
|
|
||||||
|
for _, _e_ := range _arr_ {
|
||||||
|
var _list_v_ int32
|
||||||
|
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
|
||||||
|
_v.ConditionOr = append(_v.ConditionOr, _list_v_)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["condition"].(float64); !_ok_ { err = errors.New("condition error"); return }; _v.Condition = int32(_tempNum_) }
|
|
||||||
{
|
{
|
||||||
var _arr_ []interface{}
|
var _arr_ []interface{}
|
||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
|
Loading…
Reference in New Issue
Block a user