Commit 15e9dd2053b45b74793a9888e1586e94b15cbdc7

Authored by jiyue
2 parents 2284b38e 2fdb4d55

Merge branch 'cn/develop' into cn/publish/preview

@@ -95,6 +95,7 @@ ItemType = { @@ -95,6 +95,7 @@ ItemType = {
95 CommonPaster = 18, -- 万能贴纸 95 CommonPaster = 18, -- 万能贴纸
96 BossTicket = 20, -- boss挑战门票 96 BossTicket = 20, -- boss挑战门票
97 Spark = 21, -- 火花 97 Spark = 21, -- 火花
  98 + Stick = 23, -- 贴纸
98 } 99 }
99 100
100 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID 101 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID
src/actions/AdvAction.lua
@@ -514,7 +514,7 @@ function _M.buyAdvCountRpc(agent , data) @@ -514,7 +514,7 @@ function _M.buyAdvCountRpc(agent , data)
514 else 514 else
515 --if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end 515 --if math.illegalNum(count, 1, globalCsv.adv_daily_buy_count - role.dailyData:getProperty("advBC")) then return end
516 local advCount = (role.dailyData:getProperty("advBC") + count ) * globalCsv.adv_daily_buy_num 516 local advCount = (role.dailyData:getProperty("advBC") + count ) * globalCsv.adv_daily_buy_num
517 - cost = {[ItemId.Jade] = table.findMinKeyByItem(globalCsv.adv_buy_cost, advCount, globalCsv.adv_daily_buy_num)} 517 + cost = {[ItemId.Jade] = table.findMinKeyByIndex(globalCsv.adv_buy_cost, advCount, globalCsv.adv_daily_buy_num)}
518 end 518 end
519 519
520 520
src/actions/GmAction.lua
@@ -66,7 +66,7 @@ end @@ -66,7 +66,7 @@ end
66 66
67 function _M.silent(role, pms) 67 function _M.silent(role, pms)
68 local pm1 = tonum(pms.pm1, 0) 68 local pm1 = tonum(pms.pm1, 0)
69 - dump(pms, pm1) 69 + --dump(pms, pm1)
70 if pm1 < 1 then 70 if pm1 < 1 then
71 role:updateProperty({field = "silent", value = 0}) 71 role:updateProperty({field = "silent", value = 0})
72 role:setProperty("silentType", 0) 72 role:setProperty("silentType", 0)
src/actions/HangAction.lua
@@ -478,7 +478,7 @@ function _M.quickRpc(agent , data) @@ -478,7 +478,7 @@ function _M.quickRpc(agent , data)
478 478
479 local change = globalCsv.idle_quickproduce_time / 3600 479 local change = globalCsv.idle_quickproduce_time / 3600
480 local curCount = role.dailyData:getProperty("hangQC") + 1 480 local curCount = role.dailyData:getProperty("hangQC") + 1
481 - local costCount = table.findMinKeyByItem(globalCsv.idle_quickproduce_cost, curCount * change, change) 481 + local costCount = table.findMinKeyByIndex(globalCsv.idle_quickproduce_cost, curCount * change, change)
482 482
483 if not role:checkItemEnough({[ItemId.Jade] = costCount}) then return 2 end 483 if not role:checkItemEnough({[ItemId.Jade] = costCount}) then return 2 end
484 role:costItems({[ItemId.Jade] = costCount}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) 484 role:costItems({[ItemId.Jade] = costCount}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
@@ -575,7 +575,7 @@ function _M.buyBonusCountRpc(agent, data) @@ -575,7 +575,7 @@ function _M.buyBonusCountRpc(agent, data)
575 --if math.illegalNum(count, 1, lastCount) then return 1 end 575 --if math.illegalNum(count, 1, lastCount) then return 1 end
576 576
577 local costCount = bonusC[btype]["b"] + count 577 local costCount = bonusC[btype]["b"] + count
578 - local cost = table.findMinKeyByItem(globalCsv.bonus_buy_cost, costCount, 1) 578 + local cost = table.findMinKeyByIndex(globalCsv.bonus_buy_cost, costCount, 1)
579 579
580 if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end 580 if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end
581 581
src/actions/RoleAction.lua
@@ -83,9 +83,6 @@ function _M.loginRpc( agent, data ) @@ -83,9 +83,6 @@ function _M.loginRpc( agent, data )
83 end 83 end
84 end 84 end
85 85
86 - -- 设备记录  
87 - redisproxy:sadd(string_format("device:%d", roleId), msg.device)  
88 -  
89 local now = skynet.timex() 86 local now = skynet.timex()
90 local role = agent.role 87 local role = agent.role
91 -- 2 88 -- 2
@@ -338,8 +335,14 @@ function _M.loginRpc( agent, data ) @@ -338,8 +335,14 @@ function _M.loginRpc( agent, data )
338 335
339 local hangPass = role:getProperty("hangPass") 336 local hangPass = role:getProperty("hangPass")
340 role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) 337 role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0})
341 - if msg.newdevice then  
342 - role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) 338 +
  339 + -- 是否是新设备
  340 + local deviced = cluster.query("center", "deviced")
  341 + if deviced then
  342 + local status, back = pcall(cluster.call, "center", deviced, "isNewDevice", {device = msg.device})
  343 + if status and back then
  344 + role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]})
  345 + end
343 end 346 end
344 347
345 return true 348 return true
@@ -1285,10 +1288,13 @@ function _M.chatRpc(agent, data) @@ -1285,10 +1288,13 @@ function _M.chatRpc(agent, data)
1285 red:rpush(CHAT_OFFLINE:format(objectId), bin) 1288 red:rpush(CHAT_OFFLINE:format(objectId), bin)
1286 red:ltrim(CHAT_OFFLINE:format(objectId), -200, -1) 1289 red:ltrim(CHAT_OFFLINE:format(objectId), -200, -1)
1287 end) 1290 end)
1288 - -- 若在线,实时发送聊天信息  
1289 - local agent = datacenter.get("agent", objectId)  
1290 - if agent then  
1291 - SendPacket(actionCodes.Role_chat, bin, agent.fd) 1291 +
  1292 + if role:getProperty("silent") < now then --禁言
  1293 + -- 若在线,实时发送聊天信息
  1294 + local agent = datacenter.get("agent", objectId)
  1295 + if agent then
  1296 + SendPacket(actionCodes.Role_chat, bin, agent.fd)
  1297 + end
1292 end 1298 end
1293 end 1299 end
1294 SendPacket(actionCodes.Role_chat, bin) 1300 SendPacket(actionCodes.Role_chat, bin)
@@ -1603,7 +1609,7 @@ function _M.useSelectItemRpc(agent, data) @@ -1603,7 +1609,7 @@ function _M.useSelectItemRpc(agent, data)
1603 local count = msg.count 1609 local count = msg.count
1604 if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end 1610 if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end
1605 local itemData = csvdb["itemCsv"][itemId] 1611 local itemData = csvdb["itemCsv"][itemId]
1606 - if not (itemData.type == ItemType.SelectItemBox or itemData.type == ItemType.CommonPaster) then return end 1612 + if not (itemData.type == ItemType.SelectItemBox or itemData.type == ItemType.CommonPaster or itemData.type == ItemType.Stick) then return end
1607 local itemMap = itemData.use_effect:toNumMap() 1613 local itemMap = itemData.use_effect:toNumMap()
1608 local reward, change = {} 1614 local reward, change = {}
1609 for k, v in pairs(itemMap) do 1615 for k, v in pairs(itemMap) do
src/models/Email.lua
@@ -10,7 +10,7 @@ Email.schema = { @@ -10,7 +10,7 @@ Email.schema = {
10 emailId = {"number", 0}, -- 邮件csv ID 10 emailId = {"number", 0}, -- 邮件csv ID
11 title = {"string", ""}, -- 邮件标题 11 title = {"string", ""}, -- 邮件标题
12 stitle = {"string", ""}, -- 小标题 12 stitle = {"string", ""}, -- 小标题
13 - content = {"string", ""}, -- 邮件正文 13 + content = {"string", "", 2048}, -- 邮件正文
14 attachments = {"string", "", 512}, 14 attachments = {"string", "", 512},
15 status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取 15 status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取
16 createtime = {"number", skynet.timex()}, 16 createtime = {"number", skynet.timex()},
src/models/RolePlugin.lua
@@ -494,7 +494,7 @@ function RolePlugin.bind(Role) @@ -494,7 +494,7 @@ function RolePlugin.bind(Role)
494 local originr = self:getProperty("sid") == IOS_SID and self:getProperty("reDiamondIos") or self:getProperty("reDiamond") 494 local originr = self:getProperty("sid") == IOS_SID and self:getProperty("reDiamondIos") or self:getProperty("reDiamond")
495 local origin = origind + originr 495 local origin = origind + originr
496 --if params.isRecharge then 496 --if params.isRecharge then
497 - if params.sid == IOS_SID then 497 + if self:getProperty("sid") == IOS_SID then
498 self:incrProperty("reDiamondIos", count) 498 self:incrProperty("reDiamondIos", count)
499 else 499 else
500 self:incrProperty("reDiamond", count) 500 self:incrProperty("reDiamond", count)
src/services/dbseed.lua
@@ -266,7 +266,10 @@ local function doUpdateSql() @@ -266,7 +266,10 @@ local function doUpdateSql()
266 }, 266 },
267 [2] = { 267 [2] = {
268 "ALTER TABLE `Rune` MODIFY COLUMN `refer` bigint;" 268 "ALTER TABLE `Rune` MODIFY COLUMN `refer` bigint;"
269 - } 269 + },
  270 + [3] = {
  271 + "ALTER TABLE `Email` MODIFY COLUMN `refer` VARCHAR(2048);"
  272 + },
270 } 273 }
271 -- 更新记录表 274 -- 更新记录表
272 local res = mysqlproxy:query("SELECT `value` FROM `autoincrement_set` WHERE `key` = 'db_ver';") 275 local res = mysqlproxy:query("SELECT `value` FROM `autoincrement_set` WHERE `key` = 'db_ver';")
src/shared/functions.lua
@@ -865,12 +865,13 @@ function table.array2Table(arr) @@ -865,12 +865,13 @@ function table.array2Table(arr)
865 return ret 865 return ret
866 end 866 end
867 867
868 -function table.findMinKeyByItem(t, item, change)  
869 - if next(t) and not t[item] then  
870 - item = item - change  
871 - return table.findMinKeyByItem(t, item, change) 868 +function table.findMinKeyByIndex(t, index, change)
  869 + if not next(t or {}) then return nil end
  870 + if not t[index] then
  871 + index = index - change
  872 + return table.findMinKeyByIndex(t, index, change)
872 else 873 else
873 - return t[item] 874 + return t[index]
874 end 875 end
875 end 876 end
876 877