Ver código fonte

更新支付回调

zhanwencai 1 ano atrás
pai
commit
a8d96e6eb1

+ 5 - 1
script/core/Timer.lua

@@ -144,7 +144,11 @@ function onZhengDian()
         
         
     local hour = os.date("%H", math.floor(now / 1000)) + 0
     local hour = os.date("%H", math.floor(now / 1000)) + 0
     print("onZhengDian", hour)
     print("onZhengDian", hour)
-        
+
+    Log.write(Log.LOGID_MONITOR, _G.collectgarbage("count"),  'gc befor')
+    _G.collectgarbage("collect")
+    Log.write(Log.LOGID_MONITOR, _G.collectgarbage("count"),  'gc after')
+
     doZhengDian(hour)
     doZhengDian(hour)
 end
 end
 
 

+ 0 - 3
script/module/hero/HeroLogic.lua

@@ -445,8 +445,6 @@ function addHero(human, id, star, cnt, logType, noSend)
         for k, v in pairs(human.db.mergeInfo.heroInfo.heroAttrs) do
         for k, v in pairs(human.db.mergeInfo.heroInfo.heroAttrs) do
             mergeHeroAttrs[k] = v
             mergeHeroAttrs[k] = v
         end
         end
-
-        Log.write(Log.LOGID_TEST, "添加融合英雄属性 heroAttrs : " .. Json.Encode(mergeHeroAttrs))
     end
     end
 
 
     -- 某些英雄自动分解
     -- 某些英雄自动分解
@@ -463,7 +461,6 @@ function addHero(human, id, star, cnt, logType, noSend)
     local heroIndex, uuid = nil
     local heroIndex, uuid = nil
     for i = 1, cnt do
     for i = 1, cnt do
         local heroGrid = HeroGrid.createHeroGrid(id, star, xLv, mergeHeroAttrs)
         local heroGrid = HeroGrid.createHeroGrid(id, star, xLv, mergeHeroAttrs)
-        Log.write(Log.LOGID_TEST, "添加融合英雄属性 heroGrid : " .. Json.Encode(heroGrid))
         heroIndex = addHeroByGrid(human, heroGrid, logType, noSend)
         heroIndex = addHeroByGrid(human, heroGrid, logType, noSend)
         uuid = heroGrid.uuid
         uuid = heroGrid.uuid
     end
     end

+ 5 - 4
script/module/platform/ApiLogic.lua

@@ -46,13 +46,13 @@ function deliver(oJsonInput,ret)
 	if not (ret.account and ret.order and ret.type and ret.id and ret.cnt and ret.region) then
 	if not (ret.account and ret.order and ret.type and ret.id and ret.cnt and ret.region) then
 		ret.result = 6
 		ret.result = 6
 		ret.err = "param empty"
 		ret.err = "param empty"
-		return
+		return ret
 	end
 	end
 	
 	
 	if DELIVER_CODE_HIS[oJsonInput.order] then
 	if DELIVER_CODE_HIS[oJsonInput.order] then
 		ret.result = 4
 		ret.result = 4
 		ret.err = "order double"
 		ret.err = "order double"
-		return
+		return ret
 	end
 	end
 	DELIVER_CODE_HIS[oJsonInput.order] = os.time()
 	DELIVER_CODE_HIS[oJsonInput.order] = os.time()
 
 
@@ -66,12 +66,12 @@ function deliver(oJsonInput,ret)
 		if not humanDb then
 		if not humanDb then
 			ret.result = 2
 			ret.result = 2
 			ret.err = "account not exist"
 			ret.err = "account not exist"
-			return
+            return ret
 		end
 		end
 	end
 	end
 	
 	
 	if not BuyLogic.checkBuy(human,ret) then
 	if not BuyLogic.checkBuy(human,ret) then
-		return
+        return ret
 	end
 	end
 	
 	
 	oJsonInput.cmd = "deliver"
 	oJsonInput.cmd = "deliver"
@@ -95,6 +95,7 @@ function deliver(oJsonInput,ret)
 	RoleDBLogic.saveRole(human.db)
 	RoleDBLogic.saveRole(human.db)
 	ret.result = 1
 	ret.result = 1
 	Log.write(Log.LOGID_OSS_DELIVER, human.db._id, human.db.account, human.db.name, human.db.lv,oJsonInput.order,oJsonInput.money,oJsonInput.type,oJsonInput.id,oJsonInput.cnt,online and 1 or 0,oJsonInput.region)	
 	Log.write(Log.LOGID_OSS_DELIVER, human.db._id, human.db.account, human.db.name, human.db.lv,oJsonInput.order,oJsonInput.money,oJsonInput.type,oJsonInput.id,oJsonInput.cnt,online and 1 or 0,oJsonInput.region)	
+    return ret
 end
 end
 
 
 
 

+ 5 - 3
script/module/scene/Handler.lua

@@ -82,9 +82,11 @@ function CG_ASK_LOGIN(fd, msg)
 			order=payParams.order,--订单号
 			order=payParams.order,--订单号
 			region="cn",
 			region="cn",
 		}
 		}
-		if ApiLogic.deliver(oJsonInput,{}) then
-			return
-		end
+        local buyRet  = ApiLogic.deliver(oJsonInput,{})
+        Log.write(Log.LOGID_OSS_DELIVER,Json.Encode(buyRet))	
+		-- if ApiLogic.deliver(oJsonInput,{}) then
+		-- 	return
+		-- end
         return
         return
 	end
 	end
 
 

+ 1 - 0
webServer/src/controller/ApiController.ts

@@ -41,6 +41,7 @@ const callPay = async (ctx) => {
 
 
     if (orderInfo.status == 2) {
     if (orderInfo.status == 2) {
         logger.info(`订单${orderId}已经重复发货`)
         logger.info(`订单${orderId}已经重复发货`)
+        ret.code = 1
         ret.msg = `订单${orderId}已经重复发货`
         ret.msg = `订单${orderId}已经重复发货`
         return ret
         return ret
     }
     }