zhanwencai 1 рік тому
батько
коміт
0970621be6
2 змінених файлів з 15 додано та 1 видалено
  1. 5 0
      script/module/present/CDK.lua
  2. 10 1
      script/module/scene/Handler.lua

+ 5 - 0
script/module/present/CDK.lua

@@ -249,6 +249,11 @@ function cdkDo(human,msg)
 	Msg.send(Msg.gc.GC_CDK, human.fd)
 	Msg.send(Msg.gc.GC_CDK, human.fd)
 end
 end
 
 
+function cdkDoV2(human,msg)
+	BagLogic.addItemList(human, msg.itemList , "cdk")
+	Msg.send(Msg.gc.GC_CDK, human.fd)
+end
+
 function cdkFixDo(human,code)
 function cdkFixDo(human,code)
 	local id,conf = getCdkFixID(code)
 	local id,conf = getCdkFixID(code)
 	if not id or #conf.code <= 0 then
 	if not id or #conf.code <= 0 then

+ 10 - 1
script/module/scene/Handler.lua

@@ -21,7 +21,16 @@ local MailManager = require("mail.MailManager")
 function CG_TEST_PROTO(fd,msg)
 function CG_TEST_PROTO(fd,msg)
 	print("============ CG_TEST_PROTO")
 	print("============ CG_TEST_PROTO")
 	local param = Json.Decode(msg.param)
 	local param = Json.Decode(msg.param)
-	if param.type == "UseCDK" then
+	if param.type == "UseCDKV2" then
+		local human = ObjHuman.onlineAccount[msg.account]
+		if  not human then
+			-- 玩家不在线 做一个离线处理
+			return
+		end
+		CDKLoigc.cdkDoV2(human,{
+			itemList = param.itemList,
+		})
+	elseif param.type == "UseCDK" then
 		local human = ObjHuman.onlineAccount[msg.account]
 		local human = ObjHuman.onlineAccount[msg.account]
 		if  not human then
 		if  not human then
 			-- 玩家不在线 做一个离线处理
 			-- 玩家不在线 做一个离线处理