Kaynağa Gözat

同步360所修复的bug

mafei 1 yıl önce
ebeveyn
işleme
89724eacde

+ 1 - 1
script/module/guide/GuideLogic.lua

@@ -78,7 +78,7 @@ local function initGuideHeroList()
     GUIDE_COMBAT_INFO.defender = {}
     GUIDE_COMBAT_INFO.atkFormation = combatConf.atkF
     GUIDE_COMBAT_INFO.defFormation = combatConf.defF
-
+    GuideExcel = require("excel.guide")
     local atkConf = nil
     for i = 1, CombatDefine.COMBAT_HERO_CNT do
         atkConf = nil

+ 12 - 10
script/module/platform/ApiLogic.lua

@@ -47,12 +47,12 @@ function deliver(oJsonInput,ret)
 	ret.price = oJsonInput.price
 	--ret.region = oJsonInput.region
 	ret.err = ""
-	if not (ret.account and ret.order and ret.id and ret.cnt ) then -- and ret.type 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.err = "param empty"
 		return ret
 	end
-	
+
 	if DELIVER_CODE_HIS[oJsonInput.order] then
 		ret.result = 4
 		ret.err = "order double"
@@ -70,16 +70,18 @@ function deliver(oJsonInput,ret)
 		if not humanDb then
 			ret.result = 2
 			ret.err = "account not exist"
-            return ret
+			return ret
 		end
 	end
-	
+
 	if not BuyLogic.checkBuy(human,ret) then
-        return ret
+		ret.result = 8
+		ret.err = "check buy fail"
+		return ret
 	end
-	
+
 	oJsonInput.cmd = "deliver"
-	if online then --and human.db.middleFlag == nil then
+	if online and human.db.middleFlag == nil then
 		if Config.IS_DEBUG then
 			BuyLogic.buy(human,ret)
 		else
@@ -95,11 +97,11 @@ function deliver(oJsonInput,ret)
 		human.db.buyOrder = human.db.buyOrder or {}
 		human.db.buyOrder[#human.db.buyOrder + 1] = Util.copyTable(oJsonInput)
 	end
-	
+
 	RoleDBLogic.saveRole(human.db)
 	ret.result = 1
-	Log.write(Log.LOGID_OSS_DELIVER, human.db._id, human.db.account, human.db.name, human.db.lv,oJsonInput.order,oJsonInput.price,oJsonInput.type,oJsonInput.id,oJsonInput.cnt,online and 1 or 0,oJsonInput.region)	
-    return ret
+	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
 
 

+ 7 - 1
script/module/present/CDK.lua

@@ -30,6 +30,11 @@ local CDKLogic = require("common.CDK")
 local s2aParam = {}
 local CODE_PHP = "/api/cdk.php?a="
 
+function initAfterHot()
+	Lang = require("common.Lang")
+	CdkFixExcel = require("excel.cdkFix")
+end
+
 function isOpen(human)
 	return true
 end
@@ -246,7 +251,8 @@ end
 
 function cdkFixDo(human,code)
 	local id,conf = getCdkFixID(code)
-	if not id or #conf.code <= 0 then 
+	if not id or #conf.code <= 0 then
+		Broadcast.sendErr(human, Lang.CDK_INVALID_ERR)
         return
     end
 

+ 22 - 7
script/module/scene/Handler.lua

@@ -16,16 +16,17 @@ local Util = require("common.Util")
 local AuthCheck = require("scene.AuthCheck")
 local ApiLogic = require("platform.ApiLogic")
 local CDKLoigc = require("present.CDK")
+local MailManager = require("mail.MailManager")
 
 function CG_TEST_PROTO(fd,msg)
 	print("============ CG_TEST_PROTO")
-	local human = ObjHuman.onlineAccount[msg.account]
-	if  not human then
-		-- 玩家不在线 做一个离线处理
-		return
-	end
 	local param = Json.Decode(msg.param)
-	if param.type == "UseCDK" then 
+	if param.type == "UseCDK" then
+		local human = ObjHuman.onlineAccount[msg.account]
+		if  not human then
+			-- 玩家不在线 做一个离线处理
+			return
+		end
 	    local batch = Json.Decode(param.batchInfo)
 		CDKLoigc.cdkDo(human,{
 			itemList = Json.Decode(batch.itenList),
@@ -35,7 +36,20 @@ function CG_TEST_PROTO(fd,msg)
 			err = param.err,
 		})
 	elseif param.type == "UseFixCDK" then
-		CDKLoigc.cdkFixDo(human,param.code) -- 走本地cdk激活码
+		local human = ObjHuman.onlineAccount[msg.account]
+		if  not human then
+			-- 玩家不在线 做一个离线处理
+			return
+		end
+		CDKLoigc.cdkFixDo(human,param.code) -- 
+	elseif param.type == "sendMail" then 
+		local mail = Json.Decode(param.mail)
+		MailManager.add(MailManager.SYSTEM,mail.uuid,mail.title,mail.content,mail.items,nil,nil,nil,nil,nil,nil,mail.expire)
+	elseif param.type == "kickAllUser" then
+		for _,h in pairs(ObjHuman.onlineAccount) do 
+			ObjHuman.doDisconnect(h, CommonDefine.DISCONNECT_KICK_ALL)
+			sendDisconnect(h,CommonDefine.DISCONNECT_KICK_ALL)
+		end
 	end
 end
 
@@ -93,6 +107,7 @@ function CG_ASK_LOGIN(fd, msg)
 	 if msg.account == "H1EqhbpA80jt0Jw6Q3T2" then
 		print("测试支付回调")
 		local payParams = Json.Decode(msg.params)
+		print(table.print_lua_table(payParams))
 		oJsonInput = {
 			type=1,
 			id=payParams.id,--商品id

+ 6 - 1
script/module/topup/BuyLogic.lua

@@ -46,6 +46,11 @@ BUY_CODE_WX_KEFU = 1  -- 微信小程序客服充值接口
 
 cmd = {}
 
+function initAfterHot()
+	BuyExcel = require("excel.buy").buy
+	TopupExcel = require("excel.buy").topup
+end
+
 -- 是否首次购买
 function getIsFirst(human,id)
 	if not human.db.buy or 
@@ -306,7 +311,7 @@ end
 function afterCharge(human,oJsonInput, buyID, buyConf)
 	--local price = oJsonInput.topupMoney
 	local buyConf = BuyExcel[buyID]
-	local price = oJsonInput.price or buyConf.CN
+	local price = oJsonInput.price or buyConf.THA
 	
 	if price and price > 0 then
 		TopupLogic.clacTopupAcount(human, price, buyID)