Commit 3bfb5fbe05bdb05d79d540526a71b3d8972ec84f
1 parent
0488b666
Revert "Merge branch 'tr/publish/release' into cn/develop"
This reverts commit 0488b666785337c85dc6311df05a97bc3b159944, reversing changes made to 020d02ee23cbbec11243408f4be221a6e2ac09a4.
Showing
32 changed files
with
14 additions
and
608 deletions
Show diff stats
config/basic.lua
1 | 1 | root = "./" |
2 | --- logger = "server.log" | |
3 | -logger = "services/errorlog" | |
4 | -logservice = "snlua" | |
5 | - | |
2 | +logger = "server.log" | |
6 | 3 | harbor = 0 |
7 | 4 | start = "main" -- main script |
8 | 5 | bootstrap = "snlua bootstrap" -- The service for bootstrap |
... | ... | @@ -12,19 +9,4 @@ lualoader = "skynet/lualib/loader.lua" |
12 | 9 | preload = "./src/preload.lua" -- run preload.lua before every lua service run |
13 | 10 | cpath = root.."skynet/cservice/?.so" |
14 | 11 | lua_cpath = "skynet/luaclib/?.so" |
15 | -cluster = "./config/nodenames.lua" | |
16 | - | |
17 | -codeurl = "10.235.14.85:9001" | |
18 | -logd = 1 -- 是否开启日志 | |
19 | -thread = 16 | |
20 | -max_client = 4100 | |
21 | -debug_port = 10001 | |
22 | -httpweb_port = 11001 | |
23 | - | |
24 | -serverType = "ob" | |
25 | -max_queue = 500 | |
26 | - | |
27 | -redis_port = 6379 | |
28 | -redis_db = 0 | |
29 | -redis_auth = "VraDMcdX=Jq!Ess4" | |
30 | -server_port = 20001 | |
31 | 12 | \ No newline at end of file |
13 | +cluster = "./config/nodenames.lua" | |
32 | 14 | \ No newline at end of file | ... | ... |
config/nodenames.lua
1 | -center = "10.235.14.85:12000" | |
1 | +center = "192.168.0.198:9000" | |
2 | 2 | |
3 | -server1 = "10.235.14.30:12001" | |
4 | -server2 = "10.235.14.218:12001" | |
5 | -server3 = "10.235.14.217:12001" | |
6 | -server4 = "10.235.14.70:12001" | |
7 | -server5 = "10.235.14.224:12001" | |
8 | -server6 = "10.235.14.24:12001" | |
9 | -server7 = "10.235.14.191:12001" | |
10 | -server8 = "10.235.14.75:12001" | |
11 | -server9 = "10.235.14.119:12001" | |
12 | -server10 = "10.235.14.67:12001" | |
3 | +server1 = "127.0.0.1:8101" | |
4 | +server2 = "127.0.0.1:8102" | |
13 | 5 | \ No newline at end of file | ... | ... |
config/server1.lua deleted
config/server10.lua deleted
config/server2.lua deleted
config/server3.lua deleted
config/server4.lua deleted
config/server5.lua deleted
config/server6.lua deleted
config/server7.lua deleted
config/server8.lua deleted
config/server9.lua deleted
src/GlobalVar.lua
... | ... | @@ -84,7 +84,6 @@ ItemType = { |
84 | 84 | SelectItemBox = 17, -- 自选箱子 |
85 | 85 | CommonPaster = 18, -- 万能贴纸 |
86 | 86 | BossTicket = 20, -- boss挑战门票 |
87 | - Spark = 21, -- 火花 | |
88 | 87 | } |
89 | 88 | |
90 | 89 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID |
... | ... | @@ -364,7 +363,6 @@ TriggerEventType = { |
364 | 363 | SSRCount = 6, |
365 | 364 | AfterTs = 7, -- 某时间以后 |
366 | 365 | DrawHeroCnt = 8, -- 每日抽卡次数 |
367 | - Appoint = 0, -- 触发指定id礼包 | |
368 | 366 | } |
369 | 367 | |
370 | 368 | DrawCardType = { | ... | ... |
src/ProtocolCode.lua
... | ... | @@ -51,8 +51,6 @@ actionCodes = { |
51 | 51 | Role_broadGetSSR = 135, -- 全服广播 获得ssr英雄 |
52 | 52 | Role_renameTeamRpc = 136, -- 编队改名 |
53 | 53 | Role_accuseRpc = 137, -- 举报 |
54 | - Role_loadSparks = 138, | |
55 | - Role_updateSpark = 139, -- 更新火花 | |
56 | 54 | |
57 | 55 | Adv_startAdvRpc = 151, |
58 | 56 | Adv_startHangRpc = 152, |
... | ... | @@ -104,7 +102,6 @@ actionCodes = { |
104 | 102 | Hero_drawHeroExtraRewardNtf = 224, |
105 | 103 | Hero_itemComposeRpc = 225, |
106 | 104 | Hero_setWishPoolRpc = 226, |
107 | - Hero_changeSparkRpc = 227, | |
108 | 105 | |
109 | 106 | Hang_startRpc = 251, |
110 | 107 | Hang_checkRpc = 252, |
... | ... | @@ -155,8 +152,6 @@ actionCodes = { |
155 | 152 | Car_runeUpRpc = 402, |
156 | 153 | Car_saleEquipRpc = 403, |
157 | 154 | Car_saleRuneRpc = 404, |
158 | - Car_sparkLvlUpRpc = 405, | |
159 | - Car_sparkQualityUpRpc = 406, | |
160 | 155 | |
161 | 156 | |
162 | 157 | Friend_searchRpc = 450, |
... | ... | @@ -246,7 +241,6 @@ actionCodes = { |
246 | 241 | Activity_newSignRpc = 670, |
247 | 242 | Activity_advLevelRpc = 671, |
248 | 243 | Activity_buyBattleCommandLvlRpc = 672, |
249 | - Activity_returnerTaskRpc = 673, | |
250 | 244 | |
251 | 245 | Radio_startQuestRpc = 700, |
252 | 246 | Radio_finishQuestRpc = 701, | ... | ... |
src/RedisKeys.lua
... | ... | @@ -14,8 +14,6 @@ R_EMAIL_ITEM = "email:%d:%d" --邮件 |
14 | 14 | R_STORE = "role:%d:store" -- 商店 |
15 | 15 | R_ORDERS = "role:%d:orders" -- 订单 |
16 | 16 | R_ORDER = "order:%d:%d" |
17 | -R_SPARKIDS = "role:%d:sparkIds" -- 玩家拥有火花自增id | |
18 | -R_SPARK = "role:%d:spark:%d" -- 火花详细信息 | |
19 | 17 | |
20 | 18 | -- 通用排行榜 |
21 | 19 | RANK_COMMON = "rank:common:" | ... | ... |
src/actions/ActivityAction.lua
... | ... | @@ -1370,52 +1370,4 @@ function _M.advLevelRpc(agent, data) |
1370 | 1370 | return true |
1371 | 1371 | end |
1372 | 1372 | |
1373 | -function _M.returnerTaskRpc(agent, data) | |
1374 | - local role = agent.role | |
1375 | - local msg = MsgPack.unpack(data) | |
1376 | - | |
1377 | - local taskId = msg.id or 0 | |
1378 | - if taskId == 0 then return 0 end | |
1379 | - | |
1380 | - local returner = role:getProperty("returner") or {} | |
1381 | - if not returner[taskId] then return 1 end | |
1382 | - | |
1383 | - local tday = specTime({hour = 4}) | |
1384 | - local curAllDay = (tday - returner.time) / 86400 + 1 | |
1385 | - | |
1386 | - local TaskCsv = csvdb["activity_taskCsv"][76] or {} | |
1387 | - local taskData = TaskCsv[taskId] | |
1388 | - if not taskData then return 2 end | |
1389 | - if curAllDay < taskData.day then return 2 end | |
1390 | - | |
1391 | - local status = returner.status or {} | |
1392 | - if status[taskId] then return 3 end | |
1393 | - | |
1394 | - status[taskId] = 1 | |
1395 | - returner.status = status | |
1396 | - | |
1397 | - local done = true | |
1398 | - for _, data in pairs(TaskCsv) do | |
1399 | - if not status[data.id] then | |
1400 | - done = false | |
1401 | - break | |
1402 | - end | |
1403 | - end | |
1404 | - | |
1405 | - if done then | |
1406 | - returner = {} | |
1407 | - end | |
1408 | - | |
1409 | - local reward, change = role:award(taskData.reward, {log = {desc = "returner", int1 = taskData.day, int2 = taskId}}) | |
1410 | - | |
1411 | - local pack = globalCsv.returner_pack:toArray(true,"=") | |
1412 | - if pack[1] == taskData.id then | |
1413 | - role:checkTaskEnter("Appoint", {id = pack[2]}) | |
1414 | - end | |
1415 | - | |
1416 | - role:updateProperty({field = "returner", value = returner}) | |
1417 | - SendPacket(actionCodes.Activity_returnerTaskRpc, MsgPack.pack(role:packReward(reward, change))) | |
1418 | - return true | |
1419 | -end | |
1420 | - | |
1421 | 1373 | return _M | ... | ... |
src/actions/CarAction.lua
... | ... | @@ -211,92 +211,4 @@ function _M.saleRuneRpc(agent, data ) |
211 | 211 | return true |
212 | 212 | end |
213 | 213 | |
214 | -function _M.sparkQualityUpRpc( agent, data ) | |
215 | - local role = agent.role | |
216 | - local msg = MsgPack.unpack(data) | |
217 | - local uid = msg.uid | |
218 | - local ownSpark = role.sparkBag[uid] | |
219 | - if not ownSpark then return 1 end | |
220 | - | |
221 | - | |
222 | - local cfg_id = ownSpark:getProperty("cfg_id") | |
223 | - local level = ownSpark:getProperty("level") | |
224 | - | |
225 | - local sparkSet = csvdb["sparkCsv"][cfg_id] | |
226 | - if not sparkSet then return 4 end | |
227 | - local sparkData = sparkSet[level] | |
228 | - if not sparkData then return 5 end | |
229 | - | |
230 | - if sparkData.star_up == 0 then return 6 end | |
231 | - local cost = sparkData.star_item:toNumMap() | |
232 | - if not role:checkItemEnough(cost) then | |
233 | - return 7 | |
234 | - end | |
235 | - | |
236 | - role:costItems(cost, {log = {desc = "sparkQualityUp", int1 = uid, int2 = level}}) | |
237 | - | |
238 | - local newSet = csvdb["sparkCsv"][sparkData.star_up] | |
239 | - if not newSet then return 8 end | |
240 | - local newSparkData = newSet[0] | |
241 | - if not newSparkData then return 9 end | |
242 | - local attrs = newSparkData.attr:toNumMap() | |
243 | - ownSpark:addAttr(attrs) | |
244 | - ownSpark:updateProperty({field = "level",value = 0}) | |
245 | - ownSpark:updateProperty({field = "cfg_id",value = sparkData.star_up}) | |
246 | - --role:checkTaskEnter("SparkQualityUp") | |
247 | - | |
248 | - | |
249 | - ownSpark:mylog({desc = "sparkQualityUp", int1 = sparkData.id , int2 = sparkData.star_up}) | |
250 | - | |
251 | - SendPacket(actionCodes.Car_sparkQualityUpRpc, '') | |
252 | - return true | |
253 | -end | |
254 | - | |
255 | -function _M.sparkLvlUpRpc( agent, data ) | |
256 | - local role = agent.role | |
257 | - local msg = MsgPack.unpack(data) | |
258 | - local uid = msg.uid | |
259 | - local ownSpark = role.sparkBag[uid] | |
260 | - if not ownSpark then return 1 end | |
261 | - | |
262 | - | |
263 | - local cfg_id = ownSpark:getProperty("cfg_id") | |
264 | - local level = ownSpark:getProperty("level") | |
265 | - | |
266 | - local sparkSet = csvdb["sparkCsv"][cfg_id] | |
267 | - if not sparkSet then return 4 end | |
268 | - local sparkData = sparkSet[level] | |
269 | - if not sparkData then return 5 end | |
270 | - | |
271 | - if level >= #sparkSet then return 6 end | |
272 | - local cost = sparkData.lv_up_item:toNumMap() | |
273 | - if not role:checkItemEnough(cost) then | |
274 | - return 7 | |
275 | - end | |
276 | - local weight = math.random(0, 100) | |
277 | - local addLvl = 1 | |
278 | - if weight < sparkData.probability then | |
279 | - addLvl = 2 | |
280 | - end | |
281 | - | |
282 | - role:costItems(cost, {log = {desc = "sparkLvlUp", int1 = uid, int2 = level}}) | |
283 | - local attrs = {} | |
284 | - for i = 1, addLvl do | |
285 | - local cfg = sparkSet[level + i] | |
286 | - if not cfg then break end | |
287 | - for k, v in pairs(cfg.attr:toNumMap()) do | |
288 | - attrs[k] = (attrs[k] or 0) + v | |
289 | - end | |
290 | - end | |
291 | - ownSpark:addAttr(attrs) | |
292 | - ownSpark:updateProperty({field = "level",value = level+addLvl}) | |
293 | - --role:checkTaskEnter("SparkLvlUp") | |
294 | - | |
295 | - | |
296 | - ownSpark:mylog({desc = "sparkLvlUp", int1 = level + addLvl}) | |
297 | - | |
298 | - SendPacket(actionCodes.Car_sparkLvlUpRpc, MsgPack.pack({big = (addLvl == 2)})) | |
299 | - return true | |
300 | -end | |
301 | - | |
302 | 214 | return _M |
303 | 215 | \ No newline at end of file | ... | ... |
src/actions/GmAction.lua
... | ... | @@ -5,10 +5,6 @@ function _M.clientRequest(agent, data) |
5 | 5 | local role = agent.role |
6 | 6 | local action = _M[msg.cmd] |
7 | 7 | local bin = MsgPack.pack({ cmd = "指令失败" }) |
8 | - do | |
9 | - SendPacket(actionCodes.Gm_receiveResponse, bin) | |
10 | - return true | |
11 | - end | |
12 | 8 | if not action then |
13 | 9 | SendPacket(actionCodes.Gm_receiveResponse, bin) |
14 | 10 | return true |
... | ... | @@ -170,15 +166,6 @@ function _M.rune(role, pms) |
170 | 166 | return result |
171 | 167 | end |
172 | 168 | |
173 | -table.insert(helpDes, {"获得火花" , "spark", "零件id"}) | |
174 | -function _M.spark(role, pms) | |
175 | - local id = tonum(pms.pm1) | |
176 | - local result = role:addSpark({id = id, log = {desc = "gm"}}) | |
177 | - role:mylog("gm_action", {desc = "spark", int1 = id, key1 = pms.sender}) | |
178 | - | |
179 | - return result == 0 and "成功" or "失败" | |
180 | -end | |
181 | - | |
182 | 169 | table.insert(helpDes, {"通关挂机副本", "fb", "挂卡id"}) |
183 | 170 | function _M.fb(role, pms) -- 直接通关 |
184 | 171 | local carbonId = tonum(pms.pm1) |
... | ... | @@ -607,13 +594,6 @@ function _M.clearbag(role, pms) |
607 | 594 | end |
608 | 595 | role:delRunes(uids, {log = {desc = "gm"}}) |
609 | 596 | |
610 | - -- 火花 | |
611 | - uids = {} | |
612 | - for uid, _ in pairs(role.sparkBag) do | |
613 | - table.insert(uids, uid) | |
614 | - end | |
615 | - role:delSparks(uids, {log = {desc = "gm"}}) | |
616 | - | |
617 | 597 | return "成功" |
618 | 598 | end |
619 | 599 | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -105,25 +105,6 @@ function _M.wakeRpc(agent, data) |
105 | 105 | if not role:checkItemEnough(cost) then |
106 | 106 | return 4 |
107 | 107 | end |
108 | - local curLevel = hero:getProperty("wakeL") | |
109 | - local sparkInfo = hero:getProperty("spark") | |
110 | - -- 大于等于7的时候需要装备火花才能升 | |
111 | - if curLevel >= 7 then | |
112 | - if #sparkInfo == 0 then | |
113 | - return 5 | |
114 | - end | |
115 | - local ok = false | |
116 | - for _, info in ipairs(sparkInfo) do | |
117 | - local cfg = csvdb["sparkCsv"][info.cfg_id][info.level or 0] | |
118 | - if not cfg then return 6 end | |
119 | - if cfg.star == curLevel then | |
120 | - ok = true | |
121 | - break | |
122 | - end | |
123 | - end | |
124 | - if not ok then return 7 end | |
125 | - end | |
126 | - | |
127 | 108 | |
128 | 109 | role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) |
129 | 110 | |
... | ... | @@ -131,6 +112,7 @@ function _M.wakeRpc(agent, data) |
131 | 112 | local oldBattleV = hero:getProperty("battleV") |
132 | 113 | hero:updateProperty({field = "wakeL", delta = 1}) |
133 | 114 | |
115 | + local curLevel = hero:getProperty("wakeL") | |
134 | 116 | role:checkTaskEnter("Wake", {heroType = typ, wakeL = curLevel}) |
135 | 117 | if curLevel == 3 then -- 解锁cg |
136 | 118 | role:checkTaskEnter("WakeCG", {heroType = typ}) |
... | ... | @@ -1211,52 +1193,4 @@ function _M.setWishPoolRpc(agent, data) |
1211 | 1193 | return true |
1212 | 1194 | end |
1213 | 1195 | |
1214 | -function _M.changeSparkRpc(agent, data) | |
1215 | - local role = agent.role | |
1216 | - local msg = MsgPack.unpack(data) | |
1217 | - | |
1218 | - local idx = msg.index | |
1219 | - local sparkId = msg.spark_id | |
1220 | - local heroId = msg.hero_id | |
1221 | - local hero = role.heros[heroId] | |
1222 | - if not hero then return 1 end | |
1223 | - | |
1224 | - local spark = role.sparkBag[sparkId] | |
1225 | - if not spark then return 2 end | |
1226 | - | |
1227 | - local lvl = spark:getProperty("level") | |
1228 | - local cfgId = spark:getProperty("cfg_id") | |
1229 | - | |
1230 | - local dataSet = csvdb["sparkCsv"][cfgId] | |
1231 | - if not dataSet then return 3 end | |
1232 | - local cfg = dataSet[lvl] | |
1233 | - if not cfg then return 4 end | |
1234 | - | |
1235 | - if hero:getProperty("wakeL") < cfg.star then return 5 end | |
1236 | - | |
1237 | - local itemCfg = csvdb["itemCsv"][cfgId] | |
1238 | - if not itemCfg then return 6 end | |
1239 | - if itemCfg.quality ~= hero:getRare() then return 6 end | |
1240 | - | |
1241 | - local sparkList = hero:getProperty("spark") or {} | |
1242 | - local oldSparkInfo = sparkList[idx] or {} | |
1243 | - sparkList[idx] = spark:data() | |
1244 | - hero:updateProperty({field="spark", value=sparkList}) | |
1245 | - | |
1246 | - role:delSparks({sparkId}, {log = {desc = "changeSpark"}}) | |
1247 | - local oldId = oldSparkInfo["cfg_id"] or 0 | |
1248 | - local oldLevel = oldSparkInfo["level"] or 0 | |
1249 | - local oldSparkSet = csvdb["sparkCsv"][oldId] | |
1250 | - local reward = {} | |
1251 | - if oldSparkSet then | |
1252 | - local oldSparkCfg = oldSparkSet[oldLevel] | |
1253 | - if oldSparkSet then | |
1254 | - reward = oldSparkCfg.back:toNumMap() | |
1255 | - end | |
1256 | - end | |
1257 | - | |
1258 | - SendPacket(actionCodes.Hero_changeSparkRpc, MsgPack.pack({reward = reward})) | |
1259 | - return true | |
1260 | -end | |
1261 | - | |
1262 | 1196 | return _M | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -16,7 +16,6 @@ local httpc = require("http.httpc") |
16 | 16 | |
17 | 17 | local WAVE_HERO_NUMS = 150 |
18 | 18 | local WAVE_RUNE_NUMS = 150 |
19 | -local WAVE_SPARK_NUMS = 150 | |
20 | 19 | |
21 | 20 | local function validName(name) |
22 | 21 | name = string.upper(name) |
... | ... | @@ -205,16 +204,6 @@ function _M.loginRpc( agent, data ) |
205 | 204 | table_insert(modules, "runeBag") |
206 | 205 | end |
207 | 206 | |
208 | - local sparkIds = {} | |
209 | - for id ,_ in pairs(role.sparkBag) do | |
210 | - table.insert(sparkIds, id) | |
211 | - end | |
212 | - local sparkWave = math.ceil(#sparkIds / WAVE_SPARK_NUMS) | |
213 | - if #sparkIds <= 50 then | |
214 | - sparkWave = 0 | |
215 | - table_insert(modules, "sparkBag") | |
216 | - end | |
217 | - | |
218 | 207 | for _, name in ipairs(modules) do |
219 | 208 | response[name] = {} |
220 | 209 | for id, unit in pairs(role[name]) do |
... | ... | @@ -222,29 +211,12 @@ function _M.loginRpc( agent, data ) |
222 | 211 | end |
223 | 212 | end |
224 | 213 | |
225 | - response.wave = 1 + heroWave + runeWave + sparkWave + 1 | |
214 | + response.wave = 1 + heroWave + runeWave + 1 | |
226 | 215 | |
227 | 216 | SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) |
228 | 217 | |
229 | 218 | local curWave = 1 |
230 | 219 | |
231 | - local sparkIndex = 1 | |
232 | - for index = curWave + 1, curWave + sparkWave do | |
233 | - local sparkResponse = {sparkBag = {}} | |
234 | - for i = sparkIndex, sparkIndex + WAVE_SPARK_NUMS do | |
235 | - local sparkId = sparkIds[i] | |
236 | - if not sparkId then | |
237 | - break | |
238 | - end | |
239 | - local spark = role.sparkBag[sparkId] | |
240 | - table.insert(sparkResponse.sparkBag, spark:data()) | |
241 | - sparkIndex = sparkIndex + 1 | |
242 | - end | |
243 | - sparkResponse.sparkWave = index | |
244 | - SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(sparkResponse)) | |
245 | - end | |
246 | - curWave = curWave + sparkWave | |
247 | - | |
248 | 220 | local runeIndex = 1 |
249 | 221 | for index = curWave + 1, curWave + runeWave do |
250 | 222 | local runeResponse = {runeBag = {}} | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -4,7 +4,6 @@ local md5 = require "md5" |
4 | 4 | |
5 | 5 | -- 入口在正式服关闭 -- mock 充值 |
6 | 6 | function _M.rechargeRpc(agent , data) |
7 | - if true then return end | |
8 | 7 | local role = agent.role |
9 | 8 | local msg = MsgPack.unpack(data) |
10 | 9 | local id = msg.id |
... | ... | @@ -19,6 +18,7 @@ function _M.rechargeRpc(agent , data) |
19 | 18 | end |
20 | 19 | SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({ order = partnerOrderId })) |
21 | 20 | |
21 | + | |
22 | 22 | -- 测试的 直接发奖励了 |
23 | 23 | skynet.timeout(10, function () |
24 | 24 | role:handlePurchase({ | ... | ... |
src/models/Hero.lua
... | ... | @@ -16,7 +16,6 @@ Hero.schema = { |
16 | 16 | equip = {"string",""}, --装备 type=level |
17 | 17 | rune = {"string",""}, --零件 type=id |
18 | 18 | faith = {"number", 0}, -- 信赖 |
19 | - spark = {"table", {}}, -- 火花属性 | |
20 | 19 | } |
21 | 20 | |
22 | 21 | function Hero:ctor( properties ) |
... | ... | @@ -48,7 +47,7 @@ end |
48 | 47 | function Hero:updateProperties(params, notNotify) |
49 | 48 | self:setProperties(params) |
50 | 49 | |
51 | - local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true, spark = true} | |
50 | + local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true} | |
52 | 51 | local datas = {} |
53 | 52 | local updateBV = false |
54 | 53 | for k , v in pairs(params) do |
... | ... | @@ -79,7 +78,7 @@ function Hero:updateProperty(params) |
79 | 78 | local datas = {} |
80 | 79 | table.insert(datas, {key = params.field, newValue = self:getProperty(params.field)}) |
81 | 80 | |
82 | - local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true, spark = true} | |
81 | + local check = {level = true, breakL = true, wakeL = true, talent = true, loveL = true, equip = true, rune = true} | |
83 | 82 | if check[params.field] then |
84 | 83 | local orginValue = self:getProperty("battleV") |
85 | 84 | local curValue = self:saveBattleValue() |
... | ... | @@ -104,8 +103,7 @@ function Hero:data() |
104 | 103 | -- loveL = self:getProperty("loveL"), |
105 | 104 | equip = self:getProperty("equip"), |
106 | 105 | rune = self:getProperty("rune"), |
107 | - faith = self:getProperty("faith"), | |
108 | - spark = self:getProperty("spark"), | |
106 | + faith = self:getProperty("faith") | |
109 | 107 | } |
110 | 108 | end |
111 | 109 | ... | ... |
src/models/HeroPlugin.lua
... | ... | @@ -121,13 +121,11 @@ function HeroPlugin.bind(Hero) |
121 | 121 | local attrs = self:getBaseAttrs() |
122 | 122 | -- 装备零件 |
123 | 123 | local equipAttrs = self:getRuneEquipAttrs() |
124 | - local sparkAttrs = self:getSparkAttrs() | |
125 | 124 | |
126 | 125 | for _, attName in pairs(AttsEnumEx) do |
127 | 126 | attrs[attName] = attrs[attName] or 0 |
128 | 127 | attrs[attName] = attrs[attName] + addAttr(attrs[attName], equipAttrs.percent[attName], 1, attName) |
129 | 128 | attrs[attName] = attrs[attName] + addAttr(attrs[attName], equipAttrs.value[attName], 0, attName) |
130 | - attrs[attName] = attrs[attName] + addAttr(attrs[attName], sparkAttrs[attName], 0, attName) | |
131 | 129 | end |
132 | 130 | |
133 | 131 | -- 羁绊加成 |
... | ... | @@ -227,19 +225,6 @@ function HeroPlugin.bind(Hero) |
227 | 225 | return attrs |
228 | 226 | end |
229 | 227 | |
230 | - function Hero:getSparkAttrs() | |
231 | - local attrs = {} | |
232 | - for _, attName in pairs(AttsEnumEx) do | |
233 | - attrs[attName] = 0 | |
234 | - end | |
235 | - for _, data in pairs(self:getProperty("spark") or {}) do | |
236 | - for k, v in pairs(data.attrs) do | |
237 | - attrs[AttsEnumEx[k]] = attrs[AttsEnumEx[k]] + v | |
238 | - end | |
239 | - end | |
240 | - return attrs | |
241 | - end | |
242 | - | |
243 | 228 | |
244 | 229 | -- 战斗力(当前属性)= POWER[(生命 + 防御 * 7 + 闪避 * 4)*(攻击*4 + 命中 * 2)*(1 + 暴击几率/100 * 暴击伤害/100)* 攻击速度 / 60000 ,0.8 ] |
245 | 230 | -- function Hero:getBattleValue(activeRelation) -- isReal包括队伍加成 | ... | ... |
src/models/Role.lua
... | ... | @@ -25,7 +25,6 @@ function Role:ctor( properties ) |
25 | 25 | self.storeData = nil |
26 | 26 | self.heros = {} |
27 | 27 | self.runeBag = {} |
28 | - self.sparkBag = {} | |
29 | 28 | self.advData = nil |
30 | 29 | self.activity = nil |
31 | 30 | self._pushToken = nil |
... | ... | @@ -192,8 +191,6 @@ Role.schema = { |
192 | 191 | radioTask = {"table", {}}, -- 电台任务 {id = {time=end_ts,heros=heros}} 表crusadeCsv |
193 | 192 | |
194 | 193 | seaport = {"table", {}}, -- 海岛贸易季 {time = 1234567890, donate = {}, collect = {[1] = {team = "1=2=3", time = 1234567890}}, shop = {}} |
195 | - | |
196 | - returner = {"table", {}}, -- 回归者 {time = 12334233423, [1] = 1, [2] = 2, status = {[1] = 1}} | |
197 | 194 | } |
198 | 195 | |
199 | 196 | |
... | ... | @@ -426,7 +423,6 @@ function Role:data() |
426 | 423 | radioTask = self:getProperty("radioTask"), |
427 | 424 | |
428 | 425 | seaport = self:getProperty("seaport"), |
429 | - returner = self:getProperty("returner"), | |
430 | 426 | } |
431 | 427 | end |
432 | 428 | ... | ... |
src/models/RoleLog.lua
... | ... | @@ -127,9 +127,6 @@ local ItemReason = { |
127 | 127 | refer = 1210, -- 穿戴 |
128 | 128 | itemCompose = 1211, -- 天赋道具合成 |
129 | 129 | radioQuest = 1212, -- 电台任务奖励 |
130 | - changeSpark = 1213, -- 穿戴火花 | |
131 | - sparkLvlUp = 1214, -- 火花强化 | |
132 | - sparkQualityUp = 1215, -- 火花升华 | |
133 | 130 | |
134 | 131 | -- pvp |
135 | 132 | pvpCHead = 1301, -- pvp 跨服竞技场头像 |
... | ... | @@ -143,8 +140,6 @@ local ItemReason = { |
143 | 140 | seaportShop = 1401, -- 贸易港商店兑换 |
144 | 141 | seaportReward = 1402, -- 贸易港阶段奖励 |
145 | 142 | seaportTask = 1403, -- 贸易港任务奖励 |
146 | - | |
147 | - returner = 1410, -- 回归者奖励 | |
148 | 143 | } |
149 | 144 | |
150 | 145 | |
... | ... | @@ -627,8 +622,6 @@ local LogType = { |
627 | 622 | in_adv = "common", |
628 | 623 | out_adv = "common", |
629 | 624 | in_artifact = "common", |
630 | - in_spark = "common", | |
631 | - out_spark = "common", | |
632 | 625 | |
633 | 626 | mail_action = "common", |
634 | 627 | role_action = "common", |
... | ... | @@ -641,7 +634,6 @@ local LogType = { |
641 | 634 | tower_action = "common", |
642 | 635 | gm_action = "common", |
643 | 636 | act_action = "common", |
644 | - spark_action = "common", | |
645 | 637 | } |
646 | 638 | |
647 | 639 | -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -15,7 +15,6 @@ function RolePlugin.bind(Role) |
15 | 15 | self:loadDiner() |
16 | 16 | self:loadActivity() |
17 | 17 | self:loadStoreInfo() |
18 | - self:loadSparks() | |
19 | 18 | end |
20 | 19 | |
21 | 20 | function Role:reloadWhenLogin() |
... | ... | @@ -100,11 +99,6 @@ function RolePlugin.bind(Role) |
100 | 99 | self:addRune({type = typ,id = itemId, notNotify = pms.notNotify, log = pms.log}) |
101 | 100 | end |
102 | 101 | end, |
103 | - [ItemType.Spark] = function() | |
104 | - for _= 1, count do | |
105 | - self:addSpark({id = itemId, notNotify = pms.notNotify, log = pms.log}) | |
106 | - end | |
107 | - end, | |
108 | 102 | [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 |
109 | 103 | count = 0 |
110 | 104 | end, |
... | ... | @@ -763,23 +757,6 @@ function RolePlugin.bind(Role) |
763 | 757 | end |
764 | 758 | end |
765 | 759 | |
766 | - function Role:loadSparks() | |
767 | - local roleId = self:getProperty("id") | |
768 | - local sparkIds = redisproxy:smembers(string.format(R_SPARKIDS, roleId)) | |
769 | - local redret = redisproxy:pipelining(function (red) | |
770 | - for _, sparkId in ipairs(sparkIds) do | |
771 | - red:hgetall(string.format(R_SPARK, roleId, sparkId)) | |
772 | - end | |
773 | - end) | |
774 | - for index, sparkId in ipairs(sparkIds) do | |
775 | - local spark = require("models.Spark").new({key = string.format(R_SPARK, roleId, sparkId)}) | |
776 | - if spark:load(table.array2Table(redret[index])) then | |
777 | - spark.owner = self | |
778 | - self.sparkBag[tonumber(sparkId)] = spark | |
779 | - end | |
780 | - end | |
781 | - end | |
782 | - | |
783 | 760 | -- 0 为操作成功 |
784 | 761 | function Role:addRune(params) |
785 | 762 | if params.type and params.id then |
... | ... | @@ -834,101 +811,6 @@ function RolePlugin.bind(Role) |
834 | 811 | end |
835 | 812 | end |
836 | 813 | |
837 | - -- 0 为操作成功 | |
838 | - function Role:addSpark(params) | |
839 | - if params.id then | |
840 | - local set = csvdb["sparkCsv"][params.id] | |
841 | - if not set then return 2 end | |
842 | - local data = set[0] | |
843 | - if not data then return 3 end | |
844 | - | |
845 | - local roleId = self:getProperty("id") | |
846 | - local sparkUid = tonum(redisproxy:hincrby(string.format(R_INCR, roleId), "spark", 1)) | |
847 | - | |
848 | - redisproxy:sadd(string.format(R_SPARKIDS, roleId), sparkUid) | |
849 | - | |
850 | - local sparkInfo = { | |
851 | - key = string.format(R_SPARK, roleId, sparkUid), | |
852 | - id = sparkUid, | |
853 | - cfg_id = params.id, | |
854 | - } | |
855 | - | |
856 | - local newSpark = require("models.Spark").new(sparkInfo) | |
857 | - newSpark:create() | |
858 | - newSpark:addAttr(data.attr:toNumMap()) | |
859 | - newSpark.owner = self | |
860 | - self.sparkBag[sparkUid] = newSpark | |
861 | - if not params.notNotify then | |
862 | - local response = {} | |
863 | - table.insert(response, newSpark:data()) | |
864 | - dump(response) | |
865 | - SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) | |
866 | - end | |
867 | - --self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) | |
868 | - | |
869 | - self:logItems(params.id, 0, 1, params.log) | |
870 | - if params.log then | |
871 | - local log = clone(params.log) | |
872 | - if log["cint1"] or log["cint2"] or log["cint3"] then | |
873 | - print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
874 | - end | |
875 | - | |
876 | - log["cint1"] = sparkUid | |
877 | - log["cint2"] = params.cfg_id | |
878 | - | |
879 | - self:mylog("in_spark", log) | |
880 | - else | |
881 | - print("addSpark no log ", debug.traceback()) | |
882 | - end | |
883 | - | |
884 | - return 0, newSpark | |
885 | - else | |
886 | - return 1 | |
887 | - end | |
888 | - end | |
889 | - | |
890 | - function Role:delSparks(sparkIds, params) -- 批量删除 {id, } | |
891 | - params = params or {} | |
892 | - local roleId = self:getProperty('id') | |
893 | - local bDel = {} | |
894 | - for _, sparkId in pairs(sparkIds) do | |
895 | - local spark = self.sparkBag[sparkId] | |
896 | - if spark then | |
897 | - | |
898 | - self:logItems(spark:getProperty("id"), 1, 0, params.log) | |
899 | - if params.log then | |
900 | - local log = clone(params.log) | |
901 | - if log["cint1"] or log["cint2"] then | |
902 | - print("delSpark error log have cint1 or cint2 ", debug.traceback()) | |
903 | - end | |
904 | - | |
905 | - log["cint1"] = sparkId | |
906 | - log["cint2"] = spark:getProperty("cfg_id") | |
907 | - | |
908 | - self:mylog("out_spark", log) | |
909 | - else | |
910 | - print("delSparks no log ", debug.traceback()) | |
911 | - end | |
912 | - | |
913 | - self.sparkBag[sparkId] = nil | |
914 | - table.insert(bDel, sparkId) | |
915 | - end | |
916 | - end | |
917 | - | |
918 | - redisproxy:pipelining(function (red) | |
919 | - for _, sparkId in pairs(bDel) do | |
920 | - red:del(string.format(R_SPARK, roleId, sparkId)) | |
921 | - red:srem(string.format(R_SPARKIDS, roleId), sparkId) | |
922 | - end | |
923 | - end) | |
924 | - local response = {} | |
925 | - for _, sparkId in pairs(bDel) do | |
926 | - table.insert(response, {id = sparkId, bDel = true}) | |
927 | - end | |
928 | - | |
929 | - SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) | |
930 | - end | |
931 | - | |
932 | 814 | function Role:delRunes(runeIds, params) -- 批量删除 {id, } |
933 | 815 | params = params or {} |
934 | 816 | local roleId = self:getProperty('id') |
... | ... | @@ -1463,17 +1345,6 @@ function RolePlugin.bind(Role) |
1463 | 1345 | end |
1464 | 1346 | end |
1465 | 1347 | |
1466 | - -- 检查回归者 | |
1467 | - function Role:checkReturner() | |
1468 | - local returner = self:getProperty("returner") or {} | |
1469 | - if next(returner) then return end | |
1470 | - | |
1471 | - local now = specTime({hour = 4}) | |
1472 | - returner.time = now | |
1473 | - | |
1474 | - self:updateProperty({field = "returner", value = returner}) | |
1475 | - end | |
1476 | - | |
1477 | 1348 | function Role:getSeaportServerProgress() |
1478 | 1349 | local result = {} |
1479 | 1350 | ... | ... |
src/models/RoleTask.lua
... | ... | @@ -109,7 +109,6 @@ local TaskType = { |
109 | 109 | CostDiamond = 909, -- 消耗钻石 |
110 | 110 | WeekTask = 910, -- 完成每周活跃任务 |
111 | 111 | ActBattlePass = 911, -- 活动关卡通关 -- chapterId |
112 | - Appoint = 912, -- 触发限时礼包,指定id | |
113 | 112 | |
114 | 113 | --功能未实现 todo |
115 | 114 | AdvShop = 1002, -- 冒险商城 |
... | ... | @@ -265,7 +264,6 @@ local StoreListener = { |
265 | 264 | [TaskType.AdvPassFirst] = {{TriggerEventType.AdvPass, f("id")}}, |
266 | 265 | [TaskType.AddHero] = {{TriggerEventType.AddNewHero, f("heroType")}, {TriggerEventType.SSRCount, f("ssrCount")}}, |
267 | 266 | [TaskType.DrawHeroLimitPack] = {{TriggerEventType.DrawHeroCnt, f("count")}}, |
268 | - [TaskType.Appoint] = {{TriggerEventType.Appoint, f("id")}}, | |
269 | 267 | } |
270 | 268 | } |
271 | 269 | |
... | ... | @@ -321,11 +319,6 @@ local BattleCommandTaskListener = { |
321 | 319 | listen = CalendaTaskListener["listen"] |
322 | 320 | } |
323 | 321 | |
324 | -local ReturnerTask = { | |
325 | - func = "checkReturnerTask", | |
326 | - listen = CalendaTaskListener["listen"] | |
327 | -} | |
328 | - | |
329 | 322 | local TaskListeners = { |
330 | 323 | StoryListener, |
331 | 324 | CommonListener, |
... | ... | @@ -335,7 +328,6 @@ local TaskListeners = { |
335 | 328 | StoreListener, |
336 | 329 | CalendaTaskListener, |
337 | 330 | BattleCommandTaskListener, |
338 | - ReturnerTask, | |
339 | 331 | } |
340 | 332 | |
341 | 333 | local RoleTask = {} |
... | ... | @@ -833,15 +825,6 @@ function RoleTask.bind(Role) |
833 | 825 | self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) |
834 | 826 | end |
835 | 827 | |
836 | - function Role:checkReturnerTask(notNotify, mainType, subType, param1, param2) | |
837 | - -- print("check returner task", mainType, subType, param1, param2) | |
838 | - local returner = self:getProperty("returner") or {} | |
839 | - if not returner.time then return end | |
840 | - local actData = csvdb["activity_ctrlCsv"][76] | |
841 | - local keyName = "returner" | |
842 | - self:checkActTask(notNotify, keyName, actData, mainType, subType, param1, param2) | |
843 | - end | |
844 | - | |
845 | 828 | end |
846 | 829 | |
847 | 830 | return RoleTask | ... | ... |
src/models/RoleTimeReset.lua
... | ... | @@ -28,11 +28,6 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) |
28 | 28 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id |
29 | 29 | end |
30 | 30 | |
31 | - -- 检查回归者 | |
32 | - if ltime ~= 0 and (now - ltime) >= 86400 * globalCsv.returner_time then | |
33 | - self:checkReturner() | |
34 | - end | |
35 | - | |
36 | 31 | response.dTask = {} |
37 | 32 | response.advSup = self:getProperty("advSup") |
38 | 33 | self:log("onLogin") | ... | ... |
src/models/Spark.lua deleted
... | ... | @@ -1,78 +0,0 @@ |
1 | -local Spark = class("Spark", require("shared.ModelBase")) | |
2 | -Spark.schema = { | |
3 | - id = {"number"}, -- 唯一自增id | |
4 | - cfg_id = {"number"}, | |
5 | - level = {"number", 0}, -- 等级 | |
6 | - attrs = {"table", {}} -- 基础属性值 id=value | |
7 | -} | |
8 | - | |
9 | -function Spark:ctor( properties ) | |
10 | - Spark.super.ctor(self, properties) | |
11 | -end | |
12 | - | |
13 | -function Spark:notifyUpdateProperty(field, newValue, oldValue) | |
14 | - local datas = { | |
15 | - id = self:getProperty("id"), | |
16 | - datas = { | |
17 | - { | |
18 | - key = field, | |
19 | - newValue = newValue, | |
20 | - oldValue = oldValue, | |
21 | - } | |
22 | - } | |
23 | - } | |
24 | - self:notifyUpdateProperties(datas) | |
25 | -end | |
26 | - | |
27 | -function Spark:mylog(contents) | |
28 | - contents = contents or {} | |
29 | - if contents["cint1"] or contents["cint2"] then | |
30 | - print("sparkLog error log have cint1 or cint2 ", debug.traceback()) | |
31 | - end | |
32 | - contents["cint1"] = self:getProperty("id") | |
33 | - contents["cint2"] = self:getProperty("cfg_id") | |
34 | - | |
35 | - self.owner:mylog("spark_action", contents) | |
36 | -end | |
37 | - | |
38 | -function Spark:notifyUpdateProperties(params) | |
39 | - local updateData = { | |
40 | - id = self:getProperty("id"), | |
41 | - datas = params | |
42 | - } | |
43 | - SendPacket(actionCodes.Role_updateSpark, MsgPack.pack(updateData)) | |
44 | -end | |
45 | - | |
46 | -function Spark:updateProperty(params) | |
47 | - if not params.field or (not params.delta and not params.value) then | |
48 | - return | |
49 | - end | |
50 | - if params.delta then | |
51 | - self:incrProperty(params.field, params.delta) | |
52 | - elseif params.value then | |
53 | - self:setProperty(params.field, params.value) | |
54 | - end | |
55 | - local datas = {} | |
56 | - table.insert(datas, {key = params.field, newValue = self:getProperty(params.field)}) | |
57 | - | |
58 | - self:notifyUpdateProperties(datas) | |
59 | -end | |
60 | - | |
61 | -function Spark:addAttr(attrs) | |
62 | - local curAttrs = clone(self:getProperty("attrs")) | |
63 | - for k, v in pairs(attrs) do | |
64 | - curAttrs[k] = (curAttrs[k] or 0) + v | |
65 | - end | |
66 | - self:updateProperty({field = "attrs", value = curAttrs}) | |
67 | -end | |
68 | - | |
69 | -function Spark:data() | |
70 | - return { | |
71 | - id = self:getProperty("id"), | |
72 | - cfg_id = self:getProperty("cfg_id"), | |
73 | - level = self:getProperty("level"), | |
74 | - attrs = self:getProperty("attrs"), | |
75 | - } | |
76 | -end | |
77 | - | |
78 | -return Spark | |
79 | 0 | \ No newline at end of file |
src/services/errorlog.lua
... | ... | @@ -22,7 +22,7 @@ local logHandle = { |
22 | 22 | doc["timestamp"] = now |
23 | 23 | doc["instance_id"] = serverId |
24 | 24 | doc["game_name"] = "wasteland" |
25 | - doc["env"] = "prod" | |
25 | + doc["env"] = "cb" | |
26 | 26 | doc["app_name"] = "gs" |
27 | 27 | doc["app_id"] = "game.wasteland.gs" |
28 | 28 | --FATAL、ERROR、WARN、INFO、DEBUG | ... | ... |
src/services/logd.lua
... | ... | @@ -32,7 +32,7 @@ local logHandle = { |
32 | 32 | doc["timestamp"] = now |
33 | 33 | doc["server"] = serverId |
34 | 34 | doc["game_name"] = "wasteland" |
35 | - doc["env"] = "prod" | |
35 | + doc["env"] = "cb" | |
36 | 36 | doc["game_name_type"] = "guaji" |
37 | 37 | doc["log_id"] = prefix .. logId .. "T" .. now |
38 | 38 | logId = (logId + 1) % 10000000 | ... | ... |
src/shared/ModelBase.lua
... | ... | @@ -178,7 +178,7 @@ function ModelBase:loadProperties(properties) |
178 | 178 | properties[field] = MsgPack.unpack(properties[field]) |
179 | 179 | end |
180 | 180 | |
181 | - local val = properties[field] or clone(def) | |
181 | + local val = properties[field] or def | |
182 | 182 | if val ~= nil then |
183 | 183 | if typ == "number" then val = tonumber(val) end |
184 | 184 | assert(type(val) == typ, | ... | ... |