Commit 4eba3da04a8444a7a032ee7abd9eb6e91e448930
Merge branch 'develop' into tr/publish
* develop: cb 返利 重写拆解室功能 去除globald中发放活动排行奖励 支付bug
Showing
5 changed files
with
33 additions
and
1 deletions
Show diff stats
src/GlobalVar.lua
src/actions/RoleAction.lua
@@ -300,6 +300,7 @@ function _M.loginRpc( agent, data ) | @@ -300,6 +300,7 @@ function _M.loginRpc( agent, data ) | ||
300 | if msg.newdevice then | 300 | if msg.newdevice then |
301 | role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | 301 | role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) |
302 | end | 302 | end |
303 | + | ||
303 | return true | 304 | return true |
304 | end | 305 | end |
305 | 306 | ||
@@ -372,6 +373,34 @@ function _M.createRpc(agent, data) | @@ -372,6 +373,34 @@ function _M.createRpc(agent, data) | ||
372 | end | 373 | end |
373 | 374 | ||
374 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) | 375 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) |
376 | + | ||
377 | + -- cb付费返利 | ||
378 | + skynet.timeout(0, function() | ||
379 | + local cbbackd = cluster.query("center", "cbbackd") | ||
380 | + local uid = newRole:getProperty("uid") | ||
381 | + local start = uid:find("_") | ||
382 | + if start then | ||
383 | + uid = uid:sub(start + 1) | ||
384 | + end | ||
385 | + if cbbackd then | ||
386 | + local status, back = pcall(cluster.call, "center", cbbackd, "getCbBack", {uid = uid, id = roleId}) | ||
387 | + if status then | ||
388 | + if back and next(back) then | ||
389 | + local reward = "" | ||
390 | + for itemId, count in pairs(back) do | ||
391 | + reward = reward:setv(itemId, count) | ||
392 | + end | ||
393 | + redisproxy:insertEmail({roleId = roleId, emailId = MailId.CBBackAward, createtime = skynet.timex(), attachments = reward}) | ||
394 | + newRole:mylog("cbback", {key1 = uid, int2 = roleId}) | ||
395 | + end | ||
396 | + else | ||
397 | + skynet.error("[ERROR] cbbackd cant call center uid: " .. uid .. " roleId:" .. roleId) | ||
398 | + end | ||
399 | + else | ||
400 | + skynet.error("[ERROR] cbbackd cant call center uid: " .. uid .. " roleId:" .. roleId) | ||
401 | + end | ||
402 | + end) | ||
403 | + | ||
375 | return true | 404 | return true |
376 | end | 405 | end |
377 | 406 |
src/agent.lua
@@ -15,6 +15,7 @@ redisproxy = require "shared.redisproxy" | @@ -15,6 +15,7 @@ redisproxy = require "shared.redisproxy" | ||
15 | datacenter = require "skynet.datacenter" | 15 | datacenter = require "skynet.datacenter" |
16 | mcast_util = require "services/mcast_util" | 16 | mcast_util = require "services/mcast_util" |
17 | csvdb = require "shared.csvdata" | 17 | csvdb = require "shared.csvdata" |
18 | +cluster = require "skynet.cluster" | ||
18 | 19 | ||
19 | local CMD = {} | 20 | local CMD = {} |
20 | local agentInfo = {} -- { client_fd, role, gate_serv, open_timer} | 21 | local agentInfo = {} -- { client_fd, role, gate_serv, open_timer} |
src/models/RoleLog.lua
@@ -583,6 +583,7 @@ local LogType = { | @@ -583,6 +583,7 @@ local LogType = { | ||
583 | logout = "common", | 583 | logout = "common", |
584 | guide = "common", | 584 | guide = "common", |
585 | newdevice = "common", | 585 | newdevice = "common", |
586 | + cbback = "common", | ||
586 | 587 | ||
587 | in_item = "common", | 588 | in_item = "common", |
588 | out_item = "common", | 589 | out_item = "common", |
src/services/globald.lua