|
@@ -1,5 +1,5 @@
|
|
|
-------------------------------------------------------
|
|
-------------------------------------------------------
|
|
|
--- 战报
|
|
|
|
|
|
|
+-- 战锟斤拷
|
|
|
|
|
|
|
|
--
|
|
--
|
|
|
-------------------------------------------------------
|
|
-------------------------------------------------------
|
|
@@ -29,21 +29,21 @@ local RoleSystemDefine = require("roleSystem.RoleSystemDefine")
|
|
|
local ItemDefine = require("bag.ItemDefine")
|
|
local ItemDefine = require("bag.ItemDefine")
|
|
|
local HeroGrowUp = require("absAct.HeroGrowUp")
|
|
local HeroGrowUp = require("absAct.HeroGrowUp")
|
|
|
|
|
|
|
|
-WAR_REPORT_1 = 1 -- 冠军联赛
|
|
|
|
|
-WAR_REPORT_2 = 2 -- 王者争霸
|
|
|
|
|
-WAR_REPORT_3 = 3 -- 天梯
|
|
|
|
|
-WAR_REPORT_4 = 4 -- 切磋
|
|
|
|
|
|
|
+WAR_REPORT_1 = 1 -- 锟节撅拷锟斤拷锟斤拷
|
|
|
|
|
+WAR_REPORT_2 = 2 -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
|
|
+WAR_REPORT_3 = 3 -- 锟斤拷锟斤拷
|
|
|
|
|
+WAR_REPORT_4 = 4 -- 锟叫达拷
|
|
|
WAR_COUNT_MAX = 30
|
|
WAR_COUNT_MAX = 30
|
|
|
WAR_COUNT_MAX1 = 20
|
|
WAR_COUNT_MAX1 = 20
|
|
|
WAR_JJC_RANK = 20
|
|
WAR_JJC_RANK = 20
|
|
|
WAR_FRIEND_RANK = 30
|
|
WAR_FRIEND_RANK = 30
|
|
|
-WAR_ADMIRE = 3 -- 点赞次数
|
|
|
|
|
-WAR_COMBATINFO_PLAYBACK = 1 -- 请求战斗数据用于回方
|
|
|
|
|
-WAR_COMBATINFO_HARM = 2 -- 请求战斗数据用于伤害列表
|
|
|
|
|
-WAR_OP_CONFIRM = 1 --确认
|
|
|
|
|
-WAR_OP_CANCEL = 0 --取消
|
|
|
|
|
-WAP_OP_TYPE1 = 1 --点赞
|
|
|
|
|
-WAP_OP_TYPE2 = 2 --收藏
|
|
|
|
|
|
|
+WAR_ADMIRE = 3 -- 锟斤拷锟睫达拷锟斤拷
|
|
|
|
|
+WAR_COMBATINFO_PLAYBACK = 1 -- 锟斤拷锟斤拷战锟斤拷锟斤拷锟斤拷锟斤拷锟节回凤拷
|
|
|
|
|
+WAR_COMBATINFO_HARM = 2 -- 锟斤拷锟斤拷战锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟剿猴拷锟叫憋拷
|
|
|
|
|
+WAR_OP_CONFIRM = 1 --确锟斤拷
|
|
|
|
|
+WAR_OP_CANCEL = 0 --取锟斤拷
|
|
|
|
|
+WAP_OP_TYPE1 = 1 --锟斤拷锟斤拷
|
|
|
|
|
+WAP_OP_TYPE2 = 2 --锟秸诧拷
|
|
|
WAP_REWARD_GOD = 3000
|
|
WAP_REWARD_GOD = 3000
|
|
|
|
|
|
|
|
local war_report_count = {
|
|
local war_report_count = {
|
|
@@ -110,12 +110,12 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
function initAfterStart()
|
|
function initAfterStart()
|
|
|
- -- 非中心服返回
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟侥凤拷锟斤拷锟斤拷
|
|
|
if _G.is_middle ~= true then
|
|
if _G.is_middle ~= true then
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 添加记录索引
|
|
|
|
|
|
|
+ -- 锟斤拷锟接硷拷录锟斤拷锟斤拷
|
|
|
local war_count_data = {}
|
|
local war_count_data = {}
|
|
|
LuaMongo.find(DB.db_war_report, war_count_query)
|
|
LuaMongo.find(DB.db_war_report, war_count_query)
|
|
|
if LuaMongo.next(war_count_data) then
|
|
if LuaMongo.next(war_count_data) then
|
|
@@ -129,12 +129,12 @@ function initAfterStart()
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-- db_war_report
|
|
-- db_war_report
|
|
|
--- 添加记录 所有记录存中心服
|
|
|
|
|
|
|
+-- 锟斤拷锟接硷拷录 锟斤拷锟叫硷拷录锟斤拷锟斤拷锟侥凤拷
|
|
|
function add(type, combatInfo, atkRank, defRank)
|
|
function add(type, combatInfo, atkRank, defRank)
|
|
|
- -- 优化帧数据 降低
|
|
|
|
|
|
|
+ -- 锟脚伙拷帧锟斤拷锟斤拷 锟斤拷锟斤拷
|
|
|
CombatLogic.killFrames(combatInfo)
|
|
CombatLogic.killFrames(combatInfo)
|
|
|
|
|
|
|
|
- if _G.is_middle == true then
|
|
|
|
|
|
|
+ if not _G.is_middle then
|
|
|
WarReportMiddle.LW_WARREPORT_ADD(type, combatInfo, atkRank, defRank)
|
|
WarReportMiddle.LW_WARREPORT_ADD(type, combatInfo, atkRank, defRank)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
@@ -147,25 +147,26 @@ function add(type, combatInfo, atkRank, defRank)
|
|
|
InnerMsg.sendMsg(0, msgInner)
|
|
InnerMsg.sendMsg(0, msgInner)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 查询
|
|
|
|
|
|
|
+-- 锟斤拷询
|
|
|
function query(human, type, questType)
|
|
function query(human, type, questType)
|
|
|
if RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_202) ~= true then
|
|
if RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_202) ~= true then
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 天梯赛请求中心服 或者 个人收藏 先去中心服找数据
|
|
|
|
|
- local msgInner = InnerMsg.lw.LW_WARREPORT_QUERY
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥凤拷 锟斤拷锟斤拷 锟斤拷锟斤拷锟秸诧拷 锟斤拷去锟斤拷锟侥凤拷锟斤拷锟斤拷锟斤拷
|
|
|
|
|
+ --[[local msgInner = InnerMsg.lw.LW_WARREPORT_QUERY
|
|
|
|
|
+ local msgInner = {}
|
|
|
msgInner.uuid = human.db._id
|
|
msgInner.uuid = human.db._id
|
|
|
msgInner.type = type
|
|
msgInner.type = type
|
|
|
msgInner.questType = questType
|
|
msgInner.questType = questType
|
|
|
msgInner.warReport = human.db.warReport
|
|
msgInner.warReport = human.db.warReport
|
|
|
- InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
-
|
|
|
|
|
- human.db.warDot = nil
|
|
|
|
|
- RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_202)
|
|
|
|
|
|
|
+ InnerMsg.sendMsg(0, msgInner)]]
|
|
|
|
|
+ WarReportMiddle.LW_WARREPORT_QUERY(0,type,human.db._id,human.db.warReport,questType)
|
|
|
|
|
+ human.db.warDot = nil
|
|
|
|
|
+ RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_202)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 打包战报列表
|
|
|
|
|
|
|
+-- 锟斤拷锟秸斤拷锟斤拷斜锟�
|
|
|
local makeReportQuery = {war_index = { ["$exists"] = 1}}
|
|
local makeReportQuery = {war_index = { ["$exists"] = 1}}
|
|
|
function makeReport(type)
|
|
function makeReport(type)
|
|
|
local len = 0
|
|
local len = 0
|
|
@@ -189,7 +190,7 @@ function makeReport(type)
|
|
|
return war_data_list
|
|
return war_data_list
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 打包收藏
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷詹锟�
|
|
|
local makeCollectReportQuery = {_id = nil}
|
|
local makeCollectReportQuery = {_id = nil}
|
|
|
function makeCollectReport(collect)
|
|
function makeCollectReport(collect)
|
|
|
local war_data_list = {}
|
|
local war_data_list = {}
|
|
@@ -216,7 +217,7 @@ function makeCollectReport(collect)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 打包我的战报
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷业锟秸斤拷锟�
|
|
|
local makeMyReportQuery = {}
|
|
local makeMyReportQuery = {}
|
|
|
function makeMyReport(uuid)
|
|
function makeMyReport(uuid)
|
|
|
local len = 0
|
|
local len = 0
|
|
@@ -242,7 +243,7 @@ function makeMyReport(uuid)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 推送战报列表
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷战锟斤拷锟叫憋拷
|
|
|
local heroOther = {}
|
|
local heroOther = {}
|
|
|
function sendReport(human, war_data_list, questType)
|
|
function sendReport(human, war_data_list, questType)
|
|
|
local len = #war_data_list
|
|
local len = #war_data_list
|
|
@@ -253,7 +254,7 @@ function sendReport(human, war_data_list, questType)
|
|
|
msgRet.isEnd = 0
|
|
msgRet.isEnd = 0
|
|
|
local sendLen = 0
|
|
local sendLen = 0
|
|
|
|
|
|
|
|
- -- 刷新收藏
|
|
|
|
|
|
|
+ -- 刷锟斤拷锟秸诧拷
|
|
|
if questType == WAP_OP_TYPE2 then
|
|
if questType == WAP_OP_TYPE2 then
|
|
|
human.db.warReport = {}
|
|
human.db.warReport = {}
|
|
|
end
|
|
end
|
|
@@ -284,18 +285,18 @@ function sendReport(human, war_data_list, questType)
|
|
|
net.isCollect = 0
|
|
net.isCollect = 0
|
|
|
net.isAdmire = 0
|
|
net.isAdmire = 0
|
|
|
|
|
|
|
|
- -- 重置收藏列表
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟秸诧拷锟叫憋拷
|
|
|
if questType == WAP_OP_TYPE2 then
|
|
if questType == WAP_OP_TYPE2 then
|
|
|
warReport[net.type] = warReport[net.type] or {}
|
|
warReport[net.type] = warReport[net.type] or {}
|
|
|
warReport[net.type][net.id] = 1
|
|
warReport[net.type][net.id] = 1
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 是否已点赞
|
|
|
|
|
|
|
+ -- 锟角凤拷锟窖碉拷锟斤拷
|
|
|
if war.admireList and war.admireList[human.db._id] then
|
|
if war.admireList and war.admireList[human.db._id] then
|
|
|
net.isAdmire = 1
|
|
net.isAdmire = 1
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 是否已收藏
|
|
|
|
|
|
|
+ -- 锟角凤拷锟斤拷锟秸诧拷
|
|
|
for _, list in pairs(warReport) do
|
|
for _, list in pairs(warReport) do
|
|
|
if list[net.id] then
|
|
if list[net.id] then
|
|
|
net.isCollect = 1
|
|
net.isCollect = 1
|
|
@@ -338,18 +339,19 @@ function sendReport(human, war_data_list, questType)
|
|
|
|
|
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 伤害记录
|
|
|
|
|
|
|
+-- 锟剿猴拷锟斤拷录
|
|
|
function harm(human, type, id)
|
|
function harm(human, type, id)
|
|
|
- -- 天梯赛请求中心服
|
|
|
|
|
- local msgInner = InnerMsg.lw.LW_WARREPORT_GET_COMBATINFO
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥凤拷
|
|
|
|
|
+ local msgInner = {} --InnerMsg.lw.LW_WARREPORT_GET_COMBATINFO
|
|
|
msgInner.uuid = human.db._id
|
|
msgInner.uuid = human.db._id
|
|
|
msgInner.type = type
|
|
msgInner.type = type
|
|
|
msgInner.id = id
|
|
msgInner.id = id
|
|
|
msgInner.mode = WAR_COMBATINFO_HARM
|
|
msgInner.mode = WAR_COMBATINFO_HARM
|
|
|
- InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
|
|
+ --InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
+ WarReportMiddle.LW_WARREPORT_GET_COMBATINFO(0,msgInner)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 战斗结果
|
|
|
|
|
|
|
+-- 战锟斤拷锟斤拷锟�
|
|
|
function sendFinish(human, combatInfo)
|
|
function sendFinish(human, combatInfo)
|
|
|
if not combatInfo then return end
|
|
if not combatInfo then return end
|
|
|
local msgRet = Msg.gc.GC_WAR_REPROT_HARM
|
|
local msgRet = Msg.gc.GC_WAR_REPROT_HARM
|
|
@@ -359,19 +361,20 @@ function sendFinish(human, combatInfo)
|
|
|
Msg.send(msgRet,human.fd)
|
|
Msg.send(msgRet,human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 回放
|
|
|
|
|
|
|
+-- 锟截凤拷
|
|
|
function playBack(human, type, id)
|
|
function playBack(human, type, id)
|
|
|
- -- 天梯赛请求中心服
|
|
|
|
|
- local msgInner = InnerMsg.lw.LW_WARREPORT_GET_COMBATINFO
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥凤拷
|
|
|
|
|
+ local msgInner = {} --InnerMsg.lw.LW_WARREPORT_GET_COMBATINFO
|
|
|
msgInner.uuid = human.db._id
|
|
msgInner.uuid = human.db._id
|
|
|
msgInner.type = type
|
|
msgInner.type = type
|
|
|
msgInner.id = id
|
|
msgInner.id = id
|
|
|
msgInner.mode = WAR_COMBATINFO_PLAYBACK
|
|
msgInner.mode = WAR_COMBATINFO_PLAYBACK
|
|
|
- InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
|
|
+ --InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
+ WarReportMiddle.LW_WARREPORT_GET_COMBATINFO(0,msgInner)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 操作结果
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟�
|
|
|
function opResult(human, opType, id, result)
|
|
function opResult(human, opType, id, result)
|
|
|
local msgRet = Msg.gc.GC_WAR_REPORT_OP_RESULT
|
|
local msgRet = Msg.gc.GC_WAR_REPORT_OP_RESULT
|
|
|
msgRet.opType = opType
|
|
msgRet.opType = opType
|
|
@@ -380,7 +383,7 @@ function opResult(human, opType, id, result)
|
|
|
Msg.send(msgRet,human.fd)
|
|
Msg.send(msgRet,human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 收藏
|
|
|
|
|
|
|
+-- 锟秸诧拷
|
|
|
function collect(human, type, id, op)
|
|
function collect(human, type, id, op)
|
|
|
if op ~= WAR_OP_CONFIRM and op ~= WAR_OP_CANCEL then
|
|
if op ~= WAR_OP_CONFIRM and op ~= WAR_OP_CANCEL then
|
|
|
return
|
|
return
|
|
@@ -388,12 +391,12 @@ function collect(human, type, id, op)
|
|
|
|
|
|
|
|
local warReport = human.db.warReport
|
|
local warReport = human.db.warReport
|
|
|
if op == WAR_OP_CONFIRM then
|
|
if op == WAR_OP_CONFIRM then
|
|
|
- -- 已经在收藏列表
|
|
|
|
|
|
|
+ -- 锟窖撅拷锟斤拷锟秸诧拷锟叫憋拷
|
|
|
if warReport[type] and warReport[type][id] then
|
|
if warReport[type] and warReport[type][id] then
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 收藏条数
|
|
|
|
|
|
|
+ -- 锟秸诧拷锟斤拷锟斤拷
|
|
|
local collectCnt = 0
|
|
local collectCnt = 0
|
|
|
for k, v in pairs(warReport) do
|
|
for k, v in pairs(warReport) do
|
|
|
for _, data in pairs(v) do
|
|
for _, data in pairs(v) do
|
|
@@ -411,15 +414,16 @@ function collect(human, type, id, op)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- local msgInner = InnerMsg.lw.LW_WARREPORT_COLLECT
|
|
|
|
|
|
|
+ local msgInner = {} --InnerMsg.lw.LW_WARREPORT_COLLECT
|
|
|
msgInner.uuid = human.db._id
|
|
msgInner.uuid = human.db._id
|
|
|
msgInner.type = type
|
|
msgInner.type = type
|
|
|
msgInner.id = id
|
|
msgInner.id = id
|
|
|
msgInner.op = op
|
|
msgInner.op = op
|
|
|
- InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
|
|
+ --InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
+ WarReportMiddle.LW_WARREPORT_COLLECT(0,msgInner)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 收藏回馈
|
|
|
|
|
|
|
+-- 锟秸藏伙拷锟斤拷
|
|
|
function collectHumanDo(human, type, id, op)
|
|
function collectHumanDo(human, type, id, op)
|
|
|
if op ~= WAR_OP_CONFIRM and op ~= WAR_OP_CANCEL then
|
|
if op ~= WAR_OP_CONFIRM and op ~= WAR_OP_CANCEL then
|
|
|
return
|
|
return
|
|
@@ -437,7 +441,7 @@ function collectHumanDo(human, type, id, op)
|
|
|
opResult(human, WAP_OP_TYPE2, id, op)
|
|
opResult(human, WAP_OP_TYPE2, id, op)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 点赞
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷
|
|
|
function admire(human, type, id)
|
|
function admire(human, type, id)
|
|
|
if human.db.warAdmire == nil then
|
|
if human.db.warAdmire == nil then
|
|
|
return Broadcast.sendErr(human, Lang.WAR_REPORT_ADMIRE_NOT_ENOUGH)
|
|
return Broadcast.sendErr(human, Lang.WAR_REPORT_ADMIRE_NOT_ENOUGH)
|
|
@@ -451,13 +455,14 @@ function admire(human, type, id)
|
|
|
|
|
|
|
|
HeroGrowUp.onCallback(human, HeroGrowUp.TASKTYPE6, 1)
|
|
HeroGrowUp.onCallback(human, HeroGrowUp.TASKTYPE6, 1)
|
|
|
|
|
|
|
|
- local msgInner = InnerMsg.lw.LW_WARREPORT_ADMIRE
|
|
|
|
|
|
|
+ local msgInner = {} --InnerMsg.lw.LW_WARREPORT_ADMIRE
|
|
|
msgInner.uuid = human.db._id
|
|
msgInner.uuid = human.db._id
|
|
|
msgInner.id = id
|
|
msgInner.id = id
|
|
|
- InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
|
|
+ --InnerMsg.sendMsg(0, msgInner)
|
|
|
|
|
+ WarReportMiddle.LW_WARREPORT_ADMIRE(0,msgInner)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 点赞回馈
|
|
|
|
|
|
|
+-- 锟斤拷锟睫伙拷锟斤拷
|
|
|
function admireDo(human, id)
|
|
function admireDo(human, id)
|
|
|
BagLogic.cleanMomentItemList()
|
|
BagLogic.cleanMomentItemList()
|
|
|
BagLogic.updateMomentItem(BagLogic.ADDITEM_TYPE_1, ItemDefine.ITEM_JINBI_ID, WAP_REWARD_GOD)
|
|
BagLogic.updateMomentItem(BagLogic.ADDITEM_TYPE_1, ItemDefine.ITEM_JINBI_ID, WAP_REWARD_GOD)
|