Commit 18ab94e528bdf7cdef64253103ea941d84cd13e3
Merge branch 'tr/bugfix' into tr/publish/release
* tr/bugfix: 切换拆解术式bug,造成获得巨大数量的物品 or global email 添加新的延時類型郵件 # Conflicts: # src/csvdata
Showing
4 changed files
with
28 additions
and
12 deletions
Show diff stats
src/actions/EmailAction.lua
@@ -40,10 +40,17 @@ function _M.listRpc(agent, data) | @@ -40,10 +40,17 @@ function _M.listRpc(agent, data) | ||
40 | local count = 1 | 40 | local count = 1 |
41 | for _, data in ipairs(result) do | 41 | for _, data in ipairs(result) do |
42 | local email = tarr2tab(data) | 42 | local email = tarr2tab(data) |
43 | - if tonum(email.createtime) > role:getProperty("ctime") | ||
44 | - and ( not email.mid or tonum(email.mid) == mid ) | 43 | + -- 0 需要判斷創角時間小於郵件創建時間 1 只需要在時間段內登陸即可領取 |
44 | + local delayType = tonum(email.delayType) | ||
45 | + local flag = false | ||
46 | + if delayType == 1 then | ||
47 | + flag = skynet.timex() > tonum(email.createtime) | ||
48 | + else | ||
49 | + flag = tonum(email.createtime) > role:getProperty("ctime") | ||
50 | + end | ||
51 | + if flag and ( not email.mid or tonum(email.mid) == mid ) | ||
45 | and ( not email.endtime or tonum(email.endtime) > now )then | 52 | and ( not email.endtime or tonum(email.endtime) > now )then |
46 | - local time = math.max(tonum(email.timestamp, 0) or email.createtime) | 53 | + local time = math.max(tonum(email.timestamp, 0) , tonum(email.createtime)) |
47 | redisproxy:insertEmail({ | 54 | redisproxy:insertEmail({ |
48 | roleId = roleId, | 55 | roleId = roleId, |
49 | emailId = 0, | 56 | emailId = 0, |
src/actions/RoleAction.lua
@@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) | @@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) | ||
586 | else | 586 | else |
587 | local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time | 587 | local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time |
588 | local unitTime = globalCsv.box_key_time[oldId] * 60 | 588 | local unitTime = globalCsv.box_key_time[oldId] * 60 |
589 | - local doneCnt = math.floor((process + skynet.timex() - time) / unitTime) | 589 | + local doneCnt = time == 0 and 0 or math.floor((process + skynet.timex() - time) / unitTime) |
590 | if doneCnt > 0 then | 590 | if doneCnt > 0 then |
591 | - reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | 591 | + reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
592 | end | 592 | end |
593 | end | 593 | end |
594 | local limit = globalCsv.box_key_max[itemId] or 5 | 594 | local limit = globalCsv.box_key_max[itemId] or 5 |
@@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
610 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 610 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
611 | local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] | 611 | local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] |
612 | if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end | 612 | if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end |
613 | - role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot}}) | 613 | + role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
614 | else | 614 | else |
615 | stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) | 615 | stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) |
616 | end | 616 | end |
@@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
618 | 618 | ||
619 | local doneCnt = math.floor((process + stopTime - time) / unitTime) | 619 | local doneCnt = math.floor((process + stopTime - time) / unitTime) |
620 | if doneCnt > 0 then | 620 | if doneCnt > 0 then |
621 | - reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | 621 | + reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) |
622 | end | 622 | end |
623 | if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then | 623 | if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then |
624 | nowTime = 0 | 624 | nowTime = 0 |
@@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
687 | reward[id] = (reward[id] or 0) + num | 687 | reward[id] = (reward[id] or 0) + num |
688 | end | 688 | end |
689 | end | 689 | end |
690 | - reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId}}) | 690 | + reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId, int2 = oper}}) |
691 | else | 691 | else |
692 | return | 692 | return |
693 | end | 693 | end |
src/models/RolePlugin.lua
@@ -1506,8 +1506,15 @@ function RolePlugin.bind(Role) | @@ -1506,8 +1506,15 @@ function RolePlugin.bind(Role) | ||
1506 | end) | 1506 | end) |
1507 | for _, data in ipairs(redret) do | 1507 | for _, data in ipairs(redret) do |
1508 | local email = tarr2tab(data) | 1508 | local email = tarr2tab(data) |
1509 | - if tonum(email.createtime) > self:getProperty("ctime") | ||
1510 | - and ( not email.mid or tonum(email.mid) == mid ) | 1509 | + -- 0 需要判斷創角時間小於郵件創建時間 1 只需要在時間段內登陸即可領取 |
1510 | + local delayType = tonum(email.delayType) | ||
1511 | + local flag = false | ||
1512 | + if delayType == 1 then | ||
1513 | + flag = skynet.timex() > tonum(email.createtime) | ||
1514 | + else | ||
1515 | + flag = tonum(email.createtime) > self:getProperty("ctime") | ||
1516 | + end | ||
1517 | + if flag and ( not email.mid or tonum(email.mid) == mid ) | ||
1511 | and ( not email.endtime or tonum(email.endtime) > now )then | 1518 | and ( not email.endtime or tonum(email.endtime) > now )then |
1512 | return true | 1519 | return true |
1513 | end | 1520 | end |
src/services/globald.lua
@@ -69,7 +69,8 @@ local function mailQuene() | @@ -69,7 +69,8 @@ local function mailQuene() | ||
69 | "attachments", email.attachments, | 69 | "attachments", email.attachments, |
70 | "endtime", email.endTime, | 70 | "endtime", email.endTime, |
71 | "mid", email.mid, | 71 | "mid", email.mid, |
72 | - "timestamp", now | 72 | + "timestamp", now, |
73 | + "delayType", email.delayType | ||
73 | ) | 74 | ) |
74 | else | 75 | else |
75 | redisproxy:hmset(string_format("globalEmail:%s", gid), | 76 | redisproxy:hmset(string_format("globalEmail:%s", gid), |
@@ -80,7 +81,8 @@ local function mailQuene() | @@ -80,7 +81,8 @@ local function mailQuene() | ||
80 | "content", email.content, | 81 | "content", email.content, |
81 | "attachments", email.attachments, | 82 | "attachments", email.attachments, |
82 | "endtime", email.endTime, | 83 | "endtime", email.endTime, |
83 | - "timestamp", now | 84 | + "timestamp", now, |
85 | + "delayType", email.delayType | ||
84 | ) | 86 | ) |
85 | end | 87 | end |
86 | end | 88 | end |