diff --git a/config/basic.lua b/config/basic.lua index 1e72213..107861b 100644 --- a/config/basic.lua +++ b/config/basic.lua @@ -1,8 +1,5 @@ root = "./" --- logger = "server.log" -logger = "services/errorlog" -logservice = "snlua" - +logger = "server.log" harbor = 0 start = "main" -- main script bootstrap = "snlua bootstrap" -- The service for bootstrap @@ -12,19 +9,4 @@ lualoader = "skynet/lualib/loader.lua" preload = "./src/preload.lua" -- run preload.lua before every lua service run cpath = root.."skynet/cservice/?.so" lua_cpath = "skynet/luaclib/?.so" -cluster = "./config/nodenames.lua" - -codeurl = "10.235.14.85:9001" -logd = 1 -- 是否开启日志 -thread = 16 -max_client = 4100 -debug_port = 10001 -httpweb_port = 11001 - -serverType = "ob" -max_queue = 500 - -redis_port = 6379 -redis_db = 0 -redis_auth = "VraDMcdX=Jq!Ess4" -server_port = 20001 \ No newline at end of file +cluster = "./config/nodenames.lua" \ No newline at end of file diff --git a/config/nodenames.lua b/config/nodenames.lua index 4e51460..d10a8a4 100644 --- a/config/nodenames.lua +++ b/config/nodenames.lua @@ -1,12 +1,4 @@ -center = "10.235.14.85:12000" +center = "192.168.0.198:9000" -server1 = "10.235.14.30:12001" -server2 = "10.235.14.218:12001" -server3 = "10.235.14.217:12001" -server4 = "10.235.14.70:12001" -server5 = "10.235.14.224:12001" -server6 = "10.235.14.24:12001" -server7 = "10.235.14.191:12001" -server8 = "10.235.14.75:12001" -server9 = "10.235.14.119:12001" -server10 = "10.235.14.67:12001" +server1 = "127.0.0.1:8101" +server2 = "127.0.0.1:8102" \ No newline at end of file diff --git a/config/server1.lua b/config/server1.lua deleted file mode 100644 index d074fe3..0000000 --- a/config/server1.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 1 -redis_host = "10.235.0.138" \ No newline at end of file diff --git a/config/server10.lua b/config/server10.lua deleted file mode 100644 index fc910dc..0000000 --- a/config/server10.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 10 -redis_host = "10.235.0.189" \ No newline at end of file diff --git a/config/server2.lua b/config/server2.lua deleted file mode 100644 index b0b6f7a..0000000 --- a/config/server2.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 2 -redis_host = "10.235.0.157" diff --git a/config/server3.lua b/config/server3.lua deleted file mode 100644 index dcd2bfe..0000000 --- a/config/server3.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 3 -redis_host = "10.235.0.169" diff --git a/config/server4.lua b/config/server4.lua deleted file mode 100644 index 8bc2b9e..0000000 --- a/config/server4.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 4 -redis_host = "10.235.0.251" \ No newline at end of file diff --git a/config/server5.lua b/config/server5.lua deleted file mode 100644 index a91653e..0000000 --- a/config/server5.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 5 -redis_host = "10.235.0.148" \ No newline at end of file diff --git a/config/server6.lua b/config/server6.lua deleted file mode 100644 index bd2bd92..0000000 --- a/config/server6.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 6 -redis_host = "10.235.0.12" \ No newline at end of file diff --git a/config/server7.lua b/config/server7.lua deleted file mode 100644 index 6f8ff12..0000000 --- a/config/server7.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 7 -redis_host = "10.235.0.133" \ No newline at end of file diff --git a/config/server8.lua b/config/server8.lua deleted file mode 100644 index d17b6d7..0000000 --- a/config/server8.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 8 -redis_host = "10.235.0.139" \ No newline at end of file diff --git a/config/server9.lua b/config/server9.lua deleted file mode 100644 index a27be0d..0000000 --- a/config/server9.lua +++ /dev/null @@ -1,5 +0,0 @@ -include("basic.lua") - - -servId = 9 -redis_host = "10.235.0.15" \ No newline at end of file diff --git a/src/GlobalVar.lua b/src/GlobalVar.lua index e1c35e1..a55cc9c 100644 --- a/src/GlobalVar.lua +++ b/src/GlobalVar.lua @@ -84,7 +84,6 @@ ItemType = { SelectItemBox = 17, -- 自选箱子 CommonPaster = 18, -- 万能贴纸 BossTicket = 20, -- boss挑战门票 - Spark = 21, -- 火花 } --在这个里面的会记录的是功能开放 对应类型open 而不是 ID @@ -364,7 +363,6 @@ TriggerEventType = { SSRCount = 6, AfterTs = 7, -- 某时间以后 DrawHeroCnt = 8, -- 每日抽卡次数 - Appoint = 0, -- 触发指定id礼包 } DrawCardType = { diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index 8e8e47e..5557871 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -51,8 +51,6 @@ actionCodes = { Role_broadGetSSR = 135, -- 全服广播 获得ssr英雄 Role_renameTeamRpc = 136, -- 编队改名 Role_accuseRpc = 137, -- 举报 - Role_loadSparks = 138, - Role_updateSpark = 139, -- 更新火花 Adv_startAdvRpc = 151, Adv_startHangRpc = 152, @@ -104,7 +102,6 @@ actionCodes = { Hero_drawHeroExtraRewardNtf = 224, Hero_itemComposeRpc = 225, Hero_setWishPoolRpc = 226, - Hero_changeSparkRpc = 227, Hang_startRpc = 251, Hang_checkRpc = 252, @@ -155,8 +152,6 @@ actionCodes = { Car_runeUpRpc = 402, Car_saleEquipRpc = 403, Car_saleRuneRpc = 404, - Car_sparkLvlUpRpc = 405, - Car_sparkQualityUpRpc = 406, Friend_searchRpc = 450, @@ -246,7 +241,6 @@ actionCodes = { Activity_newSignRpc = 670, Activity_advLevelRpc = 671, Activity_buyBattleCommandLvlRpc = 672, - Activity_returnerTaskRpc = 673, Radio_startQuestRpc = 700, Radio_finishQuestRpc = 701, diff --git a/src/RedisKeys.lua b/src/RedisKeys.lua index 068340a..3a5660d 100644 --- a/src/RedisKeys.lua +++ b/src/RedisKeys.lua @@ -14,8 +14,6 @@ R_EMAIL_ITEM = "email:%d:%d" --邮件 R_STORE = "role:%d:store" -- 商店 R_ORDERS = "role:%d:orders" -- 订单 R_ORDER = "order:%d:%d" -R_SPARKIDS = "role:%d:sparkIds" -- 玩家拥有火花自增id -R_SPARK = "role:%d:spark:%d" -- 火花详细信息 -- 通用排行榜 RANK_COMMON = "rank:common:" diff --git a/src/actions/ActivityAction.lua b/src/actions/ActivityAction.lua index 278a90f..0fd631e 100644 --- a/src/actions/ActivityAction.lua +++ b/src/actions/ActivityAction.lua @@ -1370,52 +1370,4 @@ function _M.advLevelRpc(agent, data) return true end -function _M.returnerTaskRpc(agent, data) - local role = agent.role - local msg = MsgPack.unpack(data) - - local taskId = msg.id or 0 - if taskId == 0 then return 0 end - - local returner = role:getProperty("returner") or {} - if not returner[taskId] then return 1 end - - local tday = specTime({hour = 4}) - local curAllDay = (tday - returner.time) / 86400 + 1 - - local TaskCsv = csvdb["activity_taskCsv"][76] or {} - local taskData = TaskCsv[taskId] - if not taskData then return 2 end - if curAllDay < taskData.day then return 2 end - - local status = returner.status or {} - if status[taskId] then return 3 end - - status[taskId] = 1 - returner.status = status - - local done = true - for _, data in pairs(TaskCsv) do - if not status[data.id] then - done = false - break - end - end - - if done then - returner = {} - end - - local reward, change = role:award(taskData.reward, {log = {desc = "returner", int1 = taskData.day, int2 = taskId}}) - - local pack = globalCsv.returner_pack:toArray(true,"=") - if pack[1] == taskData.id then - role:checkTaskEnter("Appoint", {id = pack[2]}) - end - - role:updateProperty({field = "returner", value = returner}) - SendPacket(actionCodes.Activity_returnerTaskRpc, MsgPack.pack(role:packReward(reward, change))) - return true -end - return _M diff --git a/src/actions/CarAction.lua b/src/actions/CarAction.lua index d72ec5d..6685f4f 100644 --- a/src/actions/CarAction.lua +++ b/src/actions/CarAction.lua @@ -211,92 +211,4 @@ function _M.saleRuneRpc(agent, data ) return true end -function _M.sparkQualityUpRpc( agent, data ) - local role = agent.role - local msg = MsgPack.unpack(data) - local uid = msg.uid - local ownSpark = role.sparkBag[uid] - if not ownSpark then return 1 end - - - local cfg_id = ownSpark:getProperty("cfg_id") - local level = ownSpark:getProperty("level") - - local sparkSet = csvdb["sparkCsv"][cfg_id] - if not sparkSet then return 4 end - local sparkData = sparkSet[level] - if not sparkData then return 5 end - - if sparkData.star_up == 0 then return 6 end - local cost = sparkData.star_item:toNumMap() - if not role:checkItemEnough(cost) then - return 7 - end - - role:costItems(cost, {log = {desc = "sparkQualityUp", int1 = uid, int2 = level}}) - - local newSet = csvdb["sparkCsv"][sparkData.star_up] - if not newSet then return 8 end - local newSparkData = newSet[0] - if not newSparkData then return 9 end - local attrs = newSparkData.attr:toNumMap() - ownSpark:addAttr(attrs) - ownSpark:updateProperty({field = "level",value = 0}) - ownSpark:updateProperty({field = "cfg_id",value = sparkData.star_up}) - --role:checkTaskEnter("SparkQualityUp") - - - ownSpark:mylog({desc = "sparkQualityUp", int1 = sparkData.id , int2 = sparkData.star_up}) - - SendPacket(actionCodes.Car_sparkQualityUpRpc, '') - return true -end - -function _M.sparkLvlUpRpc( agent, data ) - local role = agent.role - local msg = MsgPack.unpack(data) - local uid = msg.uid - local ownSpark = role.sparkBag[uid] - if not ownSpark then return 1 end - - - local cfg_id = ownSpark:getProperty("cfg_id") - local level = ownSpark:getProperty("level") - - local sparkSet = csvdb["sparkCsv"][cfg_id] - if not sparkSet then return 4 end - local sparkData = sparkSet[level] - if not sparkData then return 5 end - - if level >= #sparkSet then return 6 end - local cost = sparkData.lv_up_item:toNumMap() - if not role:checkItemEnough(cost) then - return 7 - end - local weight = math.random(0, 100) - local addLvl = 1 - if weight < sparkData.probability then - addLvl = 2 - end - - role:costItems(cost, {log = {desc = "sparkLvlUp", int1 = uid, int2 = level}}) - local attrs = {} - for i = 1, addLvl do - local cfg = sparkSet[level + i] - if not cfg then break end - for k, v in pairs(cfg.attr:toNumMap()) do - attrs[k] = (attrs[k] or 0) + v - end - end - ownSpark:addAttr(attrs) - ownSpark:updateProperty({field = "level",value = level+addLvl}) - --role:checkTaskEnter("SparkLvlUp") - - - ownSpark:mylog({desc = "sparkLvlUp", int1 = level + addLvl}) - - SendPacket(actionCodes.Car_sparkLvlUpRpc, MsgPack.pack({big = (addLvl == 2)})) - return true -end - return _M \ No newline at end of file diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index 2096654..fd489c5 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -5,10 +5,6 @@ function _M.clientRequest(agent, data) local role = agent.role local action = _M[msg.cmd] local bin = MsgPack.pack({ cmd = "指令失败" }) - do - SendPacket(actionCodes.Gm_receiveResponse, bin) - return true - end if not action then SendPacket(actionCodes.Gm_receiveResponse, bin) return true @@ -170,15 +166,6 @@ function _M.rune(role, pms) return result end -table.insert(helpDes, {"获得火花" , "spark", "零件id"}) -function _M.spark(role, pms) - local id = tonum(pms.pm1) - local result = role:addSpark({id = id, log = {desc = "gm"}}) - role:mylog("gm_action", {desc = "spark", int1 = id, key1 = pms.sender}) - - return result == 0 and "成功" or "失败" -end - table.insert(helpDes, {"通关挂机副本", "fb", "挂卡id"}) function _M.fb(role, pms) -- 直接通关 local carbonId = tonum(pms.pm1) @@ -607,13 +594,6 @@ function _M.clearbag(role, pms) end role:delRunes(uids, {log = {desc = "gm"}}) - -- 火花 - uids = {} - for uid, _ in pairs(role.sparkBag) do - table.insert(uids, uid) - end - role:delSparks(uids, {log = {desc = "gm"}}) - return "成功" end diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index d6a7484..0685c14 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -105,25 +105,6 @@ function _M.wakeRpc(agent, data) if not role:checkItemEnough(cost) then return 4 end - local curLevel = hero:getProperty("wakeL") - local sparkInfo = hero:getProperty("spark") - -- 大于等于7的时候需要装备火花才能升 - if curLevel >= 7 then - if #sparkInfo == 0 then - return 5 - end - local ok = false - for _, info in ipairs(sparkInfo) do - local cfg = csvdb["sparkCsv"][info.cfg_id][info.level or 0] - if not cfg then return 6 end - if cfg.star == curLevel then - ok = true - break - end - end - if not ok then return 7 end - end - role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) @@ -131,6 +112,7 @@ function _M.wakeRpc(agent, data) local oldBattleV = hero:getProperty("battleV") hero:updateProperty({field = "wakeL", delta = 1}) + local curLevel = hero:getProperty("wakeL") role:checkTaskEnter("Wake", {heroType = typ, wakeL = curLevel}) if curLevel == 3 then -- 解锁cg role:checkTaskEnter("WakeCG", {heroType = typ}) @@ -1211,52 +1193,4 @@ function _M.setWishPoolRpc(agent, data) return true end -function _M.changeSparkRpc(agent, data) - local role = agent.role - local msg = MsgPack.unpack(data) - - local idx = msg.index - local sparkId = msg.spark_id - local heroId = msg.hero_id - local hero = role.heros[heroId] - if not hero then return 1 end - - local spark = role.sparkBag[sparkId] - if not spark then return 2 end - - local lvl = spark:getProperty("level") - local cfgId = spark:getProperty("cfg_id") - - local dataSet = csvdb["sparkCsv"][cfgId] - if not dataSet then return 3 end - local cfg = dataSet[lvl] - if not cfg then return 4 end - - if hero:getProperty("wakeL") < cfg.star then return 5 end - - local itemCfg = csvdb["itemCsv"][cfgId] - if not itemCfg then return 6 end - if itemCfg.quality ~= hero:getRare() then return 6 end - - local sparkList = hero:getProperty("spark") or {} - local oldSparkInfo = sparkList[idx] or {} - sparkList[idx] = spark:data() - hero:updateProperty({field="spark", value=sparkList}) - - role:delSparks({sparkId}, {log = {desc = "changeSpark"}}) - local oldId = oldSparkInfo["cfg_id"] or 0 - local oldLevel = oldSparkInfo["level"] or 0 - local oldSparkSet = csvdb["sparkCsv"][oldId] - local reward = {} - if oldSparkSet then - local oldSparkCfg = oldSparkSet[oldLevel] - if oldSparkSet then - reward = oldSparkCfg.back:toNumMap() - end - end - - SendPacket(actionCodes.Hero_changeSparkRpc, MsgPack.pack({reward = reward})) - return true -end - return _M diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index e8fafef..a029155 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -16,7 +16,6 @@ local httpc = require("http.httpc") local WAVE_HERO_NUMS = 150 local WAVE_RUNE_NUMS = 150 -local WAVE_SPARK_NUMS = 150 local function validName(name) name = string.upper(name) @@ -205,16 +204,6 @@ function _M.loginRpc( agent, data ) table_insert(modules, "runeBag") end - local sparkIds = {} - for id ,_ in pairs(role.sparkBag) do - table.insert(sparkIds, id) - end - local sparkWave = math.ceil(#sparkIds / WAVE_SPARK_NUMS) - if #sparkIds <= 50 then - sparkWave = 0 - table_insert(modules, "sparkBag") - end - for _, name in ipairs(modules) do response[name] = {} for id, unit in pairs(role[name]) do @@ -222,29 +211,12 @@ function _M.loginRpc( agent, data ) end end - response.wave = 1 + heroWave + runeWave + sparkWave + 1 + response.wave = 1 + heroWave + runeWave + 1 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) local curWave = 1 - local sparkIndex = 1 - for index = curWave + 1, curWave + sparkWave do - local sparkResponse = {sparkBag = {}} - for i = sparkIndex, sparkIndex + WAVE_SPARK_NUMS do - local sparkId = sparkIds[i] - if not sparkId then - break - end - local spark = role.sparkBag[sparkId] - table.insert(sparkResponse.sparkBag, spark:data()) - sparkIndex = sparkIndex + 1 - end - sparkResponse.sparkWave = index - SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(sparkResponse)) - end - curWave = curWave + sparkWave - local runeIndex = 1 for index = curWave + 1, curWave + runeWave do local runeResponse = {runeBag = {}} diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index bd904d1..9f51e1b 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -4,7 +4,6 @@ local md5 = require "md5" -- 入口在正式服关闭 -- mock 充值 function _M.rechargeRpc(agent , data) - if true then return end local role = agent.role local msg = MsgPack.unpack(data) local id = msg.id @@ -19,6 +18,7 @@ function _M.rechargeRpc(agent , data) end SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({ order = partnerOrderId })) + -- 测试的 直接发奖励了 skynet.timeout(10, function () role:handlePurchase({ diff --git a/src/models/Hero.lua b/src/models/Hero.lua index 2daed35..5be87e8 100644 --- a/src/models/Hero.lua +++ b/src/models/Hero.lua @@ -16,7 +16,6 @@ Hero.schema = { equip = {"string",""}, --装备 type=level rune = {"string",""}, --零件 type=id faith = {"number", 0}, -- 信赖 - spark = {"table", {}}, -- 火花属性 } function Hero:ctor( properties ) @@ -48,7 +47,7 @@ end function Hero:updateProperties(params, notNotify) self:setProperties(params) - local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true, spark = true} + local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true} local datas = {} local updateBV = false for k , v in pairs(params) do @@ -79,7 +78,7 @@ function Hero:updateProperty(params) local datas = {} table.insert(datas, {key = params.field, newValue = self:getProperty(params.field)}) - local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true, spark = true} + local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true} if check[params.field] then local orginValue = self:getProperty("battleV") local curValue = self:saveBattleValue() @@ -104,8 +103,7 @@ function Hero:data() -- loveL = self:getProperty("loveL"), equip = self:getProperty("equip"), rune = self:getProperty("rune"), - faith = self:getProperty("faith"), - spark = self:getProperty("spark"), + faith = self:getProperty("faith") } end diff --git a/src/models/HeroPlugin.lua b/src/models/HeroPlugin.lua index c811a36..876a4e5 100644 --- a/src/models/HeroPlugin.lua +++ b/src/models/HeroPlugin.lua @@ -121,13 +121,11 @@ function HeroPlugin.bind(Hero) local attrs = self:getBaseAttrs() -- 装备零件 local equipAttrs = self:getRuneEquipAttrs() - local sparkAttrs = self:getSparkAttrs() for _, attName in pairs(AttsEnumEx) do attrs[attName] = attrs[attName] or 0 attrs[attName] = attrs[attName] + addAttr(attrs[attName], equipAttrs.percent[attName], 1, attName) attrs[attName] = attrs[attName] + addAttr(attrs[attName], equipAttrs.value[attName], 0, attName) - attrs[attName] = attrs[attName] + addAttr(attrs[attName], sparkAttrs[attName], 0, attName) end -- 羁绊加成 @@ -227,19 +225,6 @@ function HeroPlugin.bind(Hero) return attrs end - function Hero:getSparkAttrs() - local attrs = {} - for _, attName in pairs(AttsEnumEx) do - attrs[attName] = 0 - end - for _, data in pairs(self:getProperty("spark") or {}) do - for k, v in pairs(data.attrs) do - attrs[AttsEnumEx[k]] = attrs[AttsEnumEx[k]] + v - end - end - return attrs - end - -- 战斗力(当前属性)= POWER[(生命 + 防御 * 7 + 闪避 * 4)*(攻击*4 + 命中 * 2)*(1 + 暴击几率/100 * 暴击伤害/100)* 攻击速度 / 60000 ,0.8 ] -- function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 diff --git a/src/models/Role.lua b/src/models/Role.lua index 933439e..c7c5d76 100644 --- a/src/models/Role.lua +++ b/src/models/Role.lua @@ -25,7 +25,6 @@ function Role:ctor( properties ) self.storeData = nil self.heros = {} self.runeBag = {} - self.sparkBag = {} self.advData = nil self.activity = nil self._pushToken = nil @@ -192,8 +191,6 @@ Role.schema = { radioTask = {"table", {}}, -- 电台任务 {id = {time=end_ts,heros=heros}} 表crusadeCsv seaport = {"table", {}}, -- 海岛贸易季 {time = 1234567890, donate = {}, collect = {[1] = {team = "1=2=3", time = 1234567890}}, shop = {}} - - returner = {"table", {}}, -- 回归者 {time = 12334233423, [1] = 1, [2] = 2, status = {[1] = 1}} } @@ -426,7 +423,6 @@ function Role:data() radioTask = self:getProperty("radioTask"), seaport = self:getProperty("seaport"), - returner = self:getProperty("returner"), } end diff --git a/src/models/RoleLog.lua b/src/models/RoleLog.lua index 2e8a5b0..5c19ac5 100644 --- a/src/models/RoleLog.lua +++ b/src/models/RoleLog.lua @@ -127,9 +127,6 @@ local ItemReason = { refer = 1210, -- 穿戴 itemCompose = 1211, -- 天赋道具合成 radioQuest = 1212, -- 电台任务奖励 - changeSpark = 1213, -- 穿戴火花 - sparkLvlUp = 1214, -- 火花强化 - sparkQualityUp = 1215, -- 火花升华 -- pvp pvpCHead = 1301, -- pvp 跨服竞技场头像 @@ -143,8 +140,6 @@ local ItemReason = { seaportShop = 1401, -- 贸易港商店兑换 seaportReward = 1402, -- 贸易港阶段奖励 seaportTask = 1403, -- 贸易港任务奖励 - - returner = 1410, -- 回归者奖励 } @@ -627,8 +622,6 @@ local LogType = { in_adv = "common", out_adv = "common", in_artifact = "common", - in_spark = "common", - out_spark = "common", mail_action = "common", role_action = "common", @@ -641,7 +634,6 @@ local LogType = { tower_action = "common", gm_action = "common", act_action = "common", - spark_action = "common", } -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 7a36937..3a5cf54 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -15,7 +15,6 @@ function RolePlugin.bind(Role) self:loadDiner() self:loadActivity() self:loadStoreInfo() - self:loadSparks() end function Role:reloadWhenLogin() @@ -100,11 +99,6 @@ function RolePlugin.bind(Role) self:addRune({type = typ,id = itemId, notNotify = pms.notNotify, log = pms.log}) end end, - [ItemType.Spark] = function() - for _= 1, count do - self:addSpark({id = itemId, notNotify = pms.notNotify, log = pms.log}) - end - end, [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 count = 0 end, @@ -763,23 +757,6 @@ function RolePlugin.bind(Role) end end - function Role:loadSparks() - local roleId = self:getProperty("id") - local sparkIds = redisproxy:smembers(string.format(R_SPARKIDS, roleId)) - local redret = redisproxy:pipelining(function (red) - for _, sparkId in ipairs(sparkIds) do - red:hgetall(string.format(R_SPARK, roleId, sparkId)) - end - end) - for index, sparkId in ipairs(sparkIds) do - local spark = require("models.Spark").new({key = string.format(R_SPARK, roleId, sparkId)}) - if spark:load(table.array2Table(redret[index])) then - spark.owner = self - self.sparkBag[tonumber(sparkId)] = spark - end - end - end - -- 0 为操作成功 function Role:addRune(params) if params.type and params.id then @@ -834,101 +811,6 @@ function RolePlugin.bind(Role) end end - -- 0 为操作成功 - function Role:addSpark(params) - if params.id then - local set = csvdb["sparkCsv"][params.id] - if not set then return 2 end - local data = set[0] - if not data then return 3 end - - local roleId = self:getProperty("id") - local sparkUid = tonum(redisproxy:hincrby(string.format(R_INCR, roleId), "spark", 1)) - - redisproxy:sadd(string.format(R_SPARKIDS, roleId), sparkUid) - - local sparkInfo = { - key = string.format(R_SPARK, roleId, sparkUid), - id = sparkUid, - cfg_id = params.id, - } - - local newSpark = require("models.Spark").new(sparkInfo) - newSpark:create() - newSpark:addAttr(data.attr:toNumMap()) - newSpark.owner = self - self.sparkBag[sparkUid] = newSpark - if not params.notNotify then - local response = {} - table.insert(response, newSpark:data()) - dump(response) - SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) - end - --self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) - - self:logItems(params.id, 0, 1, params.log) - if params.log then - local log = clone(params.log) - if log["cint1"] or log["cint2"] or log["cint3"] then - print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) - end - - log["cint1"] = sparkUid - log["cint2"] = params.cfg_id - - self:mylog("in_spark", log) - else - print("addSpark no log ", debug.traceback()) - end - - return 0, newSpark - else - return 1 - end - end - - function Role:delSparks(sparkIds, params) -- 批量删除 {id, } - params = params or {} - local roleId = self:getProperty('id') - local bDel = {} - for _, sparkId in pairs(sparkIds) do - local spark = self.sparkBag[sparkId] - if spark then - - self:logItems(spark:getProperty("id"), 1, 0, params.log) - if params.log then - local log = clone(params.log) - if log["cint1"] or log["cint2"] then - print("delSpark error log have cint1 or cint2 ", debug.traceback()) - end - - log["cint1"] = sparkId - log["cint2"] = spark:getProperty("cfg_id") - - self:mylog("out_spark", log) - else - print("delSparks no log ", debug.traceback()) - end - - self.sparkBag[sparkId] = nil - table.insert(bDel, sparkId) - end - end - - redisproxy:pipelining(function (red) - for _, sparkId in pairs(bDel) do - red:del(string.format(R_SPARK, roleId, sparkId)) - red:srem(string.format(R_SPARKIDS, roleId), sparkId) - end - end) - local response = {} - for _, sparkId in pairs(bDel) do - table.insert(response, {id = sparkId, bDel = true}) - end - - SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) - end - function Role:delRunes(runeIds, params) -- 批量删除 {id, } params = params or {} local roleId = self:getProperty('id') @@ -1463,17 +1345,6 @@ function RolePlugin.bind(Role) end end - -- 检查回归者 - function Role:checkReturner() - local returner = self:getProperty("returner") or {} - if next(returner) then return end - - local now = specTime({hour = 4}) - returner.time = now - - self:updateProperty({field = "returner", value = returner}) - end - function Role:getSeaportServerProgress() local result = {} diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index af11a44..a3e42b6 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -109,7 +109,6 @@ local TaskType = { CostDiamond = 909, -- 消耗钻石 WeekTask = 910, -- 完成每周活跃任务 ActBattlePass = 911, -- 活动关卡通关 -- chapterId - Appoint = 912, -- 触发限时礼包,指定id --功能未实现 todo AdvShop = 1002, -- 冒险商城 @@ -265,7 +264,6 @@ local StoreListener = { [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, [TaskType.DrawHeroLimitPack] = {{TriggerEventType.DrawHeroCnt, f("count")}}, - [TaskType.Appoint] = {{TriggerEventType.Appoint, f("id")}}, } } @@ -321,11 +319,6 @@ local BattleCommandTaskListener = { listen = CalendaTaskListener["listen"] } -local ReturnerTask = { - func = "checkReturnerTask", - listen = CalendaTaskListener["listen"] -} - local TaskListeners = { StoryListener, CommonListener, @@ -335,7 +328,6 @@ local TaskListeners = { StoreListener, CalendaTaskListener, BattleCommandTaskListener, - ReturnerTask, } local RoleTask = {} @@ -833,15 +825,6 @@ function RoleTask.bind(Role) self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) end - function Role:checkReturnerTask(notNotify, mainType, subType, param1, param2) - -- print("check returner task", mainType, subType, param1, param2) - local returner = self:getProperty("returner") or {} - if not returner.time then return end - local actData = csvdb["activity_ctrlCsv"][76] - local keyName = "returner" - self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) - end - end return RoleTask diff --git a/src/models/RoleTimeReset.lua b/src/models/RoleTimeReset.lua index 7b9119e..bdd6f8a 100644 --- a/src/models/RoleTimeReset.lua +++ b/src/models/RoleTimeReset.lua @@ -28,11 +28,6 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id end - -- 检查回归者 - if ltime ~= 0 and (now - ltime) >= 86400 * globalCsv.returner_time then - self:checkReturner() - end - response.dTask = {} response.advSup = self:getProperty("advSup") self:log("onLogin") diff --git a/src/models/Spark.lua b/src/models/Spark.lua deleted file mode 100644 index 04bd803..0000000 --- a/src/models/Spark.lua +++ /dev/null @@ -1,78 +0,0 @@ -local Spark = class("Spark", require("shared.ModelBase")) -Spark.schema = { - id = {"number"}, -- 唯一自增id - cfg_id = {"number"}, - level = {"number", 0}, -- 等级 - attrs = {"table", {}} -- 基础属性值 id=value -} - -function Spark:ctor( properties ) - Spark.super.ctor(self, properties) -end - -function Spark:notifyUpdateProperty(field, newValue, oldValue) - local datas = { - id = self:getProperty("id"), - datas = { - { - key = field, - newValue = newValue, - oldValue = oldValue, - } - } - } - self:notifyUpdateProperties(datas) -end - -function Spark:mylog(contents) - contents = contents or {} - if contents["cint1"] or contents["cint2"] then - print("sparkLog error log have cint1 or cint2 ", debug.traceback()) - end - contents["cint1"] = self:getProperty("id") - contents["cint2"] = self:getProperty("cfg_id") - - self.owner:mylog("spark_action", contents) -end - -function Spark:notifyUpdateProperties(params) - local updateData = { - id = self:getProperty("id"), - datas = params - } - SendPacket(actionCodes.Role_updateSpark, MsgPack.pack(updateData)) -end - -function Spark:updateProperty(params) - if not params.field or (not params.delta and not params.value) then - return - end - if params.delta then - self:incrProperty(params.field, params.delta) - elseif params.value then - self:setProperty(params.field, params.value) - end - local datas = {} - table.insert(datas, {key = params.field, newValue = self:getProperty(params.field)}) - - self:notifyUpdateProperties(datas) -end - -function Spark:addAttr(attrs) - local curAttrs = clone(self:getProperty("attrs")) - for k, v in pairs(attrs) do - curAttrs[k] = (curAttrs[k] or 0) + v - end - self:updateProperty({field = "attrs", value = curAttrs}) -end - -function Spark:data() - return { - id = self:getProperty("id"), - cfg_id = self:getProperty("cfg_id"), - level = self:getProperty("level"), - attrs = self:getProperty("attrs"), - } -end - -return Spark \ No newline at end of file diff --git a/src/services/errorlog.lua b/src/services/errorlog.lua index 0b36091..eecc91c 100644 --- a/src/services/errorlog.lua +++ b/src/services/errorlog.lua @@ -22,7 +22,7 @@ local logHandle = { doc["timestamp"] = now doc["instance_id"] = serverId doc["game_name"] = "wasteland" - doc["env"] = "prod" + doc["env"] = "cb" doc["app_name"] = "gs" doc["app_id"] = "game.wasteland.gs" --FATAL、ERROR、WARN、INFO、DEBUG diff --git a/src/services/logd.lua b/src/services/logd.lua index 88daced..2436a06 100644 --- a/src/services/logd.lua +++ b/src/services/logd.lua @@ -32,7 +32,7 @@ local logHandle = { doc["timestamp"] = now doc["server"] = serverId doc["game_name"] = "wasteland" - doc["env"] = "prod" + doc["env"] = "cb" doc["game_name_type"] = "guaji" doc["log_id"] = prefix .. logId .. "T" .. now logId = (logId + 1) % 10000000 diff --git a/src/shared/ModelBase.lua b/src/shared/ModelBase.lua index 8f53b15..e699bc3 100644 --- a/src/shared/ModelBase.lua +++ b/src/shared/ModelBase.lua @@ -178,7 +178,7 @@ function ModelBase:loadProperties(properties) properties[field] = MsgPack.unpack(properties[field]) end - local val = properties[field] or clone(def) + local val = properties[field] or def if val ~= nil then if typ == "number" then val = tonumber(val) end assert(type(val) == typ, -- libgit2 0.21.2