SCFC 1 год назад
Родитель
Сommit
07b18c3317

+ 9 - 0
script/core/ObjHuman.lua

@@ -622,6 +622,15 @@ function sendHumanInfo(human)
 		WarOrder.getWarOrderInfo(human,i,mm.warOrder[i] )
 	end
 
+	mm.nSpeed[0] = 3
+	mm.nSpeed[1] = 0
+	mm.nSpeed[2] = 0
+	mm.nSpeed[3] = 0
+	if human.db.nSpeed then
+		mm.nSpeed[1] = human.db.nSpeed[1] and human.db.nSpeed[1] or 0
+		mm.nSpeed[2] = human.db.nSpeed[2] and human.db.nSpeed[2] or 0
+		mm.nSpeed[3] = human.db.nSpeed[3] and human.db.nSpeed[3] or 0
+	end
 	Msg.send(mm, human.fd)
 end
 

+ 19 - 16
script/module/present/FirstChargeLogic.lua

@@ -28,8 +28,10 @@ STATE_CAT_GET = 1       -- 可领
 STATE_HAD_GET = 2       -- 已领
 
 function isOpenByType(human,giftType)
+    -- 老首充只有数据才显示true了
     if not human.db.firstCharge or not human.db.firstCharge[giftType] then 
-        return true
+        --return true
+        return
     end
 
     for id,config in ipairs(PresentExcel.firstCharge) do
@@ -210,21 +212,22 @@ end
 
 -- 充值回调
 function onCharge(human)
-    local needList = getNeedList()
-    local isChange = nil
-    for ftype, need in pairs(needList) do
-        if (human.db.topupAcount or 0) >= need and
-            activateFirstCharge(human, ftype) then
-            isChange = true
-            sendQuery(human, ftype) 
-        end
-    end
-    if isChange then
-        for k, v in pairs(funcID) do
-            YunYingLogic.updateIcon(YYInfo[k], human)
-            break
-        end
-    end
+    return
+    -- local needList = getNeedList()
+    -- local isChange = nil
+    -- for ftype, need in pairs(needList) do
+    --     if (human.db.topupAcount or 0) >= need and
+    --         activateFirstCharge(human, ftype) then
+    --         isChange = true
+    --         sendQuery(human, ftype) 
+    --     end
+    -- end
+    -- if isChange then
+    --     for k, v in pairs(funcID) do
+    --         YunYingLogic.updateIcon(YYInfo[k], human)
+    --         break
+    --     end
+    -- end
 end
 
 function updateDaily(human)

+ 10 - 0
script/module/present/Handler.lua

@@ -34,6 +34,7 @@ local DailyLibaoLogic = require("present.DailyLibaoLogic")
 local RichangLibaoLogic = require("present.RichangLibaoLogic")
 local OpenServerActPowerUp = require("present.OpenServerActPowerUp")
 local OnlineAwardLogic = require("present.OnlineAwardLogic")
+local NewFirstCharge = require("present.NewFirstChargeLogic")
 
 -- 充值-特权商店
 function CG_TEQUANSHOP_QUERY(human)
@@ -357,4 +358,13 @@ end
 --领奖
 function CG_ONLINEAWARD_CLAIM(human, msg)
     OnlineAwardLogic.ClaimAward(human)
+end
+
+----- 新首充
+function CG_NEW_FIRST_CHARGE_QUERY(human, msg)
+    NewFirstCharge.NewFirstCharge_Query(human, msg.nType)
+end
+
+function CG_NEW_FIRST_CHARGE_GET(human, msg)
+    NewFirstCharge.NewFirstCharge_Get(human, msg.nType)
 end

+ 445 - 0
script/module/present/NewFirstChargeLogic.lua

@@ -0,0 +1,445 @@
+-----------------------------------------------------------------
+-- 文件名       :  NewFirstChargeLogic.lua
+-- 文件说明     :  新首充
+-- 创建时间     :   2025/1/22
+-- 创建人       :   FC
+-----------------------------------------------------------
+
+local Msg = require("core.Msg")
+local Util = require("common.Util")
+local PresentExcel = require("excel.present")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local Broadcast = require("broadcast.Broadcast")
+local PanelDefine = require("broadcast.PanelDefine")
+local ChatPaoMaLogic = require("chat.ChatPaoMaLogic")
+local YunYingLogic = require("yunying.YunYingLogic")
+local SceneHandler = require("scene.Handler")
+local ObjHuman = require("core.ObjHuman")
+local BuyLogic = require("topup.BuyLogic")
+
+local NEWFIRST_CHARGE_TYPE1 = 1         -- 1元
+local NEWFIRST_CHARGE_TYPE2 = 2         -- 8元
+local NEWFIRST_CHARGE_TYPE3 = 3         -- 18元
+
+local tMoneyToType = 
+{
+    [1] = NEWFIRST_CHARGE_TYPE1,
+    [8] = NEWFIRST_CHARGE_TYPE2,
+    [18] = NEWFIRST_CHARGE_TYPE3,
+}
+
+local tBuyID2Speed = 
+{
+    [1] = 1,
+    [8] = 2,
+    [18] = 3,
+}
+
+local NEWFIRST_DAY = 3          -- 奖励天数,策划也没配置,直接写死吧
+local OPENNEWLV = 9             -- 等级9开
+
+-- 状态
+NEWFIRST_STATE_CANT_GET = 0      -- 不可领
+NEWFIRST_STATE_CAT_GET = 1       -- 可领
+NEWFIRST_STATE_HAD_GET = 2       -- 已领
+
+local tNewFirstChargeCof = nil      -- 配置 Key = nBuyID
+local tPrizeDataByTypeDay = nil     -- 具体奖励配置 [nType] = {[nDay] = v}
+
+local function getNeedList()
+    if not tNewFirstChargeCof then
+        tNewFirstChargeCof = {}
+
+        for nID, tPrize in pairs(PresentExcel.newfirstcharge) do
+            if type(tPrize) == "table" then
+                --table.print_lua_table(tPrize)
+                local nBuyID = tPrize.nBuyID
+                tNewFirstChargeCof[nBuyID] = tPrize
+                if tMoneyToType[tPrize.nMoney] then
+                    tNewFirstChargeCof[nBuyID].nType = tMoneyToType[tPrize.nMoney]
+                else
+                    print("[getNeedList] 配置了不正确的金额 nMoney = "..tPrize.nMoney.." nID = "..nID)
+                end
+            else
+                print("[getNeedList] tType = \n"..type(tPrize))
+            end
+        end
+    end
+
+    if not tPrizeDataByTypeDay then
+        tPrizeDataByTypeDay = {}
+
+        for nID, tPrize in pairs(tNewFirstChargeCof) do
+            local nType = tPrize.nType
+            tPrizeDataByTypeDay[nType] = {}
+            for i = 1, NEWFIRST_DAY, 1 do
+                local tItem = i == 1 and tPrize.tPrize1 or ( i == 2 and tPrize.tPrize2 or tPrize.tPrize3)
+                tPrizeDataByTypeDay[nType][i] = tItem
+            end
+        end
+    end
+
+    return tNewFirstChargeCof, tPrizeDataByTypeDay
+end
+
+-- 初始化对应类型的DB类型数据
+local function NewFirstCharge_InitDBByType(human, nType)
+    if not human.db.newFirstCharge then
+        human.db.newFirstCharge = {}
+    end
+
+    human.db.newFirstCharge[nType] = 
+    {
+        nBuyTime = 0,
+        nSatus = NEWFIRST_STATE_CANT_GET,
+        tDayStatus = {},
+    }
+
+    for i = 1, NEWFIRST_DAY, 1 do
+        human.db.newFirstCharge[nType].tDayStatus[i] = NEWFIRST_STATE_CANT_GET
+    end
+end
+
+-- 创建DB数据
+local function NewFirstCharge_CreateDB(human)
+    if not human then
+        return
+    end
+
+    if not human.db.newFirstCharge then
+        human.db.newFirstCharge = {}
+    end
+
+    for i = NEWFIRST_CHARGE_TYPE1, NEWFIRST_CHARGE_TYPE3, 1 do
+        if not human.db.newFirstCharge[i] then
+            NewFirstCharge_InitDBByType(human, i)
+        end
+    end
+
+    table.print_lua_table(human.db.newFirstCharge)
+    print("[NewFirstCharge_CreateDB] \n")
+end
+
+-- 设置对应天数领取了奖励
+local function NewFirstCharge_SetPrizeStauts(human, nType, nDay, nValue)
+    if not human.db.newFirstCharge or not human.db.newFirstCharge[nType] then
+        return
+    end
+
+    human.db.newFirstCharge[nType].tDayStatus[nDay] = nValue
+end
+
+-- 获取对应类型对应天数奖励状态
+local function NewFirstCharge_GetPrizeStauts(human, nType, nDay)
+    if not human.db.newFirstCharge or not human.db.newFirstCharge[nType] then
+        return NEWFIRST_STATE_CANT_GET
+    end
+
+    table.print_lua_table(human.db.newFirstCharge[nType])
+    print("\n")
+    return human.db.newFirstCharge[nType].tDayStatus[nDay]
+end
+
+-- 设置购买状态
+local function NewFirstCharge_SetBuyStatus(human, nType)
+    if not human.db.newFirstCharge then
+        NewFirstCharge_InitDBByType(human, nType)
+    end
+
+    human.db.newFirstCharge[nType].nBuyTime = os.time()
+    human.db.newFirstCharge[nType].nSatus = NEWFIRST_STATE_HAD_GET
+    NewFirstCharge_SetPrizeStauts(human, nType, 1, NEWFIRST_STATE_CAT_GET)
+end
+
+-- 获取购买状态
+local function NewFirstCharge_GetBuyStatus(human, nType)
+    if not human.db.newFirstCharge then
+        NewFirstCharge_InitDBByType(human, nType)
+    end
+
+    return human.db.newFirstCharge[nType].nSatus
+end
+
+-- 设置时间
+local function NewFirstCharge_SetTime(human, nType, nTime)
+    if not human.db.newFirstCharge then
+        NewFirstCharge_InitDBByType(human, nType)
+    end
+
+    human.db.newFirstCharge[nType].nBuyTime = nTime
+end
+
+-- 获取时间
+local function NewFirstCharge_GetTime(human, nType)
+    if not human.db.newFirstCharge then
+        NewFirstCharge_InitDBByType(human, nType)
+    end
+
+    return human.db.newFirstCharge[nType].nBuyTime
+end
+
+local function isOpenByType(human,giftType)
+    if not human.db.newFirstCharge or not human.db.newFirstCharge[giftType] then 
+        return true
+    end
+
+    -- 未购买,显示
+    if NEWFIRST_STATE_CANT_GET == human.db.newFirstCharge[giftType].nSatus then
+        return true
+    end
+
+    -- 购买了
+    for nDay = 1, NEWFIRST_DAY, 1 do
+       local nDayStatus = NewFirstCharge_GetPrizeStauts(human, giftType, nDay)
+
+       -- 只要没领取,都是开启的
+       if NEWFIRST_STATE_HAD_GET ~= nDayStatus then
+            return true
+       end
+    end
+
+    return false
+end
+
+-- 根据类型判断是否有红点
+local function isRedByType(human, giftType)
+    if not human.db.newFirstCharge or not human.db.newFirstCharge[giftType] then 
+        return false
+    end
+
+    -- 未购买
+    if NEWFIRST_STATE_CANT_GET == human.db.newFirstCharge[giftType].nSatus then
+        return false
+    end
+
+    for i = 1, NEWFIRST_DAY,  1  do
+        local nDayStatus = NewFirstCharge_GetPrizeStauts(human, giftType, i)
+        if NEWFIRST_STATE_CAT_GET == nDayStatus then
+            return true
+        end
+    end
+
+    return false
+end
+
+function isOpen(human,YYInfo,funcConfig)
+	if not SceneHandler.canCharge(human) then
+        print("[NewFirstCharge- isOpen] 不能充值返回")
+		return false
+	end
+
+    if OPENNEWLV > human.db.lv  then
+        print("[NewFirstCharge- isOpen] 等级不足 不够 lv = "..human.db.lv)
+        return false
+    end
+
+    for i = NEWFIRST_CHARGE_TYPE1, NEWFIRST_CHARGE_TYPE3, 1 do
+        if true == isOpenByType(human,i) then
+            print("[NewFirstCharge- isOpen] 满足条件 ")
+            return true
+        end
+    end
+   
+    print("[NewFirstCharge- isOpen] 不满足条件 ")
+    return false
+end
+
+function isRed(human,YYInfo,funcConfig)
+    for i = NEWFIRST_CHARGE_TYPE1, NEWFIRST_CHARGE_TYPE3, 1 do
+        if true == isRedByType(human,i) then
+           return true
+        end
+    end
+
+    return false
+end
+
+function NewFirstCharge_Query(human, nType)
+    local tAllConf, tItemConfByType = getNeedList()
+    local tTypeConf = nil
+    for _, v in pairs(tAllConf) do
+        if v.nType == nType then
+            tTypeConf = v
+            break
+        end
+    end
+
+    if not tTypeConf then
+        print("[NewFirstCharge_Query] 不存在对应类型的配置 nType = "..nType)
+        return
+    end
+
+    if not human.db.newFirstCharge then
+        NewFirstCharge_CreateDB(human)
+    end
+
+    local tMsgData = Msg.gc.GC_NEW_FIRST_CHARGE_QUERY
+    tMsgData.nType = nType
+    tMsgData.nState = NewFirstCharge_GetBuyStatus(human, nType)
+    print("[NewFirstCharge_Query] 购买状态 nSatus = "..tMsgData.nState)
+    tMsgData.nMoney = tTypeConf.nMoney
+
+    tMsgData.tRed[0] = NEWFIRST_CHARGE_TYPE3
+    for i = NEWFIRST_CHARGE_TYPE1, NEWFIRST_CHARGE_TYPE3, 1 do
+        tMsgData.tRed[i] = 0
+        if true == isRedByType(human, i) then
+            tMsgData.tRed[i] = 1
+        end
+    end
+    
+    BuyLogic.fontBuyItem(human, tMsgData.buyItem, tTypeConf.nBuyID)
+
+    tMsgData.list[0] = 0
+    for i = 1, NEWFIRST_DAY, 1 do
+        tMsgData.list[0] = tMsgData.list[0] + 1
+        local tNodeData =  tMsgData.list[tMsgData.list[0]]
+        tNodeData.nState = NewFirstCharge_GetPrizeStauts(human, nType, i)
+        print("[NewFirstCharge_Query] 奖励天数状态 nSatus = "..tNodeData.nState.." i = "..i)
+
+        tNodeData.nDay = i
+        tNodeData.item[0] = 0
+
+        local tItemConf = tItemConfByType[nType][i]
+
+        if not tItemConf then
+            print("[NewFirstCharge_Query] 居然不存在对应的奖励配置")
+        else
+            for _, v in ipairs(tItemConf) do
+                tNodeData.item[0] = tNodeData.item[0] + 1
+
+                Grid.makeItem(tNodeData.item[tNodeData.item[0]], v[1], v[2])
+                if v[3] then
+                    tNodeData.item[tNodeData.item[0]].rare = v[3]
+                end
+            end
+        end
+    end
+
+    Msg.send(tMsgData, human.fd)
+    print("[NewFirstCharge_Query] 发送数据成功\n")
+    if human.db.nSpeed and _G.next(human.db.nSpeed) then
+        table.print_lua_table(human.db.nSpeed)
+    end
+end
+
+function NewFirstCharge_Get(human, nType)
+    local tAllConf, tItemConfByType = getNeedList()
+    local tTypeConf = nil
+    for _, v in pairs(tAllConf) do
+        if v.nType == nType then
+            tTypeConf = v
+            break
+        end
+    end
+
+    if not tTypeConf or not tItemConfByType[nType] then
+        print("[NewFirstCharge_Get] 不存在对应类型的配置 nType = "..nType)
+        return
+    end
+
+    local nMoney = tTypeConf.nMoney
+
+    local bChange = false
+    local tItems = {}
+    for nDay, value in pairs(tItemConfByType[nType]) do
+        local nStatus = NewFirstCharge_GetPrizeStauts(human, nType, nDay)
+        if NEWFIRST_STATE_CAT_GET == nStatus then
+            for _, v in pairs(value) do
+                table.insert(tItems, v)
+            end
+
+            if nDay == 1 then
+                bChange = true
+                local nIndex = tBuyID2Speed[nMoney]
+                if not human.db.nSpeed then
+                    human.db.nSpeed = {}
+                end
+                human.db.nSpeed[nIndex] = 1
+            end
+
+            NewFirstCharge_SetPrizeStauts(human, nType, nDay, NEWFIRST_STATE_HAD_GET)
+        end
+    end
+
+    if nil ~= _G.next(tItems) then
+        BagLogic.addItemList(human, tItems, "shouchong")
+
+       for k, v in pairs(funcID) do
+          YunYingLogic.updateIcon(YYInfo[k], human)
+          YunYingLogic.sendGroupUpdate(YYInfo[k], human, PanelDefine.PANEL_ID_3302)
+          break
+       end
+
+       NewFirstCharge_Query(human, nType)
+
+       if true == bChange then
+            ObjHuman.sendHumanInfo(human)
+       end
+    end
+end
+
+-- 充值回调
+function onCharge(human, nBuyID)
+    print("[NewFirstChargeLogic-onCharge] nBuyID = "..nBuyID)
+    local tConfByBuyid = getNeedList()
+    local isChange = false
+    if tConfByBuyid[nBuyID] then
+        print("[onCharge] nType = ".. tConfByBuyid[nBuyID].nType.." nBuyID = "..nBuyID)
+        NewFirstCharge_SetBuyStatus(human, tConfByBuyid[nBuyID].nType)
+        isChange = true
+    else
+        print("[NewFirstChargeLogic-onCharge] 不存在对应的礼包id nBuyID = "..nBuyID)
+        return
+    end
+
+    if isChange then
+        for k, v in pairs(funcID) do
+            print("[NewFirstChargeLogic - onCharge], k = "..k)
+            YunYingLogic.updateIcon(YYInfo[k], human)
+            break
+        end
+    end
+end
+
+function updateDaily(human, funcID)
+    if human.db.newFirstCharge then
+        local nNowTime = os.time()
+        for i = NEWFIRST_CHARGE_TYPE1, NEWFIRST_CHARGE_TYPE3, 1 do
+            local nBuyStatus = NewFirstCharge_GetBuyStatus(human, i)
+            local nLastTime = NewFirstCharge_GetTime(human, i)
+            local bIsDay = Util.isSameDayByTimes(nNowTime, nLastTime)
+            
+            -- 遍历该类型全部天数
+            if NEWFIRST_STATE_HAD_GET == nBuyStatus and true ~= bIsDay then
+                for nDay = 1, NEWFIRST_DAY, 1 do
+                    local nDayStatus = NewFirstCharge_GetPrizeStauts(human, i, nDay)
+                    -- 当天奖励未领取
+                    if NEWFIRST_STATE_CANT_GET == nDayStatus then
+                        NewFirstCharge_SetPrizeStauts(human, i, nDay, NEWFIRST_STATE_CAT_GET)
+                        NewFirstCharge_SetTime(human, i, nNowTime)
+                        print("[NewFirstChargeLogic - updateDaily] 隔天刷新 奖励 nType = "..i.." nDay = "..nDay)
+                        break
+                    end
+                end
+            end
+        end
+    end
+end
+
+
+-- 是否已激活首充
+function isActive(human, YYInfo, funcConfig)
+    return not isOpen(human, YYInfo, funcConfig)
+end
+
+-- 玩家整点
+function onZero(human, funcID)
+    updateDaily(human, funcID)
+end
+
+-- GM 命令
+function NewFirstCharge_GMClear(human)
+    human.db.newFirstCharge = nil
+    print("[NewFirstCharge_GMClear] 清空完成")
+end

+ 31 - 0
script/module/present/Proto.lua

@@ -967,3 +967,34 @@ GC_ONLINEAWARD_QUERY = {
 --领取
 CG_ONLINEAWARD_CLAIM = {
 }
+
+--------------------------------------------- 新首充
+NewFirstChargePrize = 
+{
+    {"nDay",        1,          "int"},
+    {"nState",      1,          "int"},     -- 0  不可领, 1可领, 2 已领
+    {"item",        5,          ItemData},
+}
+
+-- 请求礼包信息
+CG_NEW_FIRST_CHARGE_QUERY = 
+{
+    {"nType",       1,      "int"},             -- 请求类型(1:一元,2:8元,3:18元)
+}
+
+-- 请求礼包信息-回包
+GC_NEW_FIRST_CHARGE_QUERY = 
+{
+    {"nType",       1,      "int"}, 
+    {"nState",      1,      "byte"},            -- 是否购买(0 未购买,2 已购买)
+    {"nMoney",      1,      "int"},
+    {"buyItem",     1,      BuyItem},           -- 购买信息  
+    {"list",        4,      NewFirstChargePrize},
+    {"tRed",        4,      "int"},             -- 红点
+}
+
+-- 请求领取礼包
+CG_NEW_FIRST_CHARGE_GET = 
+{
+    {"nType",       1,      "int"},             -- 请求类型(1:一元,2:8元,3:18元)
+}

+ 115 - 114
script/module/scene/Proto.lua

@@ -1,115 +1,116 @@
-local RoleBase = require("role.Proto").RoleBase 
-
-
-WarOrder = {
-	{"type", 1,"int"},          -- 1 勇士之证 2 恶魔之证 3 工会之证明 4 竞技之证
-	{"exp",1,"int"},            -- 战令经验
-	{"finish",64,"int"},        -- 战令已经领取idx
-	{"unlock",1,"int"},         -- 战令是否RMB解锁
-	{"upgradeFinish",64,"int"}, -- 高级战令已经领取idx
-	{"isRed",1,"int"},          -- 是否有红点 0表示没有1表示有
-}
-
-CG_AA_DISCONNECT = {
-	{"reason",		1,		"int"},
-	{"realReason",	1,		"int"},
-}
-
-GC_DISCONNECT = {
-	{"code",		1,		"int"},
-	{"msg",			1,		"string"},
-}
-
-CG_ASK_LOGIN = {
-	{"account",		1,		"string"},
-	{"timestamp",	1,		"int"},		 --登录时间戳
-	{"authkey",		1,		"string"},	 --登录校验key
-	{"lang",		1,		"string"},	 --多语言-语言包
-	{"region",		1,		"string"},	 --多语言-区域
-	{"ip",			1,		"string"},	 --登陆ip
-	{"params",		1,		"string"},	 --平台信息
-}
-
-CG_TEST_PROTO = {
-	{"account",		1,		"string"},     -- 玩家uid
-	{"param",       1,      "string",512}  --参数json
-}
-
-CG_ASK_DISCONNECT = {
-}
-
-GC_ZZ_HUMAN_INFO = {
-    {"roleBase",        1,  RoleBase},
-	{"identity",	    1, "string"},
-	{"bannerID",		1, "byte"},
-	{"unionName",		1, "string"},
-	{"unionIdentity",	1, "string"},
-	{"unionFrame",		1, "int"},
-	{"vipLv",			1, "byte"},
-    {"animation",       1,  "int"},     -- 立绘
-    {"background",      1,  "int"},     -- 背景
-	{"debug",			1, "byte"},		-- 是否开发模式
-    {"worldLv",			1, "short"},	-- 世界等级
-    {"openDay",			1, "short"},	-- 开服天数
-	{"guideState",      1, "byte"},
-	{"warOrder" ,       4, WarOrder},         -- 战令信息
-}
-GC_ENTER_CITY = {}
-
-CG_HEART_BEAT = {}
-GC_HEART_BEAT = {
-	{"timeStamp",	    1, "int"},		-- 服务器时间戳
-}
-
-CG_PHONE_FPS = {
-    {"fpsType",         1,   "string" },
-    {"startFps",        1,   "int" },
-    {"endFps",          1,   "int" },
-}
-
-
-CG_HEART_BEAT_M = {
-}
-
-GC_NOTICE_DADIAN = {
-	{"type",	1,	"short"},-- 1支付成功 2第n天登录
-	{"param",	1,	"int"},
-	{"param2",	1,	"int"}, -- 如果type是支付则是buyid 否则是0
-}
-
--- 客户端上报出错
-CG_CLIENT_ERROR = {
-	{"err",			1,		"string"},
-}
-
--- 客户端上报资源加载出错
-CG_CLIENT_LOAD_ERROR = {
-	{"err",			1,		"string"},
-}
-
-LevelUpData = {
-	{"oldLv",		1,		"int"},
-	{"newLv",		1,		"int"},
-	{"items",		4, 		require("bag.Proto").ItemData},
-	{"dialog",	    1, 		"short"}, -- 预告内容
-	{"dialogName",	1,		"string"},
-	{"content",	    1, 		"string"},
-	{"noticeLv",	1, 		"short"},
-    {"panelId",	    1, 		"int"},
-}
-
-GC_LEVEL_UP = {
-    {"data",		1,		LevelUpData},
-}
-
-
-LevelGuideData = {
-    {"id",		    1,		"int"},
-	{"noticeLv",	1, 		"short"},
-    {"panelId",	    1, 		"int"},
-    {"status",      1,      "byte"},
-    {"guideList",   20,     "short"},
-}
-GC_LEVEL_GUIDE = {
-	{"data",		20,		LevelGuideData},
+local RoleBase = require("role.Proto").RoleBase 
+
+
+WarOrder = {
+	{"type", 1,"int"},          -- 1 勇士之证 2 恶魔之证 3 工会之证明 4 竞技之证
+	{"exp",1,"int"},            -- 战令经验
+	{"finish",64,"int"},        -- 战令已经领取idx
+	{"unlock",1,"int"},         -- 战令是否RMB解锁
+	{"upgradeFinish",64,"int"}, -- 高级战令已经领取idx
+	{"isRed",1,"int"},          -- 是否有红点 0表示没有1表示有
+}
+
+CG_AA_DISCONNECT = {
+	{"reason",		1,		"int"},
+	{"realReason",	1,		"int"},
+}
+
+GC_DISCONNECT = {
+	{"code",		1,		"int"},
+	{"msg",			1,		"string"},
+}
+
+CG_ASK_LOGIN = {
+	{"account",		1,		"string"},
+	{"timestamp",	1,		"int"},		 --登录时间戳
+	{"authkey",		1,		"string"},	 --登录校验key
+	{"lang",		1,		"string"},	 --多语言-语言包
+	{"region",		1,		"string"},	 --多语言-区域
+	{"ip",			1,		"string"},	 --登陆ip
+	{"params",		1,		"string"},	 --平台信息
+}
+
+CG_TEST_PROTO = {
+	{"account",		1,		"string"},     -- 玩家uid
+	{"param",       1,      "string",512}  --参数json
+}
+
+CG_ASK_DISCONNECT = {
+}
+
+GC_ZZ_HUMAN_INFO = {
+    {"roleBase",        1,  RoleBase},
+	{"identity",	    1, "string"},
+	{"bannerID",		1, "byte"},
+	{"unionName",		1, "string"},
+	{"unionIdentity",	1, "string"},
+	{"unionFrame",		1, "int"},
+	{"vipLv",			1, "byte"},
+    {"animation",       1,  "int"},     -- 立绘
+    {"background",      1,  "int"},     -- 背景
+	{"debug",			1, "byte"},		-- 是否开发模式
+    {"worldLv",			1, "short"},	-- 世界等级
+    {"openDay",			1, "short"},	-- 开服天数
+	{"guideState",      1, "byte"},
+	{"warOrder" ,       4, WarOrder},         -- 战令信息
+	{"nSpeed",			5,	"short"},		-- 速度
+}
+GC_ENTER_CITY = {}
+
+CG_HEART_BEAT = {}
+GC_HEART_BEAT = {
+	{"timeStamp",	    1, "int"},		-- 服务器时间戳
+}
+
+CG_PHONE_FPS = {
+    {"fpsType",         1,   "string" },
+    {"startFps",        1,   "int" },
+    {"endFps",          1,   "int" },
+}
+
+
+CG_HEART_BEAT_M = {
+}
+
+GC_NOTICE_DADIAN = {
+	{"type",	1,	"short"},-- 1支付成功 2第n天登录
+	{"param",	1,	"int"},
+	{"param2",	1,	"int"}, -- 如果type是支付则是buyid 否则是0
+}
+
+-- 客户端上报出错
+CG_CLIENT_ERROR = {
+	{"err",			1,		"string"},
+}
+
+-- 客户端上报资源加载出错
+CG_CLIENT_LOAD_ERROR = {
+	{"err",			1,		"string"},
+}
+
+LevelUpData = {
+	{"oldLv",		1,		"int"},
+	{"newLv",		1,		"int"},
+	{"items",		4, 		require("bag.Proto").ItemData},
+	{"dialog",	    1, 		"short"}, -- 预告内容
+	{"dialogName",	1,		"string"},
+	{"content",	    1, 		"string"},
+	{"noticeLv",	1, 		"short"},
+    {"panelId",	    1, 		"int"},
+}
+
+GC_LEVEL_UP = {
+    {"data",		1,		LevelUpData},
+}
+
+
+LevelGuideData = {
+    {"id",		    1,		"int"},
+	{"noticeLv",	1, 		"short"},
+    {"panelId",	    1, 		"int"},
+    {"status",      1,      "byte"},
+    {"guideList",   20,     "short"},
+}
+GC_LEVEL_GUIDE = {
+	{"data",		20,		LevelGuideData},
 }

+ 7 - 0
script/module/topup/BuyLogic.lua

@@ -41,6 +41,7 @@ local WarOrderLogic = require("shop.WarOrder")
 local GiftExcel = require("excel.buy").gift
 local GiftLogic = require("topup.GiftLogic")
 local HeroSkinLogic = require("present.HeroSkinLogic")
+local NewFirstCharge = require("present.NewFirstChargeLogic")
 
 BUY_CODE_NORMAL = 0   -- 正常调平台的充值接口
 BUY_CODE_WX_KEFU = 1  -- 微信小程序客服充值接口
@@ -243,6 +244,12 @@ function cmd.heroSkin(human,buyConf)
 	return HeroSkinLogic.buy(human,buyId)
 end
 
+function cmd.newfirstcharge(human, buyConf, isFirst, buyCnt)
+	local nBuyID = buyConf.id
+	print("[cmd.newfirstcharge] nBuyID = "..nBuyID)
+	NewFirstCharge.onCharge(human, nBuyID)
+end
+
 -------------------------------- cmd结束 ----------------------------------
 
 function checkBuy(human, ret)