lt hace 1 año
padre
commit
a40cc1aef9

+ 21 - 7
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role.go

@@ -3571,6 +3571,14 @@ func (this *Role) PayInfoGet(goodsType, goodsId, count int32, rushStage, rushRou
 			})
 			//this.role.AddRes(int32(serverproto.ResType_Res_VipExp), AddItemST{ItemCount: int32(vipExp)}, true)
 		}
+		if payOrderInfo.GoodsName == "czk" {
+			//内网PC模式下直接购买成功
+			ackMsg.Error = int32(serverproto.ErrorCode_ERROR_PAY_PRODUCTION_MODE)
+			this.ReplayGate(ackMsg, true)
+			this.OnPayCallback(payOrderInfo, false, false)
+			util.InfoF("uid=%v pc mode: shop:%v id:%v, count:%v, price:%v", this.GetUUid(), payOrderInfo.GoodsType, payOrderInfo.GoodsId, payOrderInfo.Count, payOrderInfo.Amount)
+			return
+		}
 
 		if service.GetServiceConfig().Node.AuthMode == AUTHMODE_PC {
 			//内网PC模式下直接购买成功
@@ -3704,24 +3712,30 @@ func (this *Role) payInfoGet(goodsType, goodsId, count int32, rushStage, rushRou
 	default:
 		return serverproto.ErrorCode_ERROR_FAIL, nil
 	}
-
+	payRewardInfo.GoodsName = service.GetServiceConfig().Node.PayCallBack
 	//检测是否有充值卡自动使用
 	num := this.GetItemNum(22512)
 	if num > 0 {
 		cfgData, ok := serverproto.ItemCfgLoader[22512]
+
 		if ok {
 			//有效期内
-			if int64(this.roleBag.getItemById(22512).TimeStamp+uint32(cfgData.ItemTimeCd)) < util.GetTimeSeconds() {
-				util.InfoF("buy shop amount:%v,card use:%v", payRewardInfo.Amount, cfgData.NatureType)
-				if (payRewardInfo.Amount - float32(cfgData.NatureType)) <= 0 {
-					payRewardInfo.Amount = 0
+			for k, itemData := range this.roleBag.itemList {
+				if itemData.ConfigId == 22512 {
+					if int64(itemData.TimeStamp+uint32(cfgData.ItemTimeCd)) < util.GetTimeSeconds() {
+						util.InfoF("buy shop amount:%v,card use:%v ,time1:%v ,time2:%v", payRewardInfo.Amount, cfgData.NatureType, itemData.TimeStamp, cfgData.ItemTimeCd)
+						if (payRewardInfo.Amount - float32(cfgData.NatureType)) <= 0 {
+							//payRewardInfo.Amount = 0
+							payRewardInfo.GoodsName = "czk" //充值卡
+							this.roleBag.DelItemById(k, 1, AddFrom_System)
+						}
+					}
+					break
 				}
 			}
 		}
-		this.roleBag.DelItemById(22512, 1, AddFrom_System)
 	}
 
-	payRewardInfo.GoodsName = service.GetServiceConfig().Node.PayCallBack
 	return serverproto.ErrorCode_ERROR_OK, payRewardInfo
 }
 

+ 2 - 0
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_bag.go

@@ -316,6 +316,8 @@ func (this *RoleBag) addItem(cfgData *serverproto.ItemCfg, count int32, st AddIt
 		fallthrough
 	case serverproto.ResType_Res_WishBox_Select:
 		fallthrough
+	case serverproto.ResType_Res_RechargeCard:
+		fallthrough
 	case serverproto.ResType_Res_Gift_Unique:
 		if this.itemAction.add(itemCfgId, count) {
 			this.SetDirty(true)

+ 1 - 0
RO_Server_Trunk-branch_0.1.39/roserver/gmweb/msg/msg.go

@@ -65,6 +65,7 @@ func init() {
 					util.ErrorF("uid:%v cdk del error,code:%v error:%v", uuid, code, err)
 					gmmodel.SendSocial(res)
 				}
+				util.ErrorF("uid:%v cdk get:%v", uuid, code)
 				res.RewardList = a.ItemList
 			} else {
 				//util.InfoF("aaaa:%v", model.ConvertCdkRewardMap)