diff --git a/src/actions/SeaportAction.lua b/src/actions/SeaportAction.lua index c163b12..6bcf728 100644 --- a/src/actions/SeaportAction.lua +++ b/src/actions/SeaportAction.lua @@ -59,6 +59,12 @@ function _M.donateRpc(agent, data) redisproxy:hincrby(SEAPORT_TRADE_TASK_2,id,itemCount) end + local seaport = role:getProperty("seaport") or {} + if not seaport.join then + seaport.join = 1 + role:updateProperty({field = "seaport", value = seaport}) + end + role:costItems({[itemId] = itemCount}, {log = {desc = "seaportDonate", int1 = phase, int2 = id}}) local reward, change = role:award(rewards, {log = {desc = "seaportDonate", int1 = ddata.phase, int2 = ddata.id}}) diff --git a/src/models/Role.lua b/src/models/Role.lua index 01e6dda..10045c0 100644 --- a/src/models/Role.lua +++ b/src/models/Role.lua @@ -198,7 +198,7 @@ Role.schema = { nbTask = {"table", {}}, -- 新用户活动 radioTask = {"table", {}}, -- 电台任务 {id = {time=end_ts,heros=heros}} 表crusadeCsv - seaport = {"table", {}}, -- 海岛贸易季 {time = 1234567890, donate = {}, collect = {[1] = {team = "1=2=3", time = 1234567890}}, shop = {}} + seaport = {"table", {}}, -- 海岛贸易季 {time = 1234567890, donate = {}, collect = {[1] = {team = "1=2=3", time = 1234567890}}, shop = {}, join = 1} returner = {"table", {}}, -- 回归者 {time = 12334233423, [1] = 1, [2] = 2, status = {[1] = 1}} diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 89d22de..151a65c 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1370,7 +1370,7 @@ function RolePlugin.bind(Role) local function getReward(reset) -- 全服捐赠奖励 local donate = seaport.donate or {} - if not reset and (not donate[1] or not donate[2]) then + if not reset and seaport.join and (not donate[1] or not donate[2]) then local result = self:getSeaportServerProgress() for idx, set in ipairs(csvdb["seaport_purchaseCsv"]) do local done = true -- libgit2 0.21.2