Quellcode durchsuchen

代金券和跨服分享英雄信息

SCFC vor 1 Jahr
Ursprung
Commit
32b4e7dd1b

+ 25 - 0
script/common/CommonDB.lua

@@ -8,6 +8,7 @@ local OpenAct = require("present.OpenAct")
 
 local DBUpdate = {_id=nil}								-- 更新	
 local DBUpdateField = {}								-- 更新域
+local nVoucherInflateLen = 20							-- 代金券记录信息长度
 
 KEY_SERVER_START_TIME = "serverStartTime"				-- 开服时间
 KEY_IDENTITY_MAX = "identityMax"						-- 自增的最大的数字 从1开始
@@ -34,6 +35,7 @@ KEY_CIYUAN_MOZHU = "ciyuanMoZhu"                        -- 次元魔蛛
 KEY_YJ_TIME = "yjTreasureTime"                          -- 遗迹探险时间
 KEY_CDK_BATCH = "cdkBatchIdx"                           -- CDK批次序号
 KEY_WEEKLOOP_CARD_BATCH = "weekLoopCardBatch"			-- 周活动-抽卡批次
+KEY_VOUCHER_INFLATE = "tVoucherInflateInfo"				-- 代金券膨胀信息
 kEY_RECOMMENDLINEUP = "recommendlineup"					-- 推荐阵容
 
 db = db or {
@@ -57,6 +59,7 @@ db = db or {
     yjTreasureTime = nil,                               -- 遗迹探险时间
 	cdkBatchIdx = nil,									-- CDK批次序号
 	weekLoopCardBatch = nil,							-- 周活动-抽卡批次
+	tVoucherInflateInfo = {},							-- 代金券膨胀信息
 	recommendlineup = {},								-- 推荐阵容
 }
 
@@ -365,6 +368,28 @@ function setWeekCardBatch(nValue)
 	updateValue(KEY_WEEKLOOP_CARD_BATCH, nValue)
 end
 
+function getVoucherInflate()
+	return db.tVoucherInflateInfo
+end
+
+function setVoucherInflate(szText, nTime)
+	if not szText or 0 >= nTime then
+		return
+	end
+	
+	local nNowLen =  #db.tVoucherInflateInfo
+	if nNowLen >= nVoucherInflateLen then
+		local nDelLen = nNowLen - nVoucherInflateLen + 1
+		for i = nDelLen, 1, -1 do
+			table.remove(db.tVoucherInflateInfo, i)
+		end
+	end
+
+	table.insert(db.tVoucherInflateInfo, {szText = szText, nTime = nTime})
+
+	updateValue(KEY_VOUCHER_INFLATE, db.tVoucherInflateInfo)
+end
+
 -- 获取阵容数据
 function getRecommendLineUp()
 	return db.recommendlineup

+ 23 - 0
script/common/InnerHandler.lua

@@ -17,6 +17,7 @@ local YunYingLogic = require("yunying.YunYingLogic")
 local MoZhuLogic = require("mozhu.MoZhuLogic")
 local MoZhuMiddleLogic = require("mozhu.MoZhuMiddleLogic")
 local ChatLogic = require("chat.ChatLogic")
+local HeroMiddleLogic = require("hero.HeroMiddleLogic")
 
 function LW_HELLO(fd, msg)
 	if _G.is_middle ~= true then return end
@@ -74,4 +75,26 @@ end
 
 function WL_MIDDLE_CHAT(fd, msg)
     ChatLogic.WL_MIDDLE_CHAT(fd, msg)
+end
+
+-- 聊天查看分享英雄数据(请求的服务器->中心)
+function LW_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
+    if _G.is_middle ~= true then return end
+    MiddleConnect.LW_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
+end
+
+-- 发送到对应服务器信息(中心->目标服务器)
+function WL_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
+    HeroMiddleLogic.HeroMiddleLogic_QueryHeroData_WL(fd, msg)
+end
+
+-- 英雄信息回复(目标->中心)
+function LW_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
+    if _G.is_middle ~= true then return end
+    MiddleConnect.LW_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
+end
+
+-- 英雄信息回复(目标->中心)
+function WL_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
+    HeroMiddleLogic.HeroMiddleLogic_GetHeroData_WL(fd, msg)
 end

+ 38 - 0
script/common/InnerProto.lua

@@ -38,4 +38,42 @@ LW_MIDDLE_CHAT =
 WL_MIDDLE_CHAT = 
 {
   {"tChatMsg",               "table"}
+}
+
+-- 聊天查看分享英雄数据(请求的服务器->中心)
+LW_MIDDLE_CHAT_QUERY_HERO_DATA = 
+{
+    {"nSrcServerID",        "int"},     -- 源服务器ID
+    {"nDesServerID",        "int"},     -- 目标服务器ID
+    {"nSrcUID",             "string"},  -- 请求的玩家UID
+    {"nDesUID",             "string"},  -- 查询的玩家UID
+    {"nHeroIndex",          "int"},     -- 查看的英雄下表
+    {"nChatType",           "int"},     -- 聊天频道
+}
+
+-- 发送到对应服务器信息(中心->目标服务器)
+WL_MIDDLE_CHAT_QUERY_HERO_DATA = 
+{
+    {"nSrcServerID",        "int"},     -- 源服务器ID
+    {"nSrcUID",             "string"},  -- 请求的玩家UID
+    {"nDesUID",             "string"},  -- 查询的玩家UID
+    {"nHeroIndex",          "int"},     -- 查看的英雄下表
+    {"nChatType",           "int"},     -- 聊天频道
+}
+
+-- 英雄信息回复(目标->中心)
+LW_MIDDLE_CHAT_GET_HERO_DATA = 
+{ 
+    -- {"nResult",             "int"},     -- 结果 1 获取成功,0 获取不到数据  
+    {"nSrcUID",             "string"},  -- 请求的玩家UID
+    {"nSrcServerID",        "int"},     -- 源服务器ID
+    {"tHeroData",           "table"},   -- 英雄数据
+}
+
+-- 英雄信息回复(目标->中心)
+WL_MIDDLE_CHAT_GET_HERO_DATA = 
+{ 
+    -- {"nResult",             "int"},     -- 结果 1 获取成功,0 获取不到数据  
+    {"nSrcUID",             "string"},  -- 请求的玩家UID
+    {"tHeroData",           "table"},   -- 英雄数据
 }

+ 5 - 1
script/common/InnerProtoID.lua

@@ -6,4 +6,8 @@ _ENV[5] = 'WL_MOZHU_QUERY'
 _ENV[6] = 'WL_HELLO'
 _ENV[7] = 'WL_HEARTBEAT'
 _ENV[8] = 'LW_MIDDLE_CHAT'
-_ENV[9] = 'WL_MIDDLE_CHAT'
+_ENV[9] = 'WL_MIDDLE_CHAT'
+_ENV[10] = 'LW_MIDDLE_CHAT_QUERY_HERO_DATA'
+_ENV[11] = 'WL_MIDDLE_CHAT_QUERY_HERO_DATA'
+_ENV[12] = 'LW_MIDDLE_CHAT_GET_HERO_DATA'
+_ENV[13] = 'WL_MIDDLE_CHAT_GET_HERO_DATA'

+ 98 - 97
script/common/Log.lua

@@ -1,97 +1,98 @@
-local lua_log = _G.lua_log
-local LogDefine = require("common.LogDefine")
-
-function init()
-    if has_init then
-        return
-    end
-    has_init = true
-    --[[服务器测试输出--]] LOGID_TEST = lua_log.reg("log/test", "", 0)
-    --[[服务器测试输出--]] LOGID_DEBUG = lua_log.reg("log/debug", "", 0)
-    --[[服务器输出跟踪日志--]] LOGID_OSS_BT = lua_log.reg("log/err_bt", "", 0)
-    --[[所有的pcall失败报错输出]] LOGID_ERR_PCALL = lua_log.reg("log/err_pcall", "", 0)
-    --[[服务器obj数据统计--]] LOGID_MONITOR = lua_log.reg("log/monitor", "thread,luamem,scene,obj,monster,human,pet", 0)
-    --[[GM指令--]] LOGID_OSS_GM_CODE = lua_log.reg("log/oss_gm_code", "uuid,account_name,role_name,cmd,arg", 0)
-    --[[INNER_close]] LOGID_INNER_CLOSE = lua_log.reg("log/inner_close", "", 0)
-
-    --[[客户端报错收集--]] LOGID_OSS_CLIENT_ERR = lua_log.reg("log/oss_client_err", "uuid,account_name,role_name,err", 300)
-    --[[客户端资源加载报错收集--]] LOGID_OSS_CLIENT_LOAD_ERR = lua_log.reg("log/oss_client_load_err", "uuid,account_name,role_name,err", 300)
-
-    --[[创建流失率--]] LOGID_OSS_CREATELOSS = lua_log.reg("log/oss_create_loss", "account_name,role_name,step,ip,pf,appid,appid2", 300)
-    --[[注册]] LOGID_OSS_REGISTER = lua_log.reg("log/oss_register", "uuid,account_name,role_name,ip,pf,appid,cnt", 300)
-    --[[登录--]] LOGID_OSS_LOGIN = lua_log.reg("log/oss_login", "uuid,account_name,role_name,level,ip", 300)
-    --[[登出--]] LOGID_OSS_LOGOUT = lua_log.reg("log/oss_logout", "uuid,account_name,role_name,level,ip,reason,online_time", 300)
-    --[[主指引完成--]] LOGID_OSS_GUIDE_MAIN = lua_log.reg("log/oss_guide_main", "uuid,account_name,role_name,level,ip,pf,appid,main_id,skip_type", 300)
-    --[[子指引完成--]] LOGID_OSS_GUIDE_SUB = lua_log.reg("log/oss_guide_sub", "uuid,account_name,role_name,level,ip,pf,appid,sub_id", 300)
-
-    --[[聊天--]] LOGID_OSS_CHAT = lua_log.reg("log/oss_chat", "uuid, account_name, role_name, ip, channel, content", 300)
-    --[[升级--]] LOGID_OSS_LEVELUP = lua_log.reg("log/oss_level_up", "uuid,account_name,role_name,prev_level,level", 300)
-    --[[守护之龙--]] LOGID_OSS_DRAGON_LEVEL = lua_log.reg("log/oss_dragon_lv", "uuid,account_name,role_name,level,skill_level", 300)
-    --[[公会科技]] LOGID_OSS_UNION_TECH = lua_log.reg("log/oss_unionTech_lv", "uuid,account_name,role_name,type,level", 300)
-    --[[金币流通--]] LOGID_OSS_JINBI = lua_log.reg("log/oss_money", "uuid,account_name,role_name,level,money,type,item_id,num,remain_money", 300)
-    --[[钻石流通--]] LOGID_OSS_GOLD = lua_log.reg("log/oss_gold", "uuid,account_name,role_name,level,gold,type,item_id,num,remain_gold", 300)
-    --[[友情值流通]] LOGID_OSS_FRIENDHEART = lua_log.reg("log/oss_friendheart", "uuid,account_name,role_name,level,friendheart,type,item_id,num,remain_friendheart", 300)
-    --[[道具流通--]] LOGID_OSS_ITEM = lua_log.reg("log/oss_item", "uuid,account_name,role_name,level,type,item_id,num,afterCount", 300)
-    --[[英雄流通--]] LOGID_OSS_HERO = lua_log.reg("log/oss_hero", "uuid,account_name,role_name,level,type,hero_id,num,hero_uuid, star", 300)
-    --[[符文流通--]] LOGID_OSS_FUWEN = lua_log.reg("log/oss_fuwen", "uuid,account_name,role_name,level,type,fuwen_id,num", 300)
-    --[[装备流通--]] LOGID_OSS_EQUIP = lua_log.reg("log/oss_equip", "uuid,account_name,role_name,level,type,equip_id,num, equip_uuid", 300)
-    --[[召唤法阵--]] LOGID_OSS_DRAWCARD = lua_log.reg( "log/oss_drawcard", "uuid,account_name,role_name,level,type,hero_ids,item_id,num,zuanshi,jifen", 300)
-    --[[战斗过程详细日志--]] LOGID_FIGHT_LOG = lua_log.reg("log/fight_log", "", 0)
-    --[[充值--]] LOGID_OSS_PAY = lua_log.reg("log/oss_pay", "uuid, account_name,role_name,level, billno, buyID, money, gold, online,region", 300)
-    --[[充值错误--]] LOGID_OSS_PAY_ERR =lua_log.reg("log/oss_pay_err", "account_name,result,billno, buyID, money, gold,region", 300)
-    --[[腾讯购买--]] LOGID_OSS_TENCENT_BUY = lua_log.reg("log/oss_tencent_buy", "uuid,account_name,role_name,logintype,openid,openkey,pf,yuanbao,buyID", 300)
-
-    --[[跨服相关调试日志--]] LOGID_MIDDLE_BT = lua_log.reg("log/err_middle_bt", "err", 0)
-
-    --[[怪物死亡]] LOGID_OSS_MONSTER =lua_log.reg("log/oss_die", "uuid,account_name,role_name,level,kill_id,name,map_id", 300)
-    --[[金币挑战]] LOGID_OSS_BATTLE_GOLD = lua_log.reg("log/oss_jbtz_lv", "uuid,account_name,role_name,lv", 300)
-    --[[经验挑战]] LOGID_OSS_BATTLE_EXP = lua_log.reg("log/oss_exptz_lv", "uuid,account_name,role_name,lv", 300)
-    --[[英雄挑战]] LOGID_OSS_BATTLE_HERO = lua_log.reg("log/oss_yxtz_lv", "uuid,account_name,role_name,lv", 300)
-    --[[黄金龙穴]] LOGID_OSS_BATTLE_DRAGON = lua_log.reg("log/oss_hjlx_lv", "uuid,account_name,role_name,lv", 300)
-    --[[水晶之地]] LOGID_OSS_BATTLE_CRYSTAL = lua_log.reg("log/oss_sjzd_lv", "uuid,account_name,role_name,lv", 300)
-    --[[灵兽深渊]] LOGID_OSS_BATTLE_MOSHOU = lua_log.reg("log/oss_mssz_lv", "uuid,account_name,role_name,lv", 300)
-
-    --[[主线关卡]] LOGID_OSS_BATTLE_MAINGATE = lua_log.reg("log/oss_maingate_lv", "uuid,account_name,role_name,lv", 300)
-    --[[恶魔之塔]] LOGID_OSS_BATTLE_DEMONTOWER = lua_log.reg("log/oss_demonTower_lv", "uuid,account_name,role_name,lv", 300)
-    --[[绝望深渊]] LOGID_OSS_BATTLE_DESPAIRABYSS = lua_log.reg("log/oss_despairAbyss_lv", "uuid,account_name,role_name,lv", 300)
-    --[[遗迹探险]] LOGID_OSS_BATTLE_RELIC = lua_log.reg("log/oss_relic_lv", "uuid,account_name,role_name,lv", 300)
-
-    --[[分享日志]] LOGID_OSS_SHARE = lua_log.reg("log/oss_share", "uuid, account_name, role_name, pf, appid, way", 300)
-    --[[online 0:离线,保存db,未发货1:在线发货 2:离线期间请求,上线后发货发货--]] 
-      LOGID_OSS_DELIVER = lua_log.reg("log/oss_deliver", "uuid, account_name,role_name,level, billno,money, type, itemId,cnt, online,region",300)
-    --[[英雄起源活动领取日志]] LOGID_OSS_PAYREWARD = lua_log.reg("log/oss_payreward", "uuid,account_name,role_name,week,type,gift_index", 300)
-    --[[英雄升级日志]] LOGID_OSS_HEROLVUP = lua_log.reg("log/oss_herolvup", "uuid,account_name,role_name,rerouuid,oldlv,newlv", 300)
-    --[[遗迹探险插入DB]] LOGID_OSS_YJTX_DB = lua_log.reg("log/oss_yjtx_db", "",0)
-    --[[竟技场-王者争霸]] LOGID_JJC_GODWAR = lua_log.reg("log/jjc_godwar","",0)
-    --[[开服活动]] LOGID_OSS_OPENSERVER_ACT = lua_log.reg("log/oss_openserver_act","",300)
-    --[[周循环活动]] LOGID_OSS_WEEKLOOP_ACT = lua_log.reg("log/week_loop_act","",300)
-    --[[埋点]] LOGID_OSS_MAIDIAN = lua_log.reg("log/oss_maidian","",300)
-    
-end
-init()
-
-write = lua_log.write
-
-function writeItemLog(human, grid, count, logType, index)
-    local logTypeID = LogDefine.DEFINE[logType] + LogDefine.TYPE["item"]
-    write(
-        LOGID_OSS_ITEM,
-        human.db._id,
-        human.db.account,
-        human.db.name,
-        human.db.lv,
-        logTypeID,
-        grid.id,
-        count,
-        index or 0
-    )
-end
-
-function qqInfo(human)
-    return human.vopenid or 0, 0, 0, human.phpChanelID or "", 0
-end
-
-function writeShareLog(human, shareType)
-    --'1:微信好友分享,2:微信朋友圈,3:微博,4:QQ,5:QQ好友,6:其他'
-    write(LOGID_OSS_SHARE, human.db._id, human.db.account, human.db.name, human.pf, human.appid, shareType)
-end
+local lua_log = _G.lua_log
+local LogDefine = require("common.LogDefine")
+
+function init()
+    if has_init then
+        return
+    end
+    has_init = true
+    --[[服务器测试输出--]] LOGID_TEST = lua_log.reg("log/test", "", 0)
+    --[[服务器测试输出--]] LOGID_DEBUG = lua_log.reg("log/debug", "", 0)
+    --[[服务器输出跟踪日志--]] LOGID_OSS_BT = lua_log.reg("log/err_bt", "", 0)
+    --[[所有的pcall失败报错输出]] LOGID_ERR_PCALL = lua_log.reg("log/err_pcall", "", 0)
+    --[[服务器obj数据统计--]] LOGID_MONITOR = lua_log.reg("log/monitor", "thread,luamem,scene,obj,monster,human,pet", 0)
+    --[[GM指令--]] LOGID_OSS_GM_CODE = lua_log.reg("log/oss_gm_code", "uuid,account_name,role_name,cmd,arg", 0)
+    --[[INNER_close]] LOGID_INNER_CLOSE = lua_log.reg("log/inner_close", "", 0)
+
+    --[[客户端报错收集--]] LOGID_OSS_CLIENT_ERR = lua_log.reg("log/oss_client_err", "uuid,account_name,role_name,err", 300)
+    --[[客户端资源加载报错收集--]] LOGID_OSS_CLIENT_LOAD_ERR = lua_log.reg("log/oss_client_load_err", "uuid,account_name,role_name,err", 300)
+
+    --[[创建流失率--]] LOGID_OSS_CREATELOSS = lua_log.reg("log/oss_create_loss", "account_name,role_name,step,ip,pf,appid,appid2", 300)
+    --[[注册]] LOGID_OSS_REGISTER = lua_log.reg("log/oss_register", "uuid,account_name,role_name,ip,pf,appid,cnt", 300)
+    --[[登录--]] LOGID_OSS_LOGIN = lua_log.reg("log/oss_login", "uuid,account_name,role_name,level,ip", 300)
+    --[[登出--]] LOGID_OSS_LOGOUT = lua_log.reg("log/oss_logout", "uuid,account_name,role_name,level,ip,reason,online_time", 300)
+    --[[主指引完成--]] LOGID_OSS_GUIDE_MAIN = lua_log.reg("log/oss_guide_main", "uuid,account_name,role_name,level,ip,pf,appid,main_id,skip_type", 300)
+    --[[子指引完成--]] LOGID_OSS_GUIDE_SUB = lua_log.reg("log/oss_guide_sub", "uuid,account_name,role_name,level,ip,pf,appid,sub_id", 300)
+
+    --[[聊天--]] LOGID_OSS_CHAT = lua_log.reg("log/oss_chat", "uuid, account_name, role_name, ip, channel, content", 300)
+    --[[升级--]] LOGID_OSS_LEVELUP = lua_log.reg("log/oss_level_up", "uuid,account_name,role_name,prev_level,level", 300)
+    --[[守护之龙--]] LOGID_OSS_DRAGON_LEVEL = lua_log.reg("log/oss_dragon_lv", "uuid,account_name,role_name,level,skill_level", 300)
+    --[[公会科技]] LOGID_OSS_UNION_TECH = lua_log.reg("log/oss_unionTech_lv", "uuid,account_name,role_name,type,level", 300)
+    --[[金币流通--]] LOGID_OSS_JINBI = lua_log.reg("log/oss_money", "uuid,account_name,role_name,level,money,type,item_id,num,remain_money", 300)
+    --[[钻石流通--]] LOGID_OSS_GOLD = lua_log.reg("log/oss_gold", "uuid,account_name,role_name,level,gold,type,item_id,num,remain_gold", 300)
+    --[[友情值流通]] LOGID_OSS_FRIENDHEART = lua_log.reg("log/oss_friendheart", "uuid,account_name,role_name,level,friendheart,type,item_id,num,remain_friendheart", 300)
+    --[[道具流通--]] LOGID_OSS_ITEM = lua_log.reg("log/oss_item", "uuid,account_name,role_name,level,type,item_id,num,afterCount", 300)
+    --[[英雄流通--]] LOGID_OSS_HERO = lua_log.reg("log/oss_hero", "uuid,account_name,role_name,level,type,hero_id,num,hero_uuid, star", 300)
+    --[[符文流通--]] LOGID_OSS_FUWEN = lua_log.reg("log/oss_fuwen", "uuid,account_name,role_name,level,type,fuwen_id,num", 300)
+    --[[装备流通--]] LOGID_OSS_EQUIP = lua_log.reg("log/oss_equip", "uuid,account_name,role_name,level,type,equip_id,num, equip_uuid", 300)
+    --[[召唤法阵--]] LOGID_OSS_DRAWCARD = lua_log.reg( "log/oss_drawcard", "uuid,account_name,role_name,level,type,hero_ids,item_id,num,zuanshi,jifen", 300)
+    --[[战斗过程详细日志--]] LOGID_FIGHT_LOG = lua_log.reg("log/fight_log", "", 0)
+    --[[充值--]] LOGID_OSS_PAY = lua_log.reg("log/oss_pay", "uuid, account_name,role_name,level, billno, buyID, money, gold, online,region", 300)
+    --[[充值错误--]] LOGID_OSS_PAY_ERR =lua_log.reg("log/oss_pay_err", "account_name,result,billno, buyID, money, gold,region", 300)
+    --[[腾讯购买--]] LOGID_OSS_TENCENT_BUY = lua_log.reg("log/oss_tencent_buy", "uuid,account_name,role_name,logintype,openid,openkey,pf,yuanbao,buyID", 300)
+
+    --[[跨服相关调试日志--]] LOGID_MIDDLE_BT = lua_log.reg("log/err_middle_bt", "err", 0)
+
+    --[[怪物死亡]] LOGID_OSS_MONSTER =lua_log.reg("log/oss_die", "uuid,account_name,role_name,level,kill_id,name,map_id", 300)
+    --[[金币挑战]] LOGID_OSS_BATTLE_GOLD = lua_log.reg("log/oss_jbtz_lv", "uuid,account_name,role_name,lv", 300)
+    --[[经验挑战]] LOGID_OSS_BATTLE_EXP = lua_log.reg("log/oss_exptz_lv", "uuid,account_name,role_name,lv", 300)
+    --[[英雄挑战]] LOGID_OSS_BATTLE_HERO = lua_log.reg("log/oss_yxtz_lv", "uuid,account_name,role_name,lv", 300)
+    --[[黄金龙穴]] LOGID_OSS_BATTLE_DRAGON = lua_log.reg("log/oss_hjlx_lv", "uuid,account_name,role_name,lv", 300)
+    --[[水晶之地]] LOGID_OSS_BATTLE_CRYSTAL = lua_log.reg("log/oss_sjzd_lv", "uuid,account_name,role_name,lv", 300)
+    --[[灵兽深渊]] LOGID_OSS_BATTLE_MOSHOU = lua_log.reg("log/oss_mssz_lv", "uuid,account_name,role_name,lv", 300)
+
+    --[[主线关卡]] LOGID_OSS_BATTLE_MAINGATE = lua_log.reg("log/oss_maingate_lv", "uuid,account_name,role_name,lv", 300)
+    --[[恶魔之塔]] LOGID_OSS_BATTLE_DEMONTOWER = lua_log.reg("log/oss_demonTower_lv", "uuid,account_name,role_name,lv", 300)
+    --[[绝望深渊]] LOGID_OSS_BATTLE_DESPAIRABYSS = lua_log.reg("log/oss_despairAbyss_lv", "uuid,account_name,role_name,lv", 300)
+    --[[遗迹探险]] LOGID_OSS_BATTLE_RELIC = lua_log.reg("log/oss_relic_lv", "uuid,account_name,role_name,lv", 300)
+
+    --[[分享日志]] LOGID_OSS_SHARE = lua_log.reg("log/oss_share", "uuid, account_name, role_name, pf, appid, way", 300)
+    --[[online 0:离线,保存db,未发货1:在线发货 2:离线期间请求,上线后发货发货--]] 
+      LOGID_OSS_DELIVER = lua_log.reg("log/oss_deliver", "uuid, account_name,role_name,level, billno,money, type, itemId,cnt, online,region",300)
+    --[[英雄起源活动领取日志]] LOGID_OSS_PAYREWARD = lua_log.reg("log/oss_payreward", "uuid,account_name,role_name,week,type,gift_index", 300)
+    --[[英雄升级日志]] LOGID_OSS_HEROLVUP = lua_log.reg("log/oss_herolvup", "uuid,account_name,role_name,rerouuid,oldlv,newlv", 300)
+    --[[遗迹探险插入DB]] LOGID_OSS_YJTX_DB = lua_log.reg("log/oss_yjtx_db", "",0)
+    --[[竟技场-王者争霸]] LOGID_JJC_GODWAR = lua_log.reg("log/jjc_godwar","",0)
+    --[[开服活动]] LOGID_OSS_OPENSERVER_ACT = lua_log.reg("log/oss_openserver_act","",300)
+    --[[周循环活动]] LOGID_OSS_WEEKLOOP_ACT = lua_log.reg("log/week_loop_act","",300)
+    --[[代金券]] LOGID_OSS_VOUCHERSHOP = lua_log.reg("log/vouchershop","",300)
+    --[[埋点]] LOGID_OSS_MAIDIAN = lua_log.reg("log/oss_maidian","",300)
+    
+end
+init()
+
+write = lua_log.write
+
+function writeItemLog(human, grid, count, logType, index)
+    local logTypeID = LogDefine.DEFINE[logType] + LogDefine.TYPE["item"]
+    write(
+        LOGID_OSS_ITEM,
+        human.db._id,
+        human.db.account,
+        human.db.name,
+        human.db.lv,
+        logTypeID,
+        grid.id,
+        count,
+        index or 0
+    )
+end
+
+function qqInfo(human)
+    return human.vopenid or 0, 0, 0, human.phpChanelID or "", 0
+end
+
+function writeShareLog(human, shareType)
+    --'1:微信好友分享,2:微信朋友圈,3:微博,4:QQ,5:QQ好友,6:其他'
+    write(LOGID_OSS_SHARE, human.db._id, human.db.account, human.db.name, human.pf, human.appid, shareType)
+end

+ 1 - 0
script/common/LogDefine.lua

@@ -245,6 +245,7 @@ DEFINE = {
     abs_sign_gift = 249,                     -- 浪漫邂逅购买礼包
 	open_server_PowerUpPrize = 250,			 -- 开服活动-战力冲刺
 	week_loop_act			= 251,			 -- 周活动
+	voucher_use 			= 252,			 -- 代金券使用
 	abs_totalReach          = 500,           -- 周期性活动累计
     abs_singleReach         = 501,           -- 周期性活动单次
     draw_ad_reward         = 601,           -- 观看广告送召唤券

+ 5 - 0
script/common/ProtoID.lua

@@ -1286,6 +1286,11 @@ _ENV[1285]="GC_WEEKLOOP_ACT_CARDQUERY"
 _ENV[1286]="CG_WEEKLOOP_ACT_CARDGETPRIZE"
 _ENV[1287]="CG_WEEKLOOP_ACT_RANK_QUERY"
 _ENV[1288]="GC_WEEKLOOP_ACT_RANK_QUERY"
+_ENV[1289]="CG_VOUCHER_QUERY_SHOP"
+_ENV[1290]="GC_VOUCHER_QUERY_SHOP"
+_ENV[1291]="CG_VOUCHER_QUERY_INFLATE"
+_ENV[1292]="GC_VOUCHER_QUERY_INFLATE"
+_ENV[1293]="CG_VOUCHER_BUY_ITEM"
 _ENV[1294]="CG_PRESEN_OPEN_ADDUP_CHARGE_QUERY"
 _ENV[1295]="GC_PRESEN_OPEN_ADDUP_CHARGE_QUERY"
 _ENV[1296]="CG_PRESENT_OPEN_ADDUP_CHARGE_GETPRIZE"

+ 3 - 0
script/core/ObjHuman.lua

@@ -86,6 +86,7 @@ local LostTempleLogic = require("lostTemple.lostTempleLogic")
 local DrawCardV2Excel = require("excel.drawCard").drawCardV2
 local WarOrder = require("shop.WarOrder")
 local OpenServerActPowerUp = require("present.OpenServerActPowerUp")
+local VoucherShopLogic = require("voucher.VoucherShopLogic")
 local RacialTrialLogic = require("racialTrial.RacialTrialLogic")
 local MaiDianDefine = require("MaiDian.MaiDianDefine")
 local MainDianLogic = require("MaiDian.MaiDianLogic")
@@ -658,6 +659,7 @@ function sendHumanInfo(human,isNew)
 		mm.nSpeed[3] = human.db.nSpeed[3] and human.db.nSpeed[3] or 0
 	end
 	
+	mm.nServerIndex = Config.SVR_INDEX
 
 	Msg.send(mm, human.fd)
 end
@@ -719,6 +721,7 @@ function onLogin(human, isNew)
 	LianyuLogic.onLogin(human)
 	MoshouLogic.onLogin(human)
     TopupLogic.checkKf(human)
+	VoucherShopLogic.onLogin(human)
 	RacialTrialLogic.onLogin(human)
 	ZhanbuLogic.onLogin(human)
 	-- 最后执行离线发货

+ 2 - 0
script/core/Timer.lua

@@ -42,6 +42,7 @@ local AbsActLogic = require("absAct.AbsActLogic")
 local MoZhuMiddleLogic = require("mozhu.MoZhuMiddleLogic")
 local LostTempleLogic = require("lostTemple.lostTempleLogic")
 local MainDianLogic = require("MaiDian.MaiDianLogic")
+local VoucherShopLogic = require("voucher.VoucherShopLogic")
 
 register_timer = {    
 	monitor = 60000,            -- 
@@ -115,6 +116,7 @@ function doZhengDian(hour)
         ChatRecord.CHAT_RECORD_REPETITION = {}
         HeroGrowUp.actLoop()
         LostTempleLogic.onZero()
+	VoucherShopLogic.VoucherShop_OnZero()
         MainDianLogic.MaiDian_OnTime()
     end       
     --if hour == 21 then

+ 223 - 222
script/module/absAct/NewHeroLogic.lua

@@ -1,223 +1,224 @@
-local AbsActExcel = require("excel.absAct")
-local Lang = require("common.Lang")
-local ObjHuman = require("core.ObjHuman")
-local Msg = require("core.Msg")
-local Broadcast = require("broadcast.Broadcast")
-local Grid = require("bag.Grid")
-local BagLogic = require("bag.BagLogic")
-local ItemDefine = require("bag.ItemDefine")
-local BuyLogic = require("topup.BuyLogic")
-local AbsActDefine = require("absAct.AbsActDefine")
-local AbsActLogic = require("absAct.AbsActLogic")
-local Log = require("common.Log")
-local YunYingLogic = require("yunying.YunYingLogic")
-
-ABS_ACT_ID = 9001
---
-function initAfterHot()
-    
-end
-
---
-function isActive(human, YYInfo, funcConfig)
-    return not isOpen(human, YYInfo, funcConfig)
-end
-
---
-function isOpen(human, YYInfo, funcConfig)
-    return AbsActLogic.isStarted(human, funcConfig.funcID)
-end
-
---
-function isRed(human, YYInfo, funcConfig)
-    return false
-end
-
---
-function getLeftTime(human, YInfo, funcConfig)
-    local ret, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
-    if ret == true then
-        return endTime - os.time()
-    else
-        return 0
-    end
-end
-
-function getNewHeroID(human)
-    local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
-    if not startedFlag then return 0 end
-    local absActConfig = AbsActExcel.absActivity[ABS_ACT_ID]
-    if not absActConfig then return 0 end
-
-    return absActConfig.icon
-end
-
-function getAndSendMsg(human, id, actId)
-    local now = os.time()
-    local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, id)
-    if not startedFlag then return end
-    local absActConfig = AbsActExcel.absActivity[id]
-    if not absActConfig then return end
-
-    local absAct = human.db.absAct[id]
-    if not absAct then return end
-
-    local msgRet = Msg.gc.GC_ABS_NEWHERO
-    msgRet.id = absActConfig.icon
-    msgRet.startTime = startTime
-    msgRet.endTime = endTime
-
-    local index = 0
-    for giftId, v in ipairs(AbsActExcel.absEva) do
-        index = index + 1
-        for j = 1, #v.reward do
-            Grid.makeItem(msgRet.giftlist[index].item[j], v.reward[j][1], v.reward[j][2])
-        end
-        msgRet.giftlist[index].item[0] = #v.reward
-        msgRet.giftlist[index].cnt = absAct.newheroCnt and absAct.newheroCnt[giftId] or 0
-        msgRet.giftlist[index].id = giftId
-        msgRet.giftlist[index].maxCnt = v.limit
-
-        local buyID = v.buyID
-        msgRet.giftlist[index].buyMsg[0] = 1
-        if v.buyID == 0 then
-            msgRet.giftlist[index].buyMsg[1] = {
-                buyID = buyID,
-                region = "zuanshi",
-                cost = v.price,
-                icon = 0,
-                name = "",
-                isFirst = 0,
-                desc = "",
-                doubleCnt = 0,
-                actDoubleCnt = 0,
-                useDoubleCnt = 0,
-                buyCnt = 0,
-                vipExp = 0,
-                yuanjia = 0,
-                zhekou = 0,
-            }
-        else
-            BuyLogic.fontBuyItem(human, msgRet.giftlist[index].buyMsg[1], buyID)
-        end
-    end
-    msgRet.giftlist[0] = index
-
-    Msg.send(msgRet, human.fd)
-end
-
-function getgiftbybuyid(buyid)
-    for giftId, v in ipairs(AbsActExcel.absEva) do
-        if v.buyID == buyid then
-            return giftId
-        end
-    end
-end
-
-function newheroGift(human, id, buyConf, isFirst, cnt)
-    local state = AbsActLogic.isStarted(human, id)
-    local absConfig = AbsActExcel.absActivity[id]
-    if absConfig == nil or not state then return end
-
-    -- 存在多个特惠礼包 同时   开放
-    local giftid = getgiftbybuyid(buyConf.id)
-    if not giftid then return end
-
-    local config = AbsActExcel.absEva[giftid]
-    if not config then return end
-
-    AbsActLogic.checkAbsActClean(human, id)
-
-    human.db.absAct[id].newheroCnt = human.db.absAct[id].newheroCnt or { }
-    local nowBuyCnt = human.db.absAct[id].newheroCnt[giftid] or 0
-
-    -- 判断是否达到购买上限
-    if nowBuyCnt >= config.limit then
-        Broadcast.sendErr(human, Lang.HERO_BAG_BUY_CAP_NO_CNT)
-        return
-    end
-
-    -- 当金币购买之后超过最大金币时,不允许购买
-    for j = 1, #config.reward do
-        local itemID = config.reward[j][1]
-        local itemCnt = config.reward[j][2]
-        if itemID == ItemDefine.ITEM_JINBI_ID then
-            if not ObjHuman.canAddJinbi(human, itemCnt) then
-                return
-            end
-        end
-    end
-
-    -- 增加已购买次数
-    human.db.absAct[id].newheroCnt[giftid] = nowBuyCnt + 1
-    -- 发放物品
-    -- local items = { }
-    BagLogic.addItemList(human, config.reward, "newhero_reward")
-
-    Broadcast.sendErr(human, Lang.ITEM_BUY_SUCCESS)
-    AbsActLogic.actDetailQuery(human, id)
-end
-
-
-function giftBuy(human, giftid)
-    local state = AbsActLogic.isStarted(human, ABS_ACT_ID)
-    if state ~= true then return end
-    local absConfig = AbsActExcel.absActivity[ABS_ACT_ID]
-    if not absConfig then return end
-
-    AbsActLogic.checkAbsActClean(human, ABS_ACT_ID)
-
-    -- 存在多个特惠礼包 同时   开放
-    local config = AbsActExcel.absEva[giftid]
-    if config.buyID ~= 0 then return end
-
-    -- 初始化已购买次数
-    human.db.absAct[ABS_ACT_ID].newheroCnt = human.db.absAct[ABS_ACT_ID].newheroCnt or { }
-    local nowBuyCnt = human.db.absAct[ABS_ACT_ID].newheroCnt[giftid] or 0
-    -- 判断是否达到购买上限
-    if nowBuyCnt >= config.limit then
-        Broadcast.sendErr(human, Lang.HERO_BAG_BUY_CAP_NO_CNT)
-        return
-    end
-
-    local itemID = ItemDefine.ITEM_ZUANSHI_ID
-    local itemCnt = config.price
-    if not BagLogic.checkItemCnt(human, itemID, itemCnt) then
-        Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
-        return
-    end
-
-    -- 当金币购买之后超过最大金币时,不允许购买
-    for j = 1, #config.reward do
-        local itemID = config.reward[j][1]
-        local itemCnt = config.reward[j][2]
-        if itemID == ItemDefine.ITEM_JINBI_ID then
-            if not ObjHuman.canAddJinbi(human, itemCnt) then
-                return
-            end
-        end
-    end
-
-    BagLogic.delItem(human, itemID, itemCnt, "newhero_reward")
-
-    -- 增加已购买次数
-    human.db.absAct[ABS_ACT_ID].newheroCnt[giftid] = nowBuyCnt + 1
-    -- 发放物品
-    -- local items = { }
-    BagLogic.addItemList(human, AbsActExcel.absEva[giftid].reward, "newhero_reward")
-
-    Broadcast.sendErr(human, Lang.ITEM_BUY_SUCCESS)
-
-    AbsActLogic.actDetailQuery(human, ABS_ACT_ID)
-end
-
-function updateDaily(human, id)
-    if human.db.absAct[ABS_ACT_ID] then
-        human.db.absAct[ABS_ACT_ID] = {}
-    end
-    local state = AbsActLogic.isStarted(human, ABS_ACT_ID)
-    if state ~= true then
-        human.db.drawCard.list[8] = {}
-    end
-    AbsActLogic.actDetailQuery(human, ABS_ACT_ID)
+local AbsActExcel = require("excel.absAct")
+local Lang = require("common.Lang")
+local ObjHuman = require("core.ObjHuman")
+local Msg = require("core.Msg")
+local Broadcast = require("broadcast.Broadcast")
+local Grid = require("bag.Grid")
+local BagLogic = require("bag.BagLogic")
+local ItemDefine = require("bag.ItemDefine")
+local BuyLogic = require("topup.BuyLogic")
+local AbsActDefine = require("absAct.AbsActDefine")
+local AbsActLogic = require("absAct.AbsActLogic")
+local Log = require("common.Log")
+local YunYingLogic = require("yunying.YunYingLogic")
+
+ABS_ACT_ID = 9001
+--
+function initAfterHot()
+    
+end
+
+--
+function isActive(human, YYInfo, funcConfig)
+    return not isOpen(human, YYInfo, funcConfig)
+end
+
+--
+function isOpen(human, YYInfo, funcConfig)
+    return AbsActLogic.isStarted(human, funcConfig.funcID)
+end
+
+--
+function isRed(human, YYInfo, funcConfig)
+    return false
+end
+
+--
+function getLeftTime(human, YInfo, funcConfig)
+    local ret, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
+    if ret == true then
+        return endTime - os.time()
+    else
+        return 0
+    end
+end
+
+function getNewHeroID(human)
+    local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, ABS_ACT_ID)
+    if not startedFlag then return 0 end
+    local absActConfig = AbsActExcel.absActivity[ABS_ACT_ID]
+    if not absActConfig then return 0 end
+
+    return absActConfig.icon
+end
+
+function getAndSendMsg(human, id, actId)
+    local now = os.time()
+    local startedFlag, endTime, startTime = AbsActLogic.isStarted(human, id)
+    if not startedFlag then return end
+    local absActConfig = AbsActExcel.absActivity[id]
+    if not absActConfig then return end
+
+    local absAct = human.db.absAct[id]
+    if not absAct then return end
+
+    local msgRet = Msg.gc.GC_ABS_NEWHERO
+    msgRet.id = absActConfig.icon
+    msgRet.startTime = startTime
+    msgRet.endTime = endTime
+
+    local index = 0
+    for giftId, v in ipairs(AbsActExcel.absEva) do
+        index = index + 1
+        for j = 1, #v.reward do
+            Grid.makeItem(msgRet.giftlist[index].item[j], v.reward[j][1], v.reward[j][2])
+        end
+        msgRet.giftlist[index].item[0] = #v.reward
+        msgRet.giftlist[index].cnt = absAct.newheroCnt and absAct.newheroCnt[giftId] or 0
+        msgRet.giftlist[index].id = giftId
+        msgRet.giftlist[index].maxCnt = v.limit
+
+        local buyID = v.buyID
+        msgRet.giftlist[index].buyMsg[0] = 1
+        if v.buyID == 0 then
+            msgRet.giftlist[index].buyMsg[1] = {
+                buyID = buyID,
+                region = "zuanshi",
+                cost = v.price,
+                icon = 0,
+                name = "",
+                isFirst = 0,
+                desc = "",
+                doubleCnt = 0,
+                actDoubleCnt = 0,
+                useDoubleCnt = 0,
+                buyCnt = 0,
+                vipExp = 0,
+                yuanjia = 0,
+                zhekou = 0,
+                voucher = 0,
+            }
+        else
+            BuyLogic.fontBuyItem(human, msgRet.giftlist[index].buyMsg[1], buyID)
+        end
+    end
+    msgRet.giftlist[0] = index
+
+    Msg.send(msgRet, human.fd)
+end
+
+function getgiftbybuyid(buyid)
+    for giftId, v in ipairs(AbsActExcel.absEva) do
+        if v.buyID == buyid then
+            return giftId
+        end
+    end
+end
+
+function newheroGift(human, id, buyConf, isFirst, cnt)
+    local state = AbsActLogic.isStarted(human, id)
+    local absConfig = AbsActExcel.absActivity[id]
+    if absConfig == nil or not state then return end
+
+    -- 存在多个特惠礼包 同时   开放
+    local giftid = getgiftbybuyid(buyConf.id)
+    if not giftid then return end
+
+    local config = AbsActExcel.absEva[giftid]
+    if not config then return end
+
+    AbsActLogic.checkAbsActClean(human, id)
+
+    human.db.absAct[id].newheroCnt = human.db.absAct[id].newheroCnt or { }
+    local nowBuyCnt = human.db.absAct[id].newheroCnt[giftid] or 0
+
+    -- 判断是否达到购买上限
+    if nowBuyCnt >= config.limit then
+        Broadcast.sendErr(human, Lang.HERO_BAG_BUY_CAP_NO_CNT)
+        return
+    end
+
+    -- 当金币购买之后超过最大金币时,不允许购买
+    for j = 1, #config.reward do
+        local itemID = config.reward[j][1]
+        local itemCnt = config.reward[j][2]
+        if itemID == ItemDefine.ITEM_JINBI_ID then
+            if not ObjHuman.canAddJinbi(human, itemCnt) then
+                return
+            end
+        end
+    end
+
+    -- 增加已购买次数
+    human.db.absAct[id].newheroCnt[giftid] = nowBuyCnt + 1
+    -- 发放物品
+    -- local items = { }
+    BagLogic.addItemList(human, config.reward, "newhero_reward")
+
+    Broadcast.sendErr(human, Lang.ITEM_BUY_SUCCESS)
+    AbsActLogic.actDetailQuery(human, id)
+end
+
+
+function giftBuy(human, giftid)
+    local state = AbsActLogic.isStarted(human, ABS_ACT_ID)
+    if state ~= true then return end
+    local absConfig = AbsActExcel.absActivity[ABS_ACT_ID]
+    if not absConfig then return end
+
+    AbsActLogic.checkAbsActClean(human, ABS_ACT_ID)
+
+    -- 存在多个特惠礼包 同时   开放
+    local config = AbsActExcel.absEva[giftid]
+    if config.buyID ~= 0 then return end
+
+    -- 初始化已购买次数
+    human.db.absAct[ABS_ACT_ID].newheroCnt = human.db.absAct[ABS_ACT_ID].newheroCnt or { }
+    local nowBuyCnt = human.db.absAct[ABS_ACT_ID].newheroCnt[giftid] or 0
+    -- 判断是否达到购买上限
+    if nowBuyCnt >= config.limit then
+        Broadcast.sendErr(human, Lang.HERO_BAG_BUY_CAP_NO_CNT)
+        return
+    end
+
+    local itemID = ItemDefine.ITEM_ZUANSHI_ID
+    local itemCnt = config.price
+    if not BagLogic.checkItemCnt(human, itemID, itemCnt) then
+        Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
+        return
+    end
+
+    -- 当金币购买之后超过最大金币时,不允许购买
+    for j = 1, #config.reward do
+        local itemID = config.reward[j][1]
+        local itemCnt = config.reward[j][2]
+        if itemID == ItemDefine.ITEM_JINBI_ID then
+            if not ObjHuman.canAddJinbi(human, itemCnt) then
+                return
+            end
+        end
+    end
+
+    BagLogic.delItem(human, itemID, itemCnt, "newhero_reward")
+
+    -- 增加已购买次数
+    human.db.absAct[ABS_ACT_ID].newheroCnt[giftid] = nowBuyCnt + 1
+    -- 发放物品
+    -- local items = { }
+    BagLogic.addItemList(human, AbsActExcel.absEva[giftid].reward, "newhero_reward")
+
+    Broadcast.sendErr(human, Lang.ITEM_BUY_SUCCESS)
+
+    AbsActLogic.actDetailQuery(human, ABS_ACT_ID)
+end
+
+function updateDaily(human, id)
+    if human.db.absAct[ABS_ACT_ID] then
+        human.db.absAct[ABS_ACT_ID] = {}
+    end
+    local state = AbsActLogic.isStarted(human, ABS_ACT_ID)
+    if state ~= true then
+        human.db.drawCard.list[8] = {}
+    end
+    AbsActLogic.actDetailQuery(human, ABS_ACT_ID)
  end

+ 1 - 1
script/module/hero/Handler.lua

@@ -143,7 +143,7 @@ end
 
 -- 查看分享英雄的信息
 function CG_HERO_SHARE_DATA(human, msg)
-	HeroLogic.shareData(human, msg.uuid, msg.heroIndex)
+	HeroLogic.shareData(human, msg.uuid, msg.heroIndex, msg.nChatType, msg.nServerIndex)
 end
 
 

+ 18 - 12
script/module/hero/HeroLogic.lua

@@ -63,11 +63,10 @@ local MengxinLogic = require("present.MengxinLogic")
 local Config = require("Config")
 local HeroLogLogic = require("absAct.HeroLogLogic")
 local ExclusiveTaskLogic = require("absAct.ExclusiveTaskLogic")
-local BingshuLogic = require("fuwen.BingshuLogic")
 local YunYingLogic = require("yunying.YunYingLogic")
 local BingshuLogic = require("fuwen.BingshuLogic")
 local GiftLogic = require("topup.GiftLogic")
-
+local HeroMiddleLogic = require("hero.HeroMiddleLogic")
 
 HERO_MAX_STAR    =        15    -- 目前英雄最大星级
 
@@ -1586,21 +1585,28 @@ function getHeroShareGrid(uuid, heroIndex)
 	return heroGrid, bagIndex, fakeHuman
 end
 
-function shareData(human, uuid, heroIndex)
-	local msgRet = Msg.gc.GC_HERO_SHARE_DATA
-	local heroGrid, bagIndex, fakeHuman = getHeroShareGrid(uuid, heroIndex) 
-	if heroGrid then
-		if not makeHeroShare(msgRet.data, heroGrid, bagIndex, fakeHuman) then
-			return
+function shareData(human, uuid, heroIndex, nChatType, nServerIndex)
+	print("[shareData] 获取跨服数据开始 uuid = "..uuid.." heroIndex = "..heroIndex.." nChatType = "..nChatType.." nServerIndex = "..nServerIndex)
+	if -1 >= nChatType or -1 >= nServerIndex then
+		local msgRet = Msg.gc.GC_HERO_SHARE_DATA
+		local heroGrid, bagIndex, fakeHuman = getHeroShareGrid(uuid, heroIndex) 
+		if heroGrid then
+			if not makeHeroShare(msgRet.data, heroGrid, bagIndex, fakeHuman) then
+				return
+			end
+		else
+			local monsterID, mosnterLv = JjcLogic.getHeroShareMonster(uuid, heroIndex)
+			if not monsterID then return end
+			makeHeroShareMonster(msgRet.data, monsterID, mosnterLv)
 		end
+		Msg.send(msgRet, human.fd)
 	else
-		local monsterID, mosnterLv = JjcLogic.getHeroShareMonster(uuid, heroIndex)
-		if not monsterID then return end
-		makeHeroShareMonster(msgRet.data, monsterID, mosnterLv)
+		print("[shareData] 获取跨服数据开始 uuid = "..uuid.." heroIndex = "..heroIndex.." nChatType = "..nChatType.." nServerIndex = "..nServerIndex)
+		HeroMiddleLogic.HeroMiddleLogic_QueryHeroData_LW(human, uuid, heroIndex, nChatType, nServerIndex)
 	end
-	Msg.send(msgRet, human.fd)
 end
 
+
 -- 获取英雄背包中 最大等级的英雄
 function getHeroBagMaxLev(human)
 	local maxLv = 1

+ 90 - 0
script/module/hero/HeroMiddleLogic.lua

@@ -0,0 +1,90 @@
+--------------------------------
+-- 文件名       :  HeroMiddleLogic.lua
+-- 文件说明     :  中心服获取玩家信息, 处理其他服务器获取跨服玩家信息
+-- 创建时间     :   2025/02/18
+-- 创建人       :   FC
+--------------------------------
+
+local Util = require("common.Util")
+local ObjHuman = require("core.ObjHuman")
+local InnerMsg = require("core.InnerMsg")
+local ChatHandler = require("chat.Handler")
+local Config = require("Config")
+local Msg = require("core.Msg")
+local HeroLogic = require("hero.HeroLogic")
+local JjcLogic = require("jjc.JjcLogic")
+
+-- 请求聊天分享的英雄数据
+function HeroMiddleLogic_QueryHeroData_LW(human, uuid, heroIndex, nChatType, nServerIndex)
+    if ChatHandler.CHAT_TYPE_MIDDLE ~= nChatType and ChatHandler.CHAT_TYPE_WARZONE ~= nChatType then
+        return
+    end
+
+    local lwMsgRet = InnerMsg.lw.LW_MIDDLE_CHAT_GET_HERO_DATA
+    lwMsgRet.nSrcServerID = Config.SVR_INDEX
+    lwMsgRet.nDesServerID = nServerIndex
+    lwMsgRet.nSrcUID = human.db._id
+    lwMsgRet.nDesUID = uuid
+    lwMsgRet.nHeroIndex = heroIndex
+    lwMsgRet.nChatType = nChatType
+
+    print("[HeroMiddleLogic_QueryHeroData_LW] 发送数据到中心服 nSrcServerID = "..lwMsgRet.nSrcServerID.." nDesServerID = "..lwMsgRet.nDesServerID)
+    InnerMsg.sendMsg(0, lwMsgRet)
+end
+
+-- 获取玩家分享的英雄数据
+function HeroMiddleLogic_QueryHeroData_WL(fd, tMsgData)
+    local sFindUID = tMsgData.nDesUID
+    local nHeroIndex = tMsgData.nHeroIndex
+
+    local tHeroData = Msg.gc.GC_HERO_SHARE_DATA
+    local heroGrid, bagIndex, fakeHuman = HeroLogic.getHeroShareGrid(sFindUID, nHeroIndex)
+    if heroGrid then
+        if not HeroLogic.makeHeroShare(tHeroData.data, heroGrid, bagIndex, fakeHuman) then
+            print("[HeroMiddleLogic_QueryHeroData_WL] 获取玩家数据失败")
+            return
+        end
+    else
+        local monsterID, mosnterLv = JjcLogic.getHeroShareMonster(sFindUID, nHeroIndex)
+        if not monsterID then return end
+        HeroLogic.makeHeroShareMonster(tHeroData.data, monsterID, mosnterLv)
+    end
+
+    local lwMsgRet = InnerMsg.lw.LW_MIDDLE_CHAT_GET_HERO_DATA
+    lwMsgRet.nSrcUID = tMsgData.nSrcUID
+    lwMsgRet.nSrcServerID = tMsgData.nSrcServerID
+    lwMsgRet.tHeroData = tHeroData
+
+    print("[HeroMiddleLogic_QueryHeroData_WL] 发送数据到中心服 nSrcServerID = "..lwMsgRet.nSrcServerID)
+    InnerMsg.sendMsg(0, lwMsgRet)
+end
+
+function HeroMiddleLogic_GetHeroData_WL(fd, tMsgData)
+    local nSrcUID = tMsgData.nSrcUID
+    local human = ObjHuman.onlineUuid[nSrcUID]
+    if not human then
+        print("[HeroMiddleLogic_GetHeroData_WL] 玩家不在线直接返回")
+        return
+    end
+
+    print("[HeroMiddleLogic_GetHeroData_WL] 获取到数据 nSrcServerID = ")
+
+    table.print_lua_table(tMsgData)
+    print("\n")
+
+    local msgRet = Msg.gc.GC_HERO_SHARE_DATA
+    msgRet.data = tMsgData.tHeroData.data
+    if nil == _G.next(tMsgData.tHeroData.data.equips) then
+        msgRet.data.equips[0] = 0
+    end
+
+    if nil == _G.next(tMsgData.tHeroData.data.fuWens) then
+        msgRet.data.fuWens[0] = 0
+    end
+
+    if nil == _G.next(tMsgData.tHeroData.data.heroSimple.gemData) then
+        msgRet.data.heroSimple.gemData[0] = 0
+    end
+
+    Msg.send(msgRet, human.fd)
+end

+ 3 - 0
script/module/hero/Proto.lua

@@ -582,7 +582,10 @@ GC_SHENQI_UPLV_DO = {
 CG_HERO_SHARE_DATA = {
 	{"uuid",           1,         "string"},
 	{"heroIndex",      1,         "int"},
+	{"nChatType",		1,			"int"},
+	{"nServerIndex",	1,			"int"},
 }
+
 HeroShareData = {
 	{"uuid",           		1,      "string"},
 	{"heroIndex",      		1,      "int"},

+ 34 - 0
script/module/middle/MiddleConnect.lua

@@ -245,4 +245,38 @@ function LW_MIDDLE_CHAT(fd, msg)
         print("[LW_MIDDLE_CHAT] 未处理的发送消息结束")
     end
 
+end
+
+-- 获取聊天英雄信息
+function LW_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
+    local nDesServerID = msg.nDesServerID
+    local nDesFD = MiddleManager.getFDBySvrIndex(nDesServerID)
+    if not nDesFD then
+        print("[LW_MIDDLE_CHAT_QUERY_HERO_DATA] 不存在对应的fd nDesServerID = "..nDesServerID)
+        return
+    end
+
+    local szMsgData = InnerMsg.wl.WL_MIDDLE_CHAT_QUERY_HERO_DATA
+    szMsgData.nSrcServerID = msg.nSrcServerID
+    szMsgData.nSrcUID = msg.nSrcUID
+    szMsgData.nDesUID = msg.nDesUID
+    szMsgData.nHeroIndex = msg.nHeroIndex
+    szMsgData.nChatType = msg.nChatType
+
+    InnerMsg.sendMsg(nDesFD, szMsgData)
+end
+
+function LW_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
+    local nSrcServerID = msg.nSrcServerID
+    local nSrcFD =  MiddleManager.getFDBySvrIndex(nSrcServerID)
+    if not nSrcFD then
+        print("[LW_MIDDLE_CHAT_GET_HERO_DATA] 不存在对应的fd nSrcServerID = "..nSrcServerID)
+        return
+    end
+
+    local szMsgData = InnerMsg.wl.WL_MIDDLE_CHAT_GET_HERO_DATA
+    szMsgData.nSrcUID = msg.nSrcUID
+    szMsgData.tHeroData = msg.tHeroData
+
+    InnerMsg.sendMsg(nSrcFD, szMsgData)
 end

+ 93 - 101
script/module/present/HeroSkinLogic.lua

@@ -1,102 +1,94 @@
---- 英雄皮肤
-local Grid = require("bag.Grid")
-local BuyExcel = require("excel.buy").buy
-local BagLogic = require("bag.BagLogic")
-local HeroSkinExcel = require("excel.present").heroSkin
-local SkinExcel = require("excel.skin").skin
-local SkinLogic = require("skin.SkinLogic")
-local HeadFrameExcel = require("excel.role").headFrame
-local RoleHeadLogic = require("role.RoleHeadLogic")
-local Msg = require("core.Msg")
-local Json = require("common.Json")
-
-local GC_SKIN_QUERY = 54
-
-local function genSkinUnit(human,id)
-    local cfg = HeroSkinExcel[id]
-    local buyCfg = BuyExcel[cfg.buyId]
-    local region = human.region or "CN"
-    local buyItem = {
-        buyID = cfg.buyId,
-        region = region,
-        cost = buyCfg[region],
-        icon = buyCfg.icon,
-        name = buyCfg.name,
-        desc = buyCfg.desc,
-        yuanjia = buyCfg.oCN,
-        zhekou = buyCfg.zhekou,
-        ttl =  cfg.ttl,
-    }
-    local skinId = cfg.content[1]
-    local skinCfg = SkinExcel[skinId]
-    local attrs = {}
-    for _,v in pairs(skinCfg.attrs) do 
-        attrs[#attrs + 1] = {
-            key = v[1],
-            value = v[2],
-        }
-    end
-    local iconframeId = cfg.content[2]
-    local iconframeCfg = HeadFrameExcel[iconframeId]
-    local headNet = {}
-	headNet.id = iconframeId 
-	headNet.desc = iconframeCfg.desc or ""
-	headNet.keepTime = iconframeCfg.keepTime
-	headNet.name = iconframeCfg.name or ""
-	headNet.camp = iconframeCfg.camp or 0
-    local len = #iconframeCfg.attrs
-    headNet.attrs = {}
-    for i = 1,len do
-        headNet.attrs[i] = {
-            key = iconframeCfg.attrs[i][1],
-            value = iconframeCfg.attrs[i][2],
-        }
-    end
-    return {
-        id = id,
-        buyItem = buyItem,
-        skinData = {
-            Id = skinId,
-            attrs = attrs
-        },
-        Iconframe = headNet
-    }
-end
-
------------------------------------------
-
-function query(human,panelId)
-    local ret = {}
-    for id,cfg in pairs(HeroSkinExcel) do
-        if cfg.panelId == panelId then
-            ret[#ret+1] = genSkinUnit(human,id)
-        end
-    end
-    return {
-        list = ret
-    }
-end
-
-function buy(human,buyId)
-    local skinCfg
-    for _,cfg in pairs(HeroSkinExcel) do
-        if cfg.buyId == buyId then 
-            skinCfg = cfg
-            break
-        end
-    end
-    assert(skinCfg,"invalid buyId")
-    -- 解锁皮肤和头像
-    SkinLogic.skinUnlock(human,skinCfg.content[1]) --BagLogic.addItemList(human,skinCfg.content,"skin_buy")
-    RoleHeadLogic.active(human,RoleHeadLogic.HEAD_TYPE_2,skinCfg.content[2])
-    --刷新
-    local data=query(human,skinCfg.panelId)
-    RefreshClient(human,GC_SKIN_QUERY,data)
-end
-
-function RefreshClient(human,type,data) 
-    local msgRet = Msg.gc.GC_ROLE_CHANGE_BASEINFO
-    msgRet.ret = type
-    msgRet.tip = Json.Encode(data)
-    Msg.send(msgRet,human.fd)
+--- 英雄皮肤
+local Grid = require("bag.Grid")
+local BuyExcel = require("excel.buy").buy
+local BagLogic = require("bag.BagLogic")
+local HeroSkinExcel = require("excel.present").heroSkin
+local SkinExcel = require("excel.skin").skin
+local SkinLogic = require("skin.SkinLogic")
+local HeadFrameExcel = require("excel.role").headFrame
+local RoleHeadLogic = require("role.RoleHeadLogic")
+local Msg = require("core.Msg")
+local Json = require("common.Json")
+local BuyLogic = require("topup.BuyLogic")
+
+local GC_SKIN_QUERY = 54
+
+local function genSkinUnit(human,id)
+    local cfg = HeroSkinExcel[id]
+    local buyCfg = BuyExcel[cfg.buyId]
+    local region = human.region or "CN"
+    local buyItem = {}
+    BuyLogic.fontBuyItem(human, buyItem, cfg.buyId)
+    local skinId = cfg.content[1]
+    local skinCfg = SkinExcel[skinId]
+    local attrs = {}
+    for _,v in pairs(skinCfg.attrs) do 
+        attrs[#attrs + 1] = {
+            key = v[1],
+            value = v[2],
+        }
+    end
+    local iconframeId = cfg.content[2]
+    local iconframeCfg = HeadFrameExcel[iconframeId]
+    local headNet = {}
+	headNet.id = iconframeId 
+	headNet.desc = iconframeCfg.desc or ""
+	headNet.keepTime = iconframeCfg.keepTime
+	headNet.name = iconframeCfg.name or ""
+	headNet.camp = iconframeCfg.camp or 0
+    local len = #iconframeCfg.attrs
+    headNet.attrs = {}
+    for i = 1,len do
+        headNet.attrs[i] = {
+            key = iconframeCfg.attrs[i][1],
+            value = iconframeCfg.attrs[i][2],
+        }
+    end
+    return {
+        id = id,
+        buyItem = buyItem,
+        skinData = {
+            Id = skinId,
+            attrs = attrs
+        },
+        Iconframe = headNet
+    }
+end
+
+-----------------------------------------
+
+function query(human,panelId)
+    local ret = {}
+    for id,cfg in pairs(HeroSkinExcel) do
+        if cfg.panelId == panelId then
+            ret[#ret+1] = genSkinUnit(human,id)
+        end
+    end
+    return {
+        list = ret
+    }
+end
+
+function buy(human,buyId)
+    local skinCfg
+    for _,cfg in pairs(HeroSkinExcel) do
+        if cfg.buyId == buyId then 
+            skinCfg = cfg
+            break
+        end
+    end
+    assert(skinCfg,"invalid buyId")
+    -- 解锁皮肤和头像
+    SkinLogic.skinUnlock(human,skinCfg.content[1]) --BagLogic.addItemList(human,skinCfg.content,"skin_buy")
+    RoleHeadLogic.active(human,RoleHeadLogic.HEAD_TYPE_2,skinCfg.content[2])
+    --刷新
+    local data=query(human,skinCfg.panelId)
+    RefreshClient(human,GC_SKIN_QUERY,data)
+end
+
+function RefreshClient(human,type,data) 
+    local msgRet = Msg.gc.GC_ROLE_CHANGE_BASEINFO
+    msgRet.ret = type
+    msgRet.tip = Json.Encode(data)
+    Msg.send(msgRet,human.fd)
 end

+ 1 - 0
script/module/role/RoleDBLogic.lua

@@ -427,6 +427,7 @@ function createDefaultRole(account)
 		talismanData = nil,						--秘宝
 		OnlineRewardData = nil,					--在线奖励
 		nSpeed = nil,							-- 特权战斗速度
+		tBuyVoucherInflate = nil,				-- 代金券 - 膨胀记录(nStatus = 0,nil 未购买,1已购买, nTime = 购买时间)
 		
         mergeInfo = {},   --融合信息 {mergeStartTime: 0 , mergeTime: 0, mergeEndTime: 0, heroId: 0}
 		gift = {

+ 1 - 0
script/module/scene/Proto.lua

@@ -56,6 +56,7 @@ GC_ZZ_HUMAN_INFO = {
     {"drawCardRateList",      1, "string"}, -- 抽奖等级概率列表
 	{"warOrder" ,       4, WarOrder},         -- 战令信息
 	{"nSpeed",			5,	"short"},		-- 速度
+	{"nServerIndex",	1,	"int"},			-- 服务器Index
 }
 GC_ENTER_CITY = {}
 

+ 8 - 2
script/module/topup/BuyLogic.lua

@@ -41,6 +41,7 @@ local OrderExcel = require("excel.warOrder")
 local WarOrderLogic = require("shop.WarOrder")
 local GiftExcel = require("excel.buy").gift
 local GiftLogic = require("topup.GiftLogic")
+local VoucherShopLogic = require("voucher.VoucherShopLogic")
 local MaiDianDefine = require("MaiDian.MaiDianDefine")
 local MainDianLogic = require("MaiDian.MaiDianLogic")
 local NewFirstCharge = require("present.NewFirstChargeLogic")
@@ -135,6 +136,7 @@ function fontBuyItem(human, net, buyID)
 	net.vipExp = conf.vipExp
 	net.yuanjia = conf.oCN
 	net.zhekou = conf.zhekou
+	net.voucher = conf.Voucher
 end
 
 -------------------------------- cmd开始 ----------------------------------
@@ -259,6 +261,11 @@ function cmd.warOrder(human,buyConf)
 	end
 end
 
+function cmd.voucherbuy(human, buyConf, isFirst, buyCnt)
+	local nBuyID = buyConf.id
+	VoucherShopLogic.VoucherShop_OnBuyVoucher(human, nBuyID)
+end
+
 function cmd.newfirstcharge(human, buyConf, isFirst, buyCnt)
 	local nBuyID = buyConf.id
 	print("[cmd.newfirstcharge] nBuyID = "..nBuyID)
@@ -344,8 +351,7 @@ function afterCharge(human,oJsonInput, buyID, buyConf)
 	--local price = oJsonInput.topupMoney
 	local buyConf = BuyExcel[buyID]
 	local price = oJsonInput.price or buyConf.CN
-	
-	if price and price > 0 then
+	if price and price > 0 and buyConf.cmd ~= "voucherbuy" then
 		TopupLogic.clacTopupAcount(human, price, buyID)
 		
 		local msgRet = Msg.gc.GC_NOTICE_DADIAN

+ 2 - 1
script/module/topup/Proto.lua

@@ -18,6 +18,7 @@ BuyItem = {
 	{"vipExp",		1,		"int"},			-- 附赠vip经验
 	{"zhekou",      1,      "int"},         -- 折扣
 	{"yuanjia",     1,      "int"},         -- 原价
+	{"voucher",		1,		"int"},			-- 代金券
 }
 
 TopupItemNet = {
@@ -26,7 +27,7 @@ TopupItemNet = {
 }
 
 GC_TOPUP_QUERY = {
-	{"list",		10,		TopupItemNet},
+	{"list",		20,		TopupItemNet},
 }
 
 CG_BUY_CHECK = {

+ 23 - 0
script/module/voucher/Handler.lua

@@ -0,0 +1,23 @@
+--------------------------------
+-- 文件名       :  Voucher/Proto.lua
+-- 文件说明     :  代金券协议 处理
+-- 创建时间     :   2024/12/16
+-- 创建人       :   FC
+--------------------------------
+
+local voucherShopLogic = require("voucher.VoucherShopLogic")
+
+-- 请求代金券商店信息
+function CG_VOUCHER_QUERY_SHOP(human, msg)
+    voucherShopLogic.VoucherShop_QueryShop(human)
+end
+
+-- 请求代金券膨胀信息
+function CG_VOUCHER_QUERY_INFLATE(human, msg)
+    voucherShopLogic.VoucherShop_QueryInflate(human)
+end
+
+-- 请求代金券购买商品
+function CG_VOUCHER_BUY_ITEM(human, msg)
+    voucherShopLogic.VoucherShop_BuyItem(human, msg.nBuyID)
+end

+ 48 - 0
script/module/voucher/Proto.lua

@@ -0,0 +1,48 @@
+--------------------------------
+-- 文件名       :  Voucher/Proto.lua
+-- 文件说明     :  代金券协议定义
+-- 创建时间     :   2024/12/16
+-- 创建人       :   FC
+--------------------------------
+
+local ItemData = require("bag.Proto").ItemData
+local HeroSimple = require("hero.Proto").HeroSimple
+local BuyItem = require("topup.Proto").BuyItem
+
+-- 代金券商品信息
+VOUCHERDATA = 
+{
+    {"nID",                     1,          "int"},     -- ID
+    --{"nGetVoucherNum",          1,          "int"},     -- 获得代金券数量
+    {"item",                    1,          ItemData},     -- 代金券
+    {"tBuyItem",                1,          BuyItem},   -- 购买物品信息
+}
+
+
+-- 请求代金券商店信息
+CG_VOUCHER_QUERY_SHOP = {}
+
+-- 请求代金券商店信息返回
+GC_VOUCHER_QUERY_SHOP =
+{
+    {"tVoucherData",            15,          VOUCHERDATA},     -- ID
+}
+
+-- 请求代金券膨胀信息
+CG_VOUCHER_QUERY_INFLATE = {}
+
+-- 请求代金券膨胀信息返回
+GC_VOUCHER_QUERY_INFLATE = 
+{
+    {"tVoucherData",            15,          VOUCHERDATA},      -- ID
+    {"tVoucherText",            21,          "string"},         -- 膨胀信息
+    {"nStatus",                 1,           "byte"},           -- 是否购买(0:未购买,1:已购买)
+}
+
+-- 请求代金券购买商品
+CG_VOUCHER_BUY_ITEM = 
+{
+    {"nBuyID",                  1,          "int"}
+}
+
+-- 无回包

+ 22 - 0
script/module/voucher/VoucherShopDefine.lua

@@ -0,0 +1,22 @@
+--------------------------------
+-- 文件名       :  VoucherShopDefine.lua
+-- 文件说明     :  代金券 - 通用定义
+-- 创建时间     :   2024/12/16
+-- 创建人       :   FC
+--------------------------------
+
+-- 膨胀概率
+INFLATIONPROBABILITY = 
+{
+    [2]     =   89.99,
+    [5]     =   99.99,  -- 10.0,
+    [10]    =   100,    -- 0.01,
+}
+
+VOUCHERITME_ID = 31             -- 代金券物品ID
+
+VOUCHERTYPE_SHOP = 1            -- 商店
+VOUCHERTYPE_INFLATION = 2       -- 膨胀
+
+VOUCHERSTATUS_NOGET = 0         -- 未获取
+VOUCHERSTATUS_GET = 1           -- 已获取

+ 385 - 0
script/module/voucher/VoucherShopLogic.lua

@@ -0,0 +1,385 @@
+--------------------------------
+-- 文件名       :  Voucher/Proto.lua
+-- 文件说明     :  代金券 - 通用定义
+-- 创建时间     :   2024/12/16
+-- 创建人       :   FC
+--------------------------------
+
+local VoucherShopDefine = require("voucher.VoucherShopDefine")
+local BuyExcel = require("excel.buy")
+local Util = require("common.Util")
+local Lang = require("common.Lang")
+local Broadcast = require("broadcast.Broadcast")
+local MailExcel = require("excel.mail")
+local Msg = require("core.Msg")
+local ObjHuman = require("core.ObjHuman")
+local CommonDB = require("common.CommonDB")
+local MailManager = require("mail.MailManager")
+local Grid = require("bag.Grid")
+local HeroGrid = require("hero.HeroGrid")
+local HeroLogic = require("hero.HeroLogic")
+local BagLogic = require("bag.BagLogic")
+local Log = require("common.Log")
+local BuyLogic = require("topup.BuyLogic")
+
+
+-- 商店配置
+local tVoucherShopCof = nil
+
+-- 膨胀配置
+local tVoucherInflateCof = nil
+
+----------------------------------------- 内部处理开始 -------------------------------------
+local function VoucherShop_GetConfig()
+    return BuyExcel.VoucherShop
+end
+
+-- 写日志
+local function VoucherShop_WriteLog(human, szFuncName, sztext)
+    Log.write(Log.LOGID_OSS_VOUCHERSHOP, szFuncName..sztext.." _id = "..human.db._id.." name = "..human.db.name)
+end
+
+local function VoucherShop_InitShopConfig()
+    local tAllConfig = VoucherShop_GetConfig()
+    if not tAllConfig then
+        return
+    end
+
+    tVoucherShopCof = {}
+    for nID, v in pairs(tAllConfig) do
+        if VoucherShopDefine.VOUCHERTYPE_SHOP == v.nType then
+            tVoucherShopCof[v.buyID] = 
+            {
+                nID = nID,
+                tData = v
+            }
+        end
+    end
+end
+
+local function VoucherShop_InitInflateConfig()
+    local tAllConfig = VoucherShop_GetConfig()
+    if not tAllConfig then
+        return
+    end
+
+    tVoucherInflateCof = {}
+    for nID, v in pairs(tAllConfig) do
+        if VoucherShopDefine.VOUCHERTYPE_INFLATION == v.nType then
+            tVoucherInflateCof[v.buyID] = 
+            {
+                nID = nID,
+                tData = v
+            }
+        end
+    end
+end
+
+-- 获取商店配置
+local function VoucherShop_GetShopConfig()
+    if not tVoucherShopCof then
+        VoucherShop_InitShopConfig()
+    end
+
+    return tVoucherShopCof
+end
+
+-- 获取膨胀配置
+local function VoucherShop_GetInflateConfig()
+    if not tVoucherInflateCof then
+        VoucherShop_InitInflateConfig()
+    end
+
+    return tVoucherInflateCof
+end
+
+
+-- 重置购买状态信息
+local function VoucherShop_RestStatus(human)
+    if not human then
+        return
+    end
+
+    human.db.tBuyVoucherInflate = {
+        nStatus = VoucherShopDefine.VOUCHERSTATUS_NOGET,
+        nTime = 0
+    }
+end
+
+-- 获取购买状态信息
+local function VoucherShop_GetStatus(human)
+    if not human then
+        return
+    end
+
+    if not human.db.tBuyVoucherInflate then
+        VoucherShop_RestStatus(human)
+    end
+
+    return human.db.tBuyVoucherInflate
+end
+
+-- 设置购买状态
+local function VoucherShop_SetStatus(human, nStatus, nTime)
+    if not human then
+        return
+    end
+
+    if not human.db.tBuyVoucherInflate then
+        VoucherShop_RestStatus(human)
+    end
+
+    human.db.tBuyVoucherInflate.nStatus = nStatus
+    human.db.tBuyVoucherInflate.nTime = nTime
+end
+
+local function VoucherShop_GetAddNum(tConfig)
+    if not tConfig then
+        return 0, 0
+    end
+
+    table.print_lua_table(tConfig)
+    local nMultiple = 1
+    local nNum = tConfig.tData.nGetVoucherNum
+    if VoucherShopDefine.VOUCHERTYPE_INFLATION == tConfig.tData.nType then
+        local nRandNum = math.random(1, 100)
+        for nID, v in pairs(VoucherShopDefine.INFLATIONPROBABILITY) do
+            if nRandNum <= v then
+                nMultiple = nID
+                break
+            end
+        end
+    end
+
+    nNum = nMultiple * nNum
+
+    return nNum, nMultiple
+end
+
+----------------------------------------- 其他模块调用 -------------------------------------
+-- 购买回调
+function VoucherShop_OnBuyVoucher(human, nBuyID)
+    if not human or not nBuyID then
+        return
+    end
+
+    -- 记录一下日志
+    local sztext = " nBuyID = "..nBuyID
+    VoucherShop_WriteLog(human, "[VoucherShop_OnBuyVoucher]", "玩家购买代金券回调记录开始 "..sztext)
+
+    local tShopCof = VoucherShop_GetShopConfig()
+    local tInflateConfig = VoucherShop_GetInflateConfig()
+    if not tShopCof or not tInflateConfig then
+        print("[VoucherShop_OnBuyVoucher] 获取配置失败 name = "..human.db.name..sztext)
+        VoucherShop_WriteLog(human, "[VoucherShop_OnBuyVoucher]", "玩家购买代金券回调获取不到配置 "..sztext)
+        return
+    end
+
+    local nAddNum, nMultiple = VoucherShop_GetAddNum(tShopCof[nBuyID] or tInflateConfig[nBuyID])
+    if 0 >= nAddNum or 0 >= nMultiple then
+        sztext = sztext.." nAddNum = "..nAddNum.." nMultiple = "..nMultiple
+        print("[VoucherShop_OnBuyVoucher] 获取增加的数量和倍率失败 name = "..human.db.name..sztext)
+        VoucherShop_WriteLog(human, "[VoucherShop_OnBuyVoucher]", "获取增加的数量和倍率失败 nBuyID = "..sztext)
+        return
+    end
+
+    -- 给物品
+    BagLogic.addItem(human, VoucherShopDefine.VOUCHERITME_ID, nAddNum, "voucher_use")
+
+    -- 弹窗
+    BagLogic.sendItemGetList(human, {{VoucherShopDefine.VOUCHERITME_ID, nAddNum}}, "voucher_use")
+
+    if nMultiple > 1 then
+        local szInflateText = "恭喜【"..human.db.name.."】通过刮刮乐获得"..nAddNum.."代金券"
+        CommonDB.setVoucherInflate(szInflateText, os.time())
+
+        VoucherShop_SetStatus(human, VoucherShopDefine.VOUCHERSTATUS_GET, os.time())
+        VoucherShop_QueryInflate(human)
+    end
+
+    VoucherShop_WriteLog(human, "[VoucherShop_OnBuyVoucher]", "玩家购买代金券回调记录结束 "..sztext)
+end
+
+-- 定时回调
+function VoucherShop_OnZero()
+     -- 遍历在线玩家
+    for uuid, human in pairs(ObjHuman.onlineUuid) do
+        VoucherShop_RestStatus(human)
+    end
+end
+
+-- 玩家登录
+function onLogin(human)
+    if not human then
+        return
+    end
+
+    local tStatus = VoucherShop_GetStatus(human)
+    if not tStatus then
+        return
+    end
+
+    if tStatus.nStatus == VoucherShopDefine.VOUCHERSTATUS_GET then
+        local nOldTime = tStatus.nTime
+        local nNowTime = os.time()
+        local sameDay = Util.isSameDayByTimes(nNowTime, nOldTime)
+        if false == sameDay then
+            VoucherShop_RestStatus(human)
+            VoucherShop_WriteLog(human, "[VoucherShop_OnBuyVoucher]", "玩家登录重置购买状态 nOldTime = "..nOldTime.." nNowTime = "..nNowTime)
+        end 
+    end
+end
+
+
+----------------------------------------- 客户端请求 -------------------------------------
+-- 请求代金券商店信息
+function VoucherShop_QueryShop(human)
+    if not human then
+        return
+    end
+
+    local tConfig = VoucherShop_GetShopConfig()
+    if not tConfig then
+        VoucherShop_WriteLog(human, "[VoucherShop_QueryShop]", "获取商店配置失败")
+        print("[VoucherShop_QueryShop] 获取商店配置失败")
+        return
+    end
+
+    local tMsgData = Msg.gc.GC_VOUCHER_QUERY_SHOP
+    --tMsgData.tVoucherData[0] = #tConfig
+
+    local nIndex = 1
+    for nBuyID, v in pairs(tConfig) do
+       local tData =  tMsgData.tVoucherData[nIndex]
+       tData.nID = v.nID
+       --tData.nGetVoucherNum = v.tData.nGetVoucherNum
+       Grid.makeItem(tData.item, VoucherShopDefine.VOUCHERITME_ID, v.tData.nGetVoucherNum)
+
+       print("[VoucherShop_QueryShop] nID = "..tData.nID.." nGetVoucherNum = "..v.tData.nGetVoucherNum)
+       BuyLogic.fontBuyItem(human, tData.tBuyItem, nBuyID)
+       nIndex = nIndex +1
+    end
+
+    print("[VoucherShop_QueryShop] nIndex = "..nIndex)
+    tMsgData.tVoucherData[0] = nIndex - 1
+    Msg.send(tMsgData, human.fd)
+end
+
+-- 请求代金券膨胀信息
+function VoucherShop_QueryInflate(human)
+    if not human then
+        return
+    end
+
+    local tConfig = VoucherShop_GetInflateConfig()
+    if not tConfig then
+        VoucherShop_WriteLog(human, "[VoucherShop_QueryInflate]", "获取膨胀配置失败")
+        print("[VoucherShop_QueryInflate] 获取膨胀配置失败")
+        return
+    end
+
+    local tStatus = VoucherShop_GetStatus(human)
+    if not tStatus then
+        VoucherShop_WriteLog(human, "[VoucherShop_QueryInflate]", "获取状态信息失败")
+        print("[VoucherShop_QueryInflate] 获取状态信息失败")
+        return
+    end
+
+    local tMsgData = Msg.gc.GC_VOUCHER_QUERY_INFLATE
+    tMsgData.nStatus = tStatus.nStatus
+    --tMsgData.tVoucherData[0] = #tConfig
+
+    local nIndex = 1
+    for nBuyID, v in pairs(tConfig) do
+       local tData =  tMsgData.tVoucherData[nIndex]
+       tData.nID = v.nID
+      
+       Grid.makeItem(tData.item, VoucherShopDefine.VOUCHERITME_ID, v.tData.nGetVoucherNum)
+
+       BuyLogic.fontBuyItem(human, tData.tBuyItem, nBuyID)
+       nIndex = nIndex +1
+    end
+    tMsgData.tVoucherData[0] = nIndex - 1
+
+    local szTextInfo = CommonDB.getVoucherInflate()
+    tMsgData.tVoucherText[0] = 0
+    if szTextInfo then
+        local nLen = #szTextInfo
+        tMsgData.tVoucherText[0] = nLen > 20 and 20 or nLen
+        for i, v in pairs(szTextInfo) do
+            if i > 20 then
+                break
+            end
+            tMsgData.tVoucherText[i] = v.szText
+            print("[VoucherShop_QueryInflate] szText = "..v.szText)
+        end
+    end
+
+    table.print_lua_table(tMsgData.tVoucherText)
+    print("[VoucherShop_QueryInflate] nIndex = "..nIndex)
+
+    Msg.send(tMsgData, human.fd)
+end
+
+-- 请求代金券购买商品
+function VoucherShop_BuyItem(human, nBuyID)
+    if not human or 0 >= nBuyID then
+        return
+    end
+
+    local tBuyConfig = VoucherShop_GetShopConfig()
+    local tInflateConfig = VoucherShop_GetInflateConfig()
+    if not tBuyConfig or not tInflateConfig then
+        return
+    end
+
+    if tBuyConfig[nBuyID] or tInflateConfig[nBuyID] then
+        print("[VoucherShop_BuyItem] 玩家使用代金券购买代金券礼品,直接返回")
+        VoucherShop_WriteLog(human, "[VoucherShop_BuyItem]", "玩家使用代金券购买代金券礼品,直接返回")
+        return
+    end
+    
+    local tTrueBuyConfig = BuyExcel.buy[nBuyID]
+    if not tTrueBuyConfig then
+        print("[VoucherShop_BuyItem] 不存在对应的商品信息 nBuyID = "..nBuyID)
+        return
+    end
+
+    local nDelVoucherNum = tTrueBuyConfig.Voucher
+    if 0 >= nDelVoucherNum then
+        print("[VoucherShop_BuyItem] 该商品无法用代金券购买,配置的数量为空 nBuyID = "..nBuyID.." nDelVoucherNum = "..nDelVoucherNum)
+        return
+    end
+
+    -- 删物品
+    BagLogic.delItem(human, VoucherShopDefine.VOUCHERITME_ID, nDelVoucherNum, "voucher_use")
+
+    -- 发道具
+    local tBuyInfo = 
+    {
+        buyID = nBuyID,
+        price = tTrueBuyConfig.CN
+    }
+    BuyLogic.buy(human, tBuyInfo)
+
+    -- 写日志
+    local szText = "玩家购买使用代金券购买了物品 nBuyID = "..nBuyID.." 消耗代金券数量 nDelVoucherNum = "..nDelVoucherNum
+    VoucherShop_WriteLog(human, "[VoucherShop_BuyItem]", szText)
+end
+
+
+----------------------------------------- 活动模板调用 -------------------------------------
+-- 是否开启
+function isOpen(human, YYInfo, funcConfig)
+    return true
+end
+
+-- 活动剩余时间
+function getLeftTime()
+    return 9999999
+end
+
+-- 是否存在红点
+function isRed(human)
+    return false
+end