Переглянути джерело

1.闯关主题增加提示功能 2.修改rolesystem模块协议长度

gitxsm 3 місяців тому
батько
коміт
bd99bc393a

+ 3 - 1
script/common/ProtoID.lua

@@ -1765,4 +1765,6 @@ _ENV[1804]="GC_BREATHROUGHTHEME_BREAKTHROUGHREWARD_QUERY"
 _ENV[1805]="CG_BREATHROUGHTHEME_ADVANCEDREWARD_QUERY"
 _ENV[1806]="GC_BREATHROUGHTHEME_ADVANCEDREWARD_QUERY"
 _ENV[1807]="CG_BREATHROUGHTHEME_GET_REWARD"
-_ENV[1808]="GC_BREATHROUGHTHEME_REDDOT"
+_ENV[1808]="GC_BREATHROUGHTHEME_REDDOT"
+_ENV[1809]="CG_BREATHROUGHTHEME_SHOW_TIPS"
+_ENV[1810]="GC_BREATHROUGHTHEME_SHOW_TIPS"

+ 6 - 2
script/core/ObjHuman.lua

@@ -110,6 +110,8 @@ local BreakThroughTheme = require("battle.BreakThroughTheme")
 local Json = require("common.Json")
 
 local UnionLogic
+local GodsAreaNS
+local DataCache
 
 
 fds				= fds or {}				-- fd->obj_id,包括创角中+游戏中
@@ -454,6 +456,7 @@ function onLvUpCB(human, oldLv, newLv)
 	TuiSongLiBao.tuiSongLiBaoOnTask(human,TuiSongLiBao.TUISONGLIBAOTASK_LV, newLv, oldLv)
 	CombatPosLogic.onLvUp(human, oldLv, newLv)
 	ChengjiuLogic.onLvUp(human)
+	BreakThroughTheme.onLvUp(human)
 
 	-- 更新等级排名数据
     if BRoleLogic.updateData(BillboardDefine.TYPE_LV, human.db) then	
@@ -491,11 +494,11 @@ function onLvUpCB(human, oldLv, newLv)
 	TriggerLogic.PublishEvent(TriggerDefine.HUMAN_LV_UP, human.db._id, 1, newLv)
 	
 
-	local GodsAreaNS = require("godsArea.GodsAreaNS")
+	GodsAreaNS = GodsAreaNS or require("godsArea.GodsAreaNS")
 	GodsAreaNS.UpdateShowData(human, 2)
 
 
-	local DataCache = require("core.DataCache")
+	DataCache = DataCache or require("core.DataCache")
 	DataCache.Update_PlayerLv(human.db._id, human.db.lv)
 
 	commonOperate.LvChange(human, oldLv, newLv)
@@ -825,6 +828,7 @@ function onLogin(human, isNew)
 	commonOperate.onLogin(human)
 	AnotherWorldBattleNS.onLogin(human)
 	RoleStorageBox.onLogin(human)
+	BreakThroughTheme.onLogin(human)
 
     HeroLogLogic.finishTaskCB(human,HeroLogLogic.HERO_LOG_TYPE_1,1)
 	-- 红点 检测   需要放在通用的onLogin 后面  保持数据的正确性 再检测红点

+ 38 - 1
script/module/battle/BreakThroughTheme.lua

@@ -14,6 +14,7 @@
 
         isBuy = nil, -- 购买指定项后,值为true
         loginDays = nil, 购买指定项后才统计的登录天数
+        isShowTips = nil, 用来记录客户端是否弹出过提示, 弹出过后为true
     }
 ]=]--
 
@@ -30,6 +31,7 @@ local EliteDefine = require("battle.EliteDefine")
 local BuyLogic = require("topup.BuyLogic")
 local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
 local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
+local RoleSystemConfig = require("excel.roleSystem").roleSystem
 
 
 local LOGTYPE = "BreakThroughTheme"
@@ -61,6 +63,11 @@ local function addLoginDays(human)
     human.db.breakThroughData.loginDays = (human.db.breakThroughData.loginDays or 0) + 1
 end
 
+local function updateShowTipsState(human, state)
+    human.db.breakThroughData = human.db.breakThroughData or {}
+    human.db.breakThroughData.isShowTips = state
+end
+
 
 
 local function isBuy(human)
@@ -210,6 +217,23 @@ local function getAdvancedReward(human)
     entranceCloseCheck(human)
 end
 
+-- 通知客户端弹出提示
+local function showTips(human)
+    local systemCfg = RoleSystemConfig[RoleSystemDefine.ROLE_SYS_ID_112]
+    if human.db.lv < systemCfg.lv then
+        return
+    end
+
+    local breakThroughData = getData(human)
+    if breakThroughData and breakThroughData.isShowTips then
+        return
+    end
+
+    local msgRet = Msg.gc.GC_BREATHROUGHTHEME_SHOW_TIPS
+    msgRet.tipState = 1
+    Msg.send(msgRet, human.fd)
+end
+
 
 
 -- 外部调用, 是否显示入口, 领取完所有免费/付费奖励, 入口才关闭
@@ -273,6 +297,11 @@ function updateDaily(human)
     end
 end
 
+-- 外部调用, 登录
+function onLogin(human)
+    showTips(human)
+end
+
 -- 外部调用,充值
 function charge(human, nAllPrice, buyID)
     local var = BreakThroughThemeConfig.var[1]
@@ -306,7 +335,10 @@ function StageUpdate(human)
     redDotUpdate(human)
 end
 
-
+-- 外部调用,升级
+function onLvUp(human)
+    showTips(human)
+end
 
 
 -- 闯关阵容查询
@@ -422,4 +454,9 @@ function BreakThrough_GetReward(human, rewardType)
     elseif rewardType == 2 then
         getAdvancedReward(human)
     end
+end
+
+-- 客户端通知服务器已经弹出过提示了
+function BreakThrough_UpdateShowTipsState(human)
+    updateShowTipsState(human, true)
 end

+ 3 - 0
script/module/battle/Handler.lua

@@ -143,3 +143,6 @@ function CG_BREATHROUGHTHEME_GET_REWARD(human,msg)
     BreakThroughTheme.BreakThrough_GetReward(human, msg.rewardType)
 end
 
+function CG_BREATHROUGHTHEME_SHOW_TIPS(human,msg)
+    BreakThroughTheme.BreakThrough_UpdateShowTipsState(human, msg.rewardType)
+end

+ 6 - 0
script/module/battle/Proto.lua

@@ -465,4 +465,10 @@ CG_BREATHROUGHTHEME_GET_REWARD = {
 GC_BREATHROUGHTHEME_REDDOT = {
 	{"page1RedDotState",     		1,      "byte"},           -- 闯关奖励标签红点状态, 0-不显示红点, 1-显示红点
 	{"page2RedDotState",     		1,      "byte"},           -- 进阶奖励标签红点状态, 0-不显示红点, 1-显示红点
+}
+
+-- 弹提示
+CG_BREATHROUGHTHEME_SHOW_TIPS = {}
+GC_BREATHROUGHTHEME_SHOW_TIPS = {
+	{"tipState",     		1,      "byte"},           -- 1-服务器通知客户端弹出提示
 }

+ 1 - 1
script/module/roleSystem/Proto.lua

@@ -23,7 +23,7 @@ CG_ROLESYSTEM_QUERY = {
 }
 
 GC_ROLESYSTEM_QUERY = {
-	{"list",		100,		RoleSystemNet},	
+	{"list",		110,		RoleSystemNet},	
 }
 
 CG_ROLESYSTEM_TOUCH = {