修复连续充值中断功能
This commit is contained in:
parent
aab1e45d5f
commit
a279eaad4c
|
@ -1290,9 +1290,9 @@ func (this *ShopMgr) NewDbShop(p *Player, pageId int32, amount []int32, consume,
|
|||
// SendAPICreateOrder 创建订单
|
||||
func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any, remark string) {
|
||||
//三方购买
|
||||
var amount [ShopParamMax]int32
|
||||
var dbShop *model.DbShop
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
var amount [ShopParamMax]int32
|
||||
var dbShop *model.DbShop
|
||||
if shopInfo, ok := data.(*model.ShopInfo); ok {
|
||||
costNum := rand.Int31n(shopInfo.CostArea[1]-shopInfo.CostArea[0]+1) + shopInfo.CostArea[0]
|
||||
var itemInfo []model.ItemInfo
|
||||
|
@ -1437,6 +1437,17 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
|||
pack.Url = info.Url
|
||||
logger.Logger.Trace("SCPayInfo:", pack)
|
||||
p.SendToClient(int(shop.SPacketID_PACKET_SCPAYINFO), pack)
|
||||
|
||||
// test
|
||||
//fn := WebAPIHandlerMgrSingleton.GetWebAPIHandler("/api/pay/CallbackPayment")
|
||||
//msg := &webapi_proto.ASCallbackPayment{
|
||||
// OrderId: dbShop.LogId.Hex(),
|
||||
// Platform: "1",
|
||||
// State: 1,
|
||||
//}
|
||||
//b, _ := proto.Marshal(msg)
|
||||
//fn.Handler(nil, b)
|
||||
// test
|
||||
}
|
||||
}), "API_CreateOrder").Start()
|
||||
}
|
||||
|
|
|
@ -2224,8 +2224,10 @@ func init() {
|
|||
retFail := func(errorMsg string) {
|
||||
pack.Tag = webapiproto.TagCode_FAILED
|
||||
pack.Msg = errorMsg
|
||||
tNode.TransRep.RetFiels = pack
|
||||
tNode.Resume()
|
||||
if tNode != nil {
|
||||
tNode.TransRep.RetFiels = pack
|
||||
tNode.Resume()
|
||||
}
|
||||
}
|
||||
|
||||
var info *model.DbShop
|
||||
|
@ -2284,8 +2286,10 @@ func init() {
|
|||
}
|
||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||
pack.Msg = "success"
|
||||
tNode.TransRep.RetFiels = pack
|
||||
tNode.Resume()
|
||||
if tNode != nil {
|
||||
tNode.TransRep.RetFiels = pack
|
||||
tNode.Resume()
|
||||
}
|
||||
})).StartByExecutor(fmt.Sprintf("Player%v", info.SnId))
|
||||
})).StartByFixExecutor("CallbackPayment")
|
||||
return common.ResponseTag_TransactYield, pack
|
||||
|
|
|
@ -1601,12 +1601,12 @@ func (this *WelfareMgr) BuyContinuousPay(p *Player, ConfigPayId int32) {
|
|||
p.WelfData.ContinuousPayDay = 0
|
||||
}
|
||||
var wfs *webapi_proto.WelfareSpree
|
||||
for i, v := range continuousPay.List {
|
||||
for _, v := range continuousPay.List {
|
||||
|
||||
if v.Day == p.WelfData.ContinuousPayDay || p.WelfData.ContinuousPayDay == 0 {
|
||||
if p.WelfData.ContinuousPayDay != 0 { // 为0领取第一个 p.WelfData.FirstPayDay不为0代表已经领取到该礼包 需要领取下一个
|
||||
i++
|
||||
}
|
||||
if v.Day == p.WelfData.ContinuousPayDay+1 || p.WelfData.ContinuousPayDay == 0 {
|
||||
//if p.WelfData.ContinuousPayDay != 0 { // 为0领取第一个 p.WelfData.FirstPayDay不为0代表已经领取到该礼包 需要领取下一个
|
||||
// i++
|
||||
//}
|
||||
wfs = v
|
||||
|
||||
//data := continuousPay.List[i] // 越界条件已判断
|
||||
|
|
Loading…
Reference in New Issue