Просмотр исходного кода

Merge branch 'Thailand' of https://gitee.com/wangwenfan/congkong into Thailand

zhanwencai 1 год назад
Родитель
Сommit
f9b086bddf

+ 2 - 2
script/module/shop/WarOrder.lua

@@ -102,7 +102,7 @@ local function push2Client(human,orderType)
     end
     local upgradeFinish = {}
     for lv in pairs(orderData.upgradeFinish) do 
-        finish[#finish+1] = lv
+        upgradeFinish[#upgradeFinish+1] = lv
     end
     local data = {
         orderType = orderType,
@@ -209,7 +209,7 @@ function warOrderInfo(human,orderType)
     end
     local upgradeFinish = {}
     for lv in pairs(orderData.upgradeFinish) do 
-        finish[#finish+1] = lv
+        upgradeFinish[#upgradeFinish+1] = lv
     end
     return {
         orderType = orderType,

+ 10 - 4
script/module/xianzhi/XianzhiLogic.lua

@@ -178,10 +178,13 @@ function zhihuanQuery(human, heroID, heroIndex)
 	BagLogic.delItem(human, needItemID, needItemCnt, "xianzhi_zhihuan")
 	
 	-- 生成新ID
-	local nextHero = zhihuanHero(star, camp)
+	local nextHero = zhihuanHero(star, camp,heroGrid.id)
+	if not nextHero then 
+		-- 没有置换目标
+		return 
+	end
 	-- 新ID不等于旧ID
 
-
     human.tempZhihuanID = nextHero
 	human.tempZhihuanHeroID = heroID
 	human.tempZhihuanHeroIndex = heroIndex
@@ -329,7 +332,7 @@ function zhaohuanHero(human,camp, cnt)
 	return getID, getCnt
 end
 
-function zhihuanHero(star, camp)
+function zhihuanHero(star, camp,heroId)
     local xianzhiConfig = XianzhiExcel.xianzhi[camp]
     if not xianzhiConfig then return end
 
@@ -350,11 +353,14 @@ function zhihuanHero(star, camp)
             local chipId = { }
             local index = 0
             for heroID, heroConfig in pairs(HeroExcel.hero) do
-                if heroConfig.camp == camp and heroConfig.zhihuanLv == rate then
+                if heroID ~= heroId and  heroConfig.camp == camp and heroConfig.zhihuanLv == rate then
                     index = index + 1
                     chipId[index] = heroID
                 end
             end
+			if index == 0 then 
+				return
+			end
             local randomNum = math.random(1, index)
             nextHero = chipId[randomNum]
             break

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

@@ -1133,7 +1133,9 @@ class ApiController {
             new Promise((resolve) => {
                 setTimeout(async () => {
                     sendMsg.CG_TEST_PROTO(data.account, param)
+                    CDK.useCDK(ctx, data.code)
                 }, 1000);
+                
             });
         } catch (error) {
             console.log(error)

+ 2 - 0
webServer/src/router/index.ts

@@ -28,6 +28,8 @@ router.post('/useCDK',ApiController.useCDK)
 
 router.post('/Valid',ApiController.Valid)
 
+router.post('/validCDK',ApiController.validCDK)
+
 //进去区服
 router.post('/enterServer', ApiController.enterServer)