Explorar o código

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

zhanwencai hai 1 ano
pai
achega
e94b0401b6
Modificáronse 2 ficheiros con 23 adicións e 16 borrados
  1. 20 16
      script/module/absAct/HeroGrowUp.lua
  2. 3 0
      script/module/bag/Grid.lua

+ 20 - 16
script/module/absAct/HeroGrowUp.lua

@@ -150,7 +150,15 @@ function getActStartTime()
 
     local absActConfig = AbsActExcel.absActivity[DG_ABS_ACT_ID]
 	assert(#absActConfig.turns ~= 0,"invalid config error")
-	return absActConfig.startDate,absActConfig.endDate,absActConfig.turns[1] -- @error 目前默认第一期
+	local actStartDate = absActConfig.startDate
+	actStartDate.hour = actStartDate.hour or  0
+	actStartDate.min = actStartDate.min or 0
+	actStartDate.sec = actStartDate.sec or 0
+	local actEndDate = absActConfig.endDate
+	actEndDate.hour = actEndDate.hour or  0
+	actEndDate.min = actEndDate.min or 0
+	actEndDate.sec = actEndDate.sec or 0
+	return os.time(actStartDate),os.time(actEndDate),absActConfig.turns[1] -- @error 目前默认第一期
 	
 end
 
@@ -159,10 +167,10 @@ local function transBeiJingTime(d)
 end
 
 -- 活动剩余时间
-function getActLeftTime(dateCfg)
-	local finishTime = transBeiJingTime(dateCfg)
+local function getActLeftTime(dateCfg)
+	--local finishTime = transBeiJingTime(dateCfg)
 	local now = os.time()
-    return finishTime > now and finishTime - now or 0
+    return now > dateCfg and dateCfg - now or 0
 end
 
 -- 任务周期
@@ -193,15 +201,11 @@ function getTaskLeftTime(actStartDate, mainType)
 
 	--local actLeftTime = getActLeftTime(actStartTime)
 	--return actLeftTime % time
-	actStartDate.hour = actStartDate.hour or  0
-	actStartDate.min = actStartDate.min or 0
-	actStartDate.sec = actStartDate.sec or 0
-	local actStartTime = os.time(actStartDate)
 	local now = os.time()
-	if now < actStartTime then 
+	if now < actStartDate then 
 		return 0
 	end
-	return (now - actStartTime) % time
+	return (now - actStartDate) % time
 end
 
 -- 是否开放
@@ -605,8 +609,8 @@ end
 
 -------------------------------------------- msg -------------------------------------------------------
 -- 封装基础信息
-function fontBaseNet(net, human, actStartTime, lvdefine)
-	net.leftTime = getActLeftTime(actStartTime)
+function fontBaseNet(net, human, actEndTime, lvdefine)
+	net.leftTime = getActLeftTime(actEndTime)
 	net.lv = getLv(human)
 	net.jifen = getJifen(human)
 	net.maxJifen = lvdefine.needJifen
@@ -649,10 +653,10 @@ function sendTaskQuery(human, mainType)
 	checkDB(human, actStartTime,groupID)
 	local list = getTaskIDList(mainType)
 	local msgRet = Msg.gc.GC_HERO_GROWUP_TASK_QUERY
-    msgRet.endTime = os.time(actEndTime) 
-    msgRet.startTime = os.time(actStartTime) 
-    msgRet.leftTime =  os.time(actEndTime) - os.time()
-	fontBaseNet(msgRet.data, human, actStartTime, lvdefine)
+    msgRet.endTime = actEndTime
+    msgRet.startTime = actStartTime
+    msgRet.leftTime =  actEndTime - os.time()
+	fontBaseNet(msgRet.data, human, actEndTime, lvdefine)
     msgRet.data.hasTaskRed = isTaskRed(human) and 1 or 0
 	msgRet.mainType = mainType
 	msgRet.taskLeftTime = leftTime

+ 3 - 0
script/module/bag/Grid.lua

@@ -39,8 +39,11 @@ function makeItem(net, itemID, itemCnt, shuijingAttrID, itemGrid, itemIndex, opF
 	net.isShow = itemConfig and itemConfig.isShow or 0
     net.effects = itemConfig and itemConfig.effects or 0
 	net.opflag = opFlag or getOpflag(itemConfig) or 0
+	net.suipian = net.suipian or {}
 	net.suipian[0] = 0
+	net.equip = net.equip or {}
     net.equip[0] = 0
+	net.fuwen = net.fuwen or {}
     net.fuwen[0] = 0    
     if not itemConfig then return end