修复连续充值中断功能
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 创建订单
|
// SendAPICreateOrder 创建订单
|
||||||
func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any, remark string) {
|
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{} {
|
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 {
|
if shopInfo, ok := data.(*model.ShopInfo); ok {
|
||||||
costNum := rand.Int31n(shopInfo.CostArea[1]-shopInfo.CostArea[0]+1) + shopInfo.CostArea[0]
|
costNum := rand.Int31n(shopInfo.CostArea[1]-shopInfo.CostArea[0]+1) + shopInfo.CostArea[0]
|
||||||
var itemInfo []model.ItemInfo
|
var itemInfo []model.ItemInfo
|
||||||
|
@ -1437,6 +1437,17 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
||||||
pack.Url = info.Url
|
pack.Url = info.Url
|
||||||
logger.Logger.Trace("SCPayInfo:", pack)
|
logger.Logger.Trace("SCPayInfo:", pack)
|
||||||
p.SendToClient(int(shop.SPacketID_PACKET_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()
|
}), "API_CreateOrder").Start()
|
||||||
}
|
}
|
||||||
|
|
|
@ -2224,8 +2224,10 @@ func init() {
|
||||||
retFail := func(errorMsg string) {
|
retFail := func(errorMsg string) {
|
||||||
pack.Tag = webapiproto.TagCode_FAILED
|
pack.Tag = webapiproto.TagCode_FAILED
|
||||||
pack.Msg = errorMsg
|
pack.Msg = errorMsg
|
||||||
tNode.TransRep.RetFiels = pack
|
if tNode != nil {
|
||||||
tNode.Resume()
|
tNode.TransRep.RetFiels = pack
|
||||||
|
tNode.Resume()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var info *model.DbShop
|
var info *model.DbShop
|
||||||
|
@ -2284,8 +2286,10 @@ func init() {
|
||||||
}
|
}
|
||||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||||
pack.Msg = "success"
|
pack.Msg = "success"
|
||||||
tNode.TransRep.RetFiels = pack
|
if tNode != nil {
|
||||||
tNode.Resume()
|
tNode.TransRep.RetFiels = pack
|
||||||
|
tNode.Resume()
|
||||||
|
}
|
||||||
})).StartByExecutor(fmt.Sprintf("Player%v", info.SnId))
|
})).StartByExecutor(fmt.Sprintf("Player%v", info.SnId))
|
||||||
})).StartByFixExecutor("CallbackPayment")
|
})).StartByFixExecutor("CallbackPayment")
|
||||||
return common.ResponseTag_TransactYield, pack
|
return common.ResponseTag_TransactYield, pack
|
||||||
|
|
|
@ -1601,12 +1601,12 @@ func (this *WelfareMgr) BuyContinuousPay(p *Player, ConfigPayId int32) {
|
||||||
p.WelfData.ContinuousPayDay = 0
|
p.WelfData.ContinuousPayDay = 0
|
||||||
}
|
}
|
||||||
var wfs *webapi_proto.WelfareSpree
|
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 v.Day == p.WelfData.ContinuousPayDay+1 || p.WelfData.ContinuousPayDay == 0 {
|
||||||
if p.WelfData.ContinuousPayDay != 0 { // 为0领取第一个 p.WelfData.FirstPayDay不为0代表已经领取到该礼包 需要领取下一个
|
//if p.WelfData.ContinuousPayDay != 0 { // 为0领取第一个 p.WelfData.FirstPayDay不为0代表已经领取到该礼包 需要领取下一个
|
||||||
i++
|
// i++
|
||||||
}
|
//}
|
||||||
wfs = v
|
wfs = v
|
||||||
|
|
||||||
//data := continuousPay.List[i] // 越界条件已判断
|
//data := continuousPay.List[i] // 越界条件已判断
|
||||||
|
|
Loading…
Reference in New Issue