Commit e3c5cc5e58c9e9800943607438b817bcc8104802
1 parent
3e6433e1
跨服竞技场over
Showing
18 changed files
with
602 additions
and
87 deletions
Show diff stats
src/ProtocolCode.lua
... | ... | @@ -5,8 +5,6 @@ actionCodes = { |
5 | 5 | Sys_innerErrorMsg = 4, |
6 | 6 | Sys_commonNotice = 5, |
7 | 7 | Sys_maintainNotice = 6, |
8 | - Sys_kickdown = 7, | |
9 | - Sys_runningHorse = 8, | |
10 | 8 | |
11 | 9 | Gm_clientRequest = 20, |
12 | 10 | Gm_receiveResponse = 21, |
... | ... | @@ -162,6 +160,12 @@ actionCodes = { |
162 | 160 | Pvp_endBattleHRpc = 511, |
163 | 161 | Pvp_highDivisionGiftRpc = 512, |
164 | 162 | Pvp_shopBuyRpc = 513, |
163 | + Pvp_crossInfoRpc = 514, | |
164 | + Pvp_crossRoleInfoRpc = 515, | |
165 | + Pvp_crossRoleInfoDetailRpc = 516, | |
166 | + Pvp_crossMatchRecordRpc = 517, | |
167 | + Pvp_crossBetInfoRpc = 518, | |
168 | + Pvp_crossBetRpc = 519, | |
165 | 169 | |
166 | 170 | |
167 | 171 | Store_rechargeRpc = 550, | ... | ... |
src/actions/HttpAction.lua
src/actions/PvpAction.lua
... | ... | @@ -97,6 +97,7 @@ function _M.formatHighRpc(agent , data) |
97 | 97 | end |
98 | 98 | |
99 | 99 | role:savePvpHTeam(pvpTH) |
100 | + role:changeCrossServerPvpSelfInfo("format") | |
100 | 101 | SendPacket(actionCodes.Pvp_formatHighRpc, '') |
101 | 102 | return true |
102 | 103 | end |
... | ... | @@ -615,6 +616,7 @@ function _M.endBattleHRpc(agent, data) |
615 | 616 | -- 加入战斗记录 |
616 | 617 | local selfTeam = {} |
617 | 618 | local enemyTeam = {} |
619 | + | |
618 | 620 | for _idx, info in ipairs(_pvpStartBattleCacheH.result) do |
619 | 621 | info.winId = info.isWin and roleId or match.id |
620 | 622 | info.isWin = nil |
... | ... | @@ -623,7 +625,10 @@ function _M.endBattleHRpc(agent, data) |
623 | 625 | battleV = role:getTeamBattleValue(_pvpStartBattleCacheH.pvpTH[_idx].heros) |
624 | 626 | } |
625 | 627 | if match.t == 1 and _pvpStartBattleCacheH.enemyT then |
626 | - enemyTeam[_idx] = _pvpStartBattleCacheH.enemyT[_idx] | |
628 | + enemyTeam[_idx] = { | |
629 | + heros = _pvpStartBattleCacheH.enemyT["heros"][_idx], | |
630 | + battleV = _pvpStartBattleCacheH.enemyT["battleV"][_idx] | |
631 | + } | |
627 | 632 | end |
628 | 633 | end |
629 | 634 | local recordBattle = { |
... | ... | @@ -864,4 +869,98 @@ function _M.shopBuyRpc(agent, data) |
864 | 869 | return true |
865 | 870 | end |
866 | 871 | |
872 | + | |
873 | +----------------------------跨服竞技场---------------------------------- | |
874 | + | |
875 | +function _M.crossInfoRpc(agent, data) | |
876 | + local role = agent.role | |
877 | + local roleId = role:getProperty("id") | |
878 | + | |
879 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | |
880 | + | |
881 | + local result = role:getCrossServerPvpMatchInfo() | |
882 | + if not result then return end | |
883 | + | |
884 | + SendPacket(actionCodes.Pvp_crossInfoRpc, MsgPack.pack(result)) | |
885 | + return true | |
886 | +end | |
887 | + | |
888 | +function _M.crossRoleInfoRpc(agent, data) | |
889 | + local role = agent.role | |
890 | + local roleId = role:getProperty("id") | |
891 | + | |
892 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | |
893 | + | |
894 | + local result = role:getCrossServerPvpRoleInfo() | |
895 | + if not result then return end | |
896 | + | |
897 | + SendPacket(actionCodes.Pvp_crossRoleInfoRpc, MsgPack.pack({roleInfo = result})) | |
898 | + return true | |
899 | +end | |
900 | + | |
901 | + | |
902 | +function _M.crossRoleInfoDetailRpc(agent, data) | |
903 | + local role = agent.role | |
904 | + local roleId = role:getProperty("id") | |
905 | + | |
906 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | |
907 | + local msg = MsgPack.unpack(data) | |
908 | + if not msg.ids or not next(msg.ids) then return end | |
909 | + | |
910 | + local result = role:getCrossServerPvpRoleInfoDeatil(msg.ids) | |
911 | + if not result then return end | |
912 | + | |
913 | + SendPacket(actionCodes.Pvp_crossRoleInfoDetailRpc, MsgPack.pack(result)) | |
914 | + return true | |
915 | +end | |
916 | + | |
917 | + | |
918 | +function _M.crossMatchRecordRpc(agent, data) | |
919 | + local role = agent.role | |
920 | + local roleId = role:getProperty("id") | |
921 | + | |
922 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return 1 end | |
923 | + local msg = MsgPack.unpack(data) | |
924 | + if not msg.round then return 2 end | |
925 | + if not msg.matchIdx then return 3 end | |
926 | + | |
927 | + local result = role:getCrossServerPvpMatchRecord(msg.round, msg.matchIdx) | |
928 | + if not result then return 4 end | |
929 | + | |
930 | + SendPacket(actionCodes.Pvp_crossMatchRecordRpc, MsgPack.pack(result)) | |
931 | + return true | |
932 | +end | |
933 | + | |
934 | +function _M.crossBetInfoRpc(agent, data) | |
935 | + local role = agent.role | |
936 | + local roleId = role:getProperty("id") | |
937 | + | |
938 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | |
939 | + | |
940 | + local result = role:getCrossServerPvpBetInfo() | |
941 | + if not result then return end | |
942 | + | |
943 | + | |
944 | + SendPacket(actionCodes.Pvp_crossBetInfoRpc, MsgPack.pack(result)) | |
945 | + return true | |
946 | +end | |
947 | + | |
948 | +function _M.crossBetRpc(agent, data) | |
949 | + local role = agent.role | |
950 | + local roleId = role:getProperty("id") | |
951 | + local msg = MsgPack.unpack(data) | |
952 | + | |
953 | + if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | |
954 | + if msg.idx ~= 1 and msg.idx ~= 2 then return end | |
955 | + | |
956 | + local result = role:getCrossServerPvpBet(msg.idx) | |
957 | + if not result then return end | |
958 | + | |
959 | + SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) | |
960 | + return true | |
961 | +end | |
962 | + | |
963 | + | |
964 | + | |
965 | + | |
867 | 966 | return _M |
868 | 967 | \ No newline at end of file | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -54,11 +54,11 @@ local _M = {} |
54 | 54 | function _M.loginRpc( agent, data ) |
55 | 55 | local msg = MsgPack.unpack(data) |
56 | 56 | local response = {} |
57 | - -- if msg.version ~= globalCsv.version then | |
58 | - -- response.result = "UPDATE_TIP" | |
59 | - -- SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) | |
60 | - -- return true | |
61 | - -- end | |
57 | + if msg.codeVersion ~= globalCsv.codeVersion then | |
58 | + response.result = "UPDATE_TIP" | |
59 | + SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) | |
60 | + return true | |
61 | + end | |
62 | 62 | |
63 | 63 | -- 1. |
64 | 64 | local roleId = redisproxy:get(string_format("user:%s", string.upper(msg.name))) |
... | ... | @@ -345,6 +345,8 @@ function _M.changeNameRpc(agent, data) |
345 | 345 | role:updateProperties({ |
346 | 346 | ["name"] = newName, |
347 | 347 | }) |
348 | + | |
349 | + role:changeCrossServerPvpSelfInfo("name") | |
348 | 350 | SendPacket(actionCodes.Role_changeNameRpc, MsgPack.pack({result = 0})) |
349 | 351 | return true |
350 | 352 | end |
... | ... | @@ -938,6 +940,7 @@ function _M.changeHeadRpc(agent, data) |
938 | 940 | return |
939 | 941 | end |
940 | 942 | role:updateProperty({field = "headId" ,value = id}) |
943 | + role:changeCrossServerPvpSelfInfo("headId") | |
941 | 944 | SendPacket(actionCodes.Role_changeHeadRpc, "") |
942 | 945 | return true |
943 | 946 | end | ... | ... |
src/adv/Adv.lua
... | ... | @@ -1563,11 +1563,12 @@ function Adv:mapItemChange(ctype) |
1563 | 1563 | for blockId, block in pairs(room.blocks) do |
1564 | 1564 | if block:getEventType() == AdvEventType.Drop and block.event.item then |
1565 | 1565 | local id = block.event.item[1] |
1566 | + local count = block.event.item[2] | |
1566 | 1567 | local changeTo = nil |
1567 | 1568 | if clist[id] then |
1568 | - changeTo = {clist[id].toId, clist[id].num} | |
1569 | + changeTo = {clist[id].toId, math.ceil(count * clist[id].num)} | |
1569 | 1570 | elseif clist[-1] then |
1570 | - changeTo = {clist[-1].toId, clist[-1].num} | |
1571 | + changeTo = {clist[-1].toId, math.ceil(count * clist[-1].num)} | |
1571 | 1572 | end |
1572 | 1573 | if changeTo and changeTo[1] ~= 0 and changeTo[2] ~= 0 then |
1573 | 1574 | block.event.item = changeTo | ... | ... |
src/agent.lua
src/config
... | ... | @@ -8,6 +8,7 @@ logd = 0 -- 是否开启日志 |
8 | 8 | servId = 1 |
9 | 9 | baseId = 0 |
10 | 10 | codeurl = "120.26.43.151:9090" |
11 | +cluster = "./src/nodenames.lua" | |
11 | 12 | |
12 | 13 | lua_path = root .."skynet/lualib/?.lua;"..root.."src/?.lua;"..root.."tools/?.lua" |
13 | 14 | luaservice = root.."skynet/service/?.lua;"..root.."src/?.lua" | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +-- pvpd 需要的内容 | |
2 | +local Pvpd = class("Pvpd", require("shared.ModelBase")) | |
3 | + | |
4 | +function Pvpd:ctor( properties ) | |
5 | + Pvpd.super.ctor(self, properties) | |
6 | +end | |
7 | + | |
8 | + | |
9 | +Pvpd.schema = { | |
10 | + betInfo = {"table", {}}, -- 押注的场次信息 {[round] = matchIdx} | |
11 | + betNum = {"table", {}}, -- 押注[1]的人数 | |
12 | +} | |
13 | + | |
14 | +return Pvpd | |
0 | 15 | \ No newline at end of file | ... | ... |
src/models/Role.lua
... | ... | @@ -40,6 +40,7 @@ Role.schema = { |
40 | 40 | device = {"string", ""}, |
41 | 41 | banTime = {"number", 0}, |
42 | 42 | banType = {"number", 0}, |
43 | + heartWarning = {"number", 0}, | |
43 | 44 | ltime = {"number", 0}, -- 最后登录时间 |
44 | 45 | ctime = {"number", skynet.timex()}, -- 创建时间 |
45 | 46 | ignoreMt = {"number", 0}, -- 忽略维护拦截 |
... | ... | @@ -113,7 +114,7 @@ Role.schema = { |
113 | 114 | pvpHGift = {"table", {}}, -- pvp 高级段位每小时奖励缓存 |
114 | 115 | pvpHGTime = {"number", 0}, -- pvp 高级段位上次奖励刷新时间 |
115 | 116 | pvpShop = {"table", {}}, -- pvp 商店{id = count} 对应商店id 购买次数 |
116 | - | |
117 | + pvpBet = {"table", {}}, -- 跨服竞技场押注信息 {[round] = {1, 1000}} | |
117 | 118 | |
118 | 119 | potionBag = {"table", {}}, -- 营养剂背包 |
119 | 120 | ... | ... |
src/models/RoleLog.lua
... | ... | @@ -4,6 +4,7 @@ local LogType = { |
4 | 4 | create = "common", |
5 | 5 | login = "common", |
6 | 6 | logout = "common", |
7 | + gm = "common", | |
7 | 8 | } |
8 | 9 | |
9 | 10 | -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* |
... | ... | @@ -45,10 +46,10 @@ local function checkType(logType, field, value, ctype) |
45 | 46 | --长度不超过256 |
46 | 47 | if type(value) ~= "string" then |
47 | 48 | value = tostring(value) |
48 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [keyword]", logType, field)) | |
49 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [keyword], value : %s", logType, field, value)) | |
49 | 50 | else |
50 | 51 | if #value > 256 then |
51 | - print(string.format("LOG ERROR: logType [%s] field [%s] [keyword] type to long.", logType, field)) | |
52 | + print(string.format("LOG ERROR: logType [%s] field [%s] [keyword] type to long. value : %s", logType, field, value)) | |
52 | 53 | end |
53 | 54 | end |
54 | 55 | return value |
... | ... | @@ -56,26 +57,26 @@ local function checkType(logType, field, value, ctype) |
56 | 57 | text = function() |
57 | 58 | if type(value) ~= "string" then |
58 | 59 | value = tostring(value) |
59 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [text]", logType, field)) | |
60 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [text], value : %s", logType, field, value)) | |
60 | 61 | end |
61 | 62 | return value |
62 | 63 | end, |
63 | 64 | integer = function() |
64 | 65 | if type(value) ~= "number" then |
65 | 66 | value = tonumber(value) |
66 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer]", logType, field)) | |
67 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], value : %s", logType, field, value)) | |
67 | 68 | end |
68 | 69 | if value then |
69 | 70 | if math.type(value) ~= "integer" then |
70 | 71 | local oldValue = value |
71 | 72 | value = math.floor(value) |
72 | 73 | if value ~= oldValue then |
73 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], is float", logType, field)) | |
74 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], is float, value : %s", logType, field, value)) | |
74 | 75 | end |
75 | 76 | end |
76 | 77 | if -2147483648 > value or value > 2147483647 then |
77 | 78 | value = nil |
78 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], too big", logType, field)) | |
79 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], too big, value : %s", logType, field, value)) | |
79 | 80 | end |
80 | 81 | end |
81 | 82 | return value |
... | ... | @@ -83,20 +84,20 @@ local function checkType(logType, field, value, ctype) |
83 | 84 | short = function() |
84 | 85 | if type(value) ~= "number" then |
85 | 86 | value = tonumber(value) |
86 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short]", logType, field)) | |
87 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], value : %s", logType, field, value)) | |
87 | 88 | end |
88 | 89 | if value then |
89 | 90 | if math.type(value) ~= "integer" then |
90 | 91 | local oldValue = value |
91 | 92 | value = math.floor(value) |
92 | 93 | if value ~= oldValue then |
93 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], is float", logType, field)) | |
94 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], is float, value : %s", logType, field, value)) | |
94 | 95 | end |
95 | 96 | end |
96 | 97 | |
97 | 98 | if -32768 > value or value > 32768 then |
98 | 99 | value = nil |
99 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], too big", logType, field)) | |
100 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], too big, value : %s", logType, field, value)) | |
100 | 101 | end |
101 | 102 | end |
102 | 103 | return value |
... | ... | @@ -104,7 +105,7 @@ local function checkType(logType, field, value, ctype) |
104 | 105 | long = function() |
105 | 106 | if type(value) ~= "number" then |
106 | 107 | value = tonumber(value) |
107 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long]", logType, field)) | |
108 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], value : %s", logType, field, value)) | |
108 | 109 | end |
109 | 110 | if value then |
110 | 111 | if math.type(value) ~= "integer" then |
... | ... | @@ -112,9 +113,9 @@ local function checkType(logType, field, value, ctype) |
112 | 113 | value = math.floor(value) |
113 | 114 | if type(value) ~= "integer" then |
114 | 115 | value = nil |
115 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], too big", logType, field)) | |
116 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], too big, value : %s", logType, field, value)) | |
116 | 117 | elseif value ~= oldValue then |
117 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], is float", logType, field)) | |
118 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], is float, value : %s", logType, field, value)) | |
118 | 119 | end |
119 | 120 | end |
120 | 121 | end |
... | ... | @@ -123,7 +124,7 @@ local function checkType(logType, field, value, ctype) |
123 | 124 | float = function() |
124 | 125 | if type(value) ~= "number" then |
125 | 126 | value = tonumber(value) |
126 | - print(string.format("LOG ERROR: logType [%s] field [%s] isn't [float]", logType, field)) | |
127 | + print(string.format("LOG ERROR: logType [%s] field [%s] isn't [float], value : %s", logType, field, value)) | |
127 | 128 | end |
128 | 129 | return value |
129 | 130 | end, | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -156,6 +156,7 @@ function RolePlugin.bind(Role) |
156 | 156 | end |
157 | 157 | end |
158 | 158 | self:updateProperties({level = level, exp = newExp}) |
159 | + self:changeCrossServerPvpSelfInfo("level") | |
159 | 160 | end |
160 | 161 | |
161 | 162 | function Role:addItem(params) |
... | ... | @@ -528,19 +529,40 @@ function RolePlugin.bind(Role) |
528 | 529 | |
529 | 530 | function Role:warningHeartTooQuick() |
530 | 531 | -- 加速器检测 |
531 | - -- local heartWarning = self:getProperty("heartWarning") | |
532 | - -- heartWarning = heartWarning + 1 | |
533 | - -- self:setProperty("heartWarning", heartWarning) | |
534 | - -- if heartWarning == 50 then | |
535 | - -- self:setProperty("delete", 1) | |
536 | - -- self:sendGmMsg("系统检测到你多次使用加速器,已经将你封杀,请联系管理员。") | |
537 | - -- self:log("gmAction",{desc = "ban"}) | |
538 | - -- return | |
539 | - -- end | |
540 | - -- if heartWarning < 50 and heartWarning % 5 == 0 then | |
541 | - -- self:sendGmMsg("警告!系统检测到你使用加速器,请立即停止使用!否则我们将封杀此账号!") | |
542 | - -- self:log("gmAction",{desc = "heartWarning", count = heartWarning}) | |
543 | - -- end | |
532 | + local heartWarning = self:getProperty("heartWarning") | |
533 | + heartWarning = heartWarning + 1 | |
534 | + self:setProperty("heartWarning", heartWarning) | |
535 | + if heartWarning == 50 then | |
536 | + self:setProperty("delete", 1) | |
537 | + self:sendGmMsg("server_accountBanned_inGame_1") | |
538 | + self:log("gm",{desc = "ban"}) | |
539 | + return | |
540 | + end | |
541 | + if heartWarning < 50 and heartWarning % 5 == 0 then | |
542 | + self:sendGmMsg("server_accountBanned_warning") | |
543 | + self:log("gm",{desc = "heartWarning", int1 = heartWarning}) | |
544 | + end | |
545 | + end | |
546 | + | |
547 | + function Role:setBan(time, banType) | |
548 | + time = time or 0 | |
549 | + banType = banType or 0 | |
550 | + local now = skynet.timex() | |
551 | + if time == 0 then | |
552 | + self:setProperty("banTime", 0) | |
553 | + self:setProperty("banType", 0) | |
554 | + self:setProperty("heartWarning", 0) | |
555 | + | |
556 | + self:log("gm", {desc = "ban_rm"}) | |
557 | + else | |
558 | + self:setProperty("banTime", now + 86400 * time) | |
559 | + self:setProperty("banType", banType) | |
560 | + self:log("gm",{desc = "ban", int1 = time, int2 = banType}) | |
561 | + end | |
562 | + end | |
563 | + | |
564 | + function Role:sendGmMsg(text, isNotKey) | |
565 | + SendPacket(actionCodes.Sys_maintainNotice, MsgPack.pack({ body = text, iskey = not isNotKey})) | |
544 | 566 | end |
545 | 567 | |
546 | 568 | function Role:getHeroActiveRelationData(heros) | ... | ... |
src/models/RolePvp.lua
... | ... | @@ -352,6 +352,167 @@ end |
352 | 352 | |
353 | 353 | |
354 | 354 | |
355 | + | |
356 | + | |
357 | +-------------------- 跨服竞技场相关 ----------------------- | |
358 | +local serverId = tonumber(skynet.getenv("servId")) | |
359 | +-- 自己是否参赛 -- 更换头像 名字 队伍 需要上传 | |
360 | +function Role:isCrossServerPvpPlayer() | |
361 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then | |
362 | + self._isCrossServerPvpPlayer = nil | |
363 | + return false | |
364 | + end | |
365 | + if self._isCrossServerPvpPlayer == nil then | |
366 | + self:getCrossServerPvpMatchInfo() | |
367 | + end | |
368 | + return self._isCrossServerPvpPlayer | |
369 | +end | |
370 | + | |
371 | +function Role:changeCrossServerPvpSelfInfo(cType) | |
372 | + if not self:isCrossServerPvpPlayer() then return end | |
373 | + local change = {id = self:packPvpCrossRoleId(serverId, self:getProperty("id"))} | |
374 | + if cType == "name" or cType == "level" or cType == "headId" then | |
375 | + change[cType] = self:getProperty(cType) | |
376 | + elseif cType == "format" then | |
377 | + -- 是否过了时间 | |
378 | + local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) | |
379 | + local aday = 3600 * 24 | |
380 | + local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | |
381 | + local ctime = crossTime % aday -- 当前在本天 经过多少时间 | |
382 | + | |
383 | + if day > globalCsv.pvp_cross_server_day or ctime >= globalCsv.pvp_cross_server_stop_format then | |
384 | + return | |
385 | + end | |
386 | + change.battleV = self:getProperty("pvpTBVH") | |
387 | + change.heros = self:getProperty("pvpTSH") | |
388 | + change.battleInfo = self:getProperty("pvpTBH") | |
389 | + end | |
390 | + | |
391 | + pcall(skynet.call, pvpd, "lua", "updateRoleInfo", change) | |
392 | +end | |
393 | + | |
394 | +-- 获取当前阵容信息 | |
395 | +function Role:getCrossServerPvpMatchInfo() | |
396 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
397 | + local ok, result = pcall(skynet.call, pvpd, "lua", "getMatchInfo") | |
398 | + if ok then | |
399 | + local cur = result.roleInfo and result.roleInfo[self:packPvpCrossRoleId(serverId, self:getProperty("id"))] | |
400 | + self._isCrossServerPvpPlayer = cur and true or false | |
401 | + return result | |
402 | + else | |
403 | + print(result) | |
404 | + end | |
405 | +end | |
406 | + | |
407 | +-- 获取角色信息 简略 | |
408 | +function Role:getCrossServerPvpRoleInfo() | |
409 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
410 | + | |
411 | + local ok, result = pcall(skynet.call, pvpd, "lua", "getRoleInfo") | |
412 | + if ok then | |
413 | + return result | |
414 | + else | |
415 | + print(result) | |
416 | + end | |
417 | +end | |
418 | + | |
419 | +function Role:getCrossServerPvpRoleInfoDeatil(pIds) | |
420 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
421 | + | |
422 | + local ok, result = pcall(skynet.call, pvpd, "lua", "getRoleDetail", pIds) | |
423 | + if ok then | |
424 | + return result | |
425 | + else | |
426 | + print(result) | |
427 | + end | |
428 | +end | |
429 | + | |
430 | +function Role:getCrossServerPvpMatchRecord(round, matchIdx) | |
431 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
432 | + | |
433 | + local ok, result = pcall(skynet.call, pvpd, "lua", "getMatchRecord", round, matchIdx) | |
434 | + if ok then | |
435 | + return result | |
436 | + else | |
437 | + print(result) | |
438 | + end | |
439 | +end | |
440 | + | |
441 | +function Role:getCrossServerPvpBetInfo() | |
442 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
443 | + local pvpBet = self:getProperty("pvpBet") | |
444 | + local back = {} | |
445 | + | |
446 | + local ok, result = pcall(skynet.call, pvpd, "lua", "getBetInfo") | |
447 | + | |
448 | + if ok then | |
449 | + if result.betInfo then | |
450 | + local maxRound = 0 | |
451 | + for round, matchIdx in pairs(result.betInfo) do | |
452 | + if round > maxRound then | |
453 | + maxRound = round | |
454 | + end | |
455 | + back[round] = { | |
456 | + matchIdx = matchIdx, | |
457 | + bet = pvpBet[round] | |
458 | + } | |
459 | + end | |
460 | + if maxRound ~= 0 then | |
461 | + back[maxRound].betNum = result.betNum | |
462 | + end | |
463 | + end | |
464 | + return back | |
465 | + else | |
466 | + print(result) | |
467 | + end | |
468 | +end | |
469 | + | |
470 | +function Role:getCrossServerPvpBet(idx) | |
471 | + if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | |
472 | + local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) | |
473 | + local aday = 3600 * 24 | |
474 | + local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | |
475 | + local ctime = crossTime % aday -- 当前在本天 经过多少时间 | |
476 | + | |
477 | + if day > globalCsv.pvp_cross_server_day or ctime >= globalCsv.pvp_cross_server_stop_stake then | |
478 | + return | |
479 | + end | |
480 | + local pvpBet = self:getProperty("pvpBet") | |
481 | + if pvpBet[day] then return end | |
482 | + | |
483 | + local cost = {[ItemId.Gold] = self:getProperty("level") * globalCsv.pvp_cross_bet_pre_level} | |
484 | + if not self:checkItemEnough(cost) then return end | |
485 | + | |
486 | + local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx) | |
487 | + if ok then | |
488 | + if result then | |
489 | + self:costItems(cost) | |
490 | + pvpBet[day] = {idx, cost[ItemId.Gold]} | |
491 | + self:setProperty("pvpBet", pvpBet) | |
492 | + end | |
493 | + return result | |
494 | + else | |
495 | + print(result) | |
496 | + end | |
497 | +end | |
498 | + | |
499 | + | |
500 | + | |
501 | +function Role:packPvpCrossRoleId(servId, roleId) | |
502 | + return roleId * 1000 + servId | |
503 | +end | |
504 | + | |
505 | +function Role:unpackPvpCrossRoleId(tempId) | |
506 | + local servId = tempId % 1000 | |
507 | + local roleId = math.floor(tempId / 1000) | |
508 | + return servId, roleId | |
509 | +end | |
510 | + | |
511 | +-- -- 获取参赛玩家详情 | |
512 | +-- function Role: | |
513 | + | |
514 | + | |
515 | + | |
355 | 516 | end |
356 | 517 | |
357 | 518 | ... | ... |
src/models/RoleTimeReset.lua
... | ... | @@ -34,6 +34,10 @@ ResetFunc["PvpShop"] = function(self, notify, response) |
34 | 34 | response.pvpShop = {} |
35 | 35 | end |
36 | 36 | |
37 | +ResetFunc["PvpCross"] = function(self, notify, response) | |
38 | + self:setProperty("pvpBet", {}) | |
39 | +end | |
40 | + | |
37 | 41 | |
38 | 42 | function Role:updateTimeReset(now, notify) |
39 | 43 | local timeReset = self:getProperty("timeReset") | ... | ... |
src/models/Rune.lua
... | ... | @@ -71,6 +71,9 @@ end |
71 | 71 | |
72 | 72 | function Rune:generateAttrs() |
73 | 73 | local runeData = csvdb["runeCsv"][self:getProperty("type")][self:getProperty("id")] |
74 | + if not runeData then | |
75 | + print(self:getProperty("type"), self:getProperty("id")) | |
76 | + end | |
74 | 77 | local attrs = "" |
75 | 78 | local typ, value = getRandomValue(runeData.attr1,runeData.range1) |
76 | 79 | attrs = attrs:setv(typ, value) | ... | ... |
src/services/httpweb.lua
... | ... | @@ -94,6 +94,18 @@ local function start() |
94 | 94 | end |
95 | 95 | socket.close(id) |
96 | 96 | end) |
97 | + | |
98 | + -- 注册全服广播 | |
99 | + local channels = {} | |
100 | + for i = 1, 10 do | |
101 | + local channel = datacenter.get("MC_W_CHANNEL" .. i) | |
102 | + if channel then | |
103 | + table.insert(channels, channel) | |
104 | + end | |
105 | + end | |
106 | + if #channels > 0 then | |
107 | + mcast_util.sub_worlds(channels) | |
108 | + end | |
97 | 109 | end |
98 | 110 | |
99 | 111 | local function __init__() | ... | ... |
src/services/logd.lua
... | ... | @@ -75,7 +75,7 @@ function CMD.log(logType, doc, index_suffix) |
75 | 75 | |
76 | 76 | local now = skynet.timex() |
77 | 77 | doc["timestamp"] = now |
78 | - doc["@timestamp"] = os.date("%Y-%m-%d %H:%M:%S", now) | |
78 | + doc["timestamp_f"] = os.date("%Y-%m-%d %H:%M:%S", now) | |
79 | 79 | doc["server"] = serverId |
80 | 80 | |
81 | 81 | -- 自己加好 index | ... | ... |
src/services/pvpd.lua
1 | -local skynet = require "skynet" | |
1 | +skynet = require "skynet" | |
2 | 2 | local json = require("shared.json") |
3 | -local redisproxy = require("shared.redisproxy") | |
3 | +redisproxy = require("shared.redisproxy") | |
4 | 4 | local cluster = require "skynet.cluster" |
5 | - | |
5 | +local serverId = tonumber(skynet.getenv("servId")) | |
6 | +local sharedata = require "skynet.sharedata" | |
7 | +datacenter = require "skynet.datacenter" | |
6 | 8 | require "shared.init" |
7 | 9 | require "utils.init" |
8 | 10 | require "RedisKeys" |
... | ... | @@ -11,10 +13,32 @@ globalCsv = require "csvdata/GlobalDefine" |
11 | 13 | require "GlobalVar" |
12 | 14 | |
13 | 15 | |
16 | +local MatchCache = {} -- 比赛记录 缓存 { [roundIdx] = {{rolesId, rolesId, winId = roleId}, {rolesId, rolesId}}, ... } | |
17 | +local RoleInfo = {} -- 角色信息缓存 {[rolesId] = info} | |
18 | +local pvpInfo = nil | |
19 | + | |
20 | +local ROBOT_SERV_ID = 999 | |
21 | +local function packRoleId(servId, roleId) | |
22 | + return roleId * 1000 + servId | |
23 | +end | |
24 | + | |
25 | +local function unpackRoleId(tempId) | |
26 | + local servId = tempId % 1000 | |
27 | + local roleId = math.floor(tempId / 1000) | |
28 | + return servId, roleId | |
29 | +end | |
14 | 30 | |
31 | +skynet.register_protocol { | |
32 | + name = "role", | |
33 | + id = 13, | |
34 | + pack = skynet.pack, | |
35 | + unpack = skynet.unpack, | |
36 | + dispatch = function(session, address, submethod, ...) | |
37 | + end, | |
38 | +} | |
15 | 39 | |
16 | 40 | |
17 | -function rpcRole(roleId, funcName, ...) | |
41 | +local function rpcRole(roleId, funcName, ...) | |
18 | 42 | local fields = ... |
19 | 43 | local agent = datacenter.get("agent", roleId) |
20 | 44 | if agent and agent.serv then |
... | ... | @@ -33,72 +57,203 @@ function rpcRole(roleId, funcName, ...) |
33 | 57 | end |
34 | 58 | end |
35 | 59 | |
36 | -local function upLoadTeams() | |
37 | - local chatd = cluster.query("center", "chatd") | |
38 | - if not chatd then | |
39 | - return | |
60 | +local function getDBKey() | |
61 | + local resetData = csvdb["time_resetCsv"][TimeReset.PvpCross] | |
62 | + local curRound = math.floor((skynet.timex() - START_RESET_TIME - resetData.start) / resetData.interval) | |
63 | + local idx = 1 | |
64 | + if curRound % 2 == 1 then | |
65 | + idx = 2 | |
40 | 66 | end |
41 | - return pcall(cluster.call, "center", chatd, "test", {serverId = 123, hehe = "asd"}) | |
67 | + return RANK_PVP_HIGHT_KEY[idx] | |
68 | +end | |
69 | + | |
70 | + | |
71 | +local function getStartTime() | |
72 | + local resetData = csvdb["time_resetCsv"][TimeReset.PvpCross] | |
73 | + local curRound = math.floor((skynet.timex() - START_RESET_TIME - resetData.start) / resetData.interval) | |
74 | + local startTime = START_RESET_TIME + curRound * resetData.interval + resetData.start | |
75 | + return startTime | |
42 | 76 | end |
43 | 77 | |
44 | 78 | |
79 | +local CMD = {} | |
80 | + | |
81 | +------------------- 角色调用 -------------------------- | |
82 | + | |
45 | 83 | |
84 | +function CMD.updateRoleInfo(change) | |
85 | + CMD.refreshRoleInfo(change) | |
86 | + local pvpd = cluster.query("center", "pvpd") | |
87 | + if pvpd then | |
88 | + pcall(cluster.call, "center", pvpd, "updateRoleInfo", change) | |
89 | + end | |
90 | +end | |
46 | 91 | |
47 | -local function update() | |
92 | +local function getDayAndTime() | |
93 | + local startTime = getStartTime() | |
48 | 94 | local now = skynet.timex() |
49 | - local resetData = csvdb["time_resetCsv"][TimeReset.PvpCross] | |
50 | - | |
51 | - local oldRound = tonum(redisproxy:hget("pvp_cross", "round"), -100) | |
52 | - | |
53 | - local startTime = START_RESET_TIME + curRound * resetData.interval + resetData.start | |
54 | - local endTime = startTime + (resetData.duration == 0 and resetData.interval or math.min(resetData.interval, resetData.duration)) | |
55 | - local nextStartTime = startTime + resetData.interval | |
56 | - | |
57 | - local updateTime = math.max((nextStartTime - now) / 2, CHECK_PVP_STATUS_INTERVAL) | |
58 | - -- 已经 上传过阵容了 | |
59 | - if curRound ~= oldRound then | |
60 | - -- 跨服竞技场已经结束了 | |
61 | - if now >= endTime then | |
62 | - redisproxy:hset("pvp_cross", "round", curRound) | |
63 | - else | |
64 | - -- 上传信息 | |
65 | - local status, back = upLoadTeams() | |
66 | - if status and back == "success" then --上传成功 | |
67 | - redisproxy:hset("pvp_cross", "round", curRound) | |
68 | - else | |
69 | - updateTime = CHECK_PVP_STATUS_INTERVAL | |
95 | + | |
96 | + local crossTime = now - startTime | |
97 | + local aday = 3600 * 24 | |
98 | + local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | |
99 | + local ctime = crossTime % aday -- 当前在本天 经过多少时间 | |
100 | + | |
101 | + return day, ctime | |
102 | +end | |
103 | + | |
104 | +local function hideMatchInfo() | |
105 | + local day, ctime = getDayAndTime() | |
106 | + local tempMatchCache = {} | |
107 | + if day > globalCsv.pvp_cross_server_day then | |
108 | + return MatchCache | |
109 | + else | |
110 | + for round, tempData in pairs(MatchCache) do | |
111 | + if round == day and ctime < globalCsv.pvp_cross_server_show_result - 1 then | |
112 | + tempMatchCache[round] = {} | |
113 | + for idx, match in pairs(tempData) do | |
114 | + tempMatchCache[round][idx] = { | |
115 | + [1] = match[1], | |
116 | + [2] = match[2], | |
117 | + } | |
118 | + end | |
119 | + elseif round <= day then | |
120 | + tempMatchCache[round] = {} | |
121 | + for idx, match in pairs(tempData) do | |
122 | + tempMatchCache[round][idx] = { | |
123 | + [1] = match[1], | |
124 | + [2] = match[2], | |
125 | + win = match.win, | |
126 | + battleV = { | |
127 | + [match[1]] = (match.teams[match[1]] or {}).battleV, | |
128 | + [match[2]] = (match.teams[match[2]] or {}).battleV, | |
129 | + } | |
130 | + } | |
131 | + end | |
70 | 132 | end |
71 | 133 | end |
72 | 134 | end |
73 | - return updateTime | |
135 | + return tempMatchCache | |
74 | 136 | end |
75 | 137 | |
138 | +local function hideRoleInfo() | |
139 | + local day, ctime = getDayAndTime() | |
140 | + local needInfo = {} | |
141 | + local tempRoleInfo = {} | |
142 | + for pId, roleInfo in pairs(RoleInfo) do | |
143 | + tempRoleInfo[pId] = { | |
144 | + name = roleInfo.name, | |
145 | + level = roleInfo.level, | |
146 | + headId = roleInfo.headId, | |
147 | + } | |
148 | + end | |
149 | + return tempRoleInfo | |
150 | +end | |
76 | 151 | |
77 | -local CMD = {} | |
152 | +function CMD.getMatchInfo() | |
153 | + if not next(MatchCache) then | |
154 | + local pvpd = cluster.query("center", "pvpd") | |
155 | + if pvpd then | |
156 | + local status, result = pcall(cluster.call, "center", pvpd, "getMatchInfo", {serverId = serverId}) | |
157 | + MatchCache = result.matchInfo or {} | |
158 | + RoleInfo = result.roleInfo or {} | |
159 | + end | |
160 | + end | |
78 | 161 | |
79 | -function CMD.start() | |
80 | - -- check_pvp_update() | |
162 | + return {matchInfo = hideMatchInfo(), roleInfo = hideRoleInfo()} | |
81 | 163 | end |
82 | 164 | |
83 | -local function getDBKey() | |
84 | - local resetData = csvdb["time_resetCsv"][TimeReset.PvpCross] | |
85 | - local curRound = math.floor((skynet.timex() - START_RESET_TIME - resetData.start) / resetData.interval) | |
86 | - local idx = 1 | |
87 | - if curRound % 2 == 1 then | |
88 | - idx = 2 | |
165 | +function CMD.getRoleInfo() | |
166 | + if not next(MatchCache) then | |
167 | + CMD.getMatchInfo() | |
89 | 168 | end |
90 | - return RANK_PVP_HIGHT_KEY[idx] | |
169 | + return hideRoleInfo() | |
170 | +end | |
171 | + | |
172 | +function CMD.getRoleDetail(pIds) | |
173 | + if not next(MatchCache) then | |
174 | + CMD.getMatchInfo() | |
175 | + end | |
176 | + local result = {} | |
177 | + for _, pId in ipairs(pIds) do | |
178 | + result[pId] = RoleInfo[pId] | |
179 | + end | |
180 | + return result | |
181 | +end | |
182 | + | |
183 | +function CMD.getMatchRecord(round, matchIdx) | |
184 | + if not next(MatchCache) then | |
185 | + CMD.getMatchInfo() | |
186 | + end | |
187 | + local day, ctime = getDayAndTime() | |
188 | + if round > day or (round == day and ctime < globalCsv.pvp_cross_server_show_result) then return end -- 还么结算 | |
189 | + if not (MatchCache[round] or {})[matchIdx] then return end | |
190 | + return { | |
191 | + videos = MatchCache[round][matchIdx].video, | |
192 | + teams = MatchCache[round][matchIdx].teams, | |
193 | + } | |
91 | 194 | end |
92 | 195 | |
93 | -function CMD.loadRoleInfo(roleIds) | |
196 | +function CMD.getBetInfo() | |
197 | + if not next(MatchCache) then | |
198 | + CMD.getMatchInfo() | |
199 | + end | |
200 | + local day, ctime = getDayAndTime() | |
201 | + local change = false | |
202 | + local lastDay = math.min(day, globalCsv.pvp_cross_server_day) | |
203 | + local betInfo = pvpInfo:getProperty("betInfo") | |
204 | + local betNum = pvpInfo:getProperty("betNum") | |
205 | + for cday = 1, lastDay do | |
206 | + if not betInfo[cday] then | |
207 | + change = true | |
208 | + betInfo[cday] = math.randomInt(1, #(MatchCache[cday] or {1})) | |
209 | + if cday == lastDay then | |
210 | + betNum = {} | |
211 | + end | |
212 | + end | |
213 | + end | |
214 | + if change then | |
215 | + pvpInfo:setProperties({ | |
216 | + betInfo = betInfo, | |
217 | + betNum = betNum | |
218 | + }) | |
219 | + end | |
220 | + | |
221 | + return pvpInfo:getProperties({"betInfo", "betNum"}) | |
222 | +end | |
223 | + | |
224 | +function CMD.setBet(idx) | |
225 | + local day, ctime = getDayAndTime() | |
226 | + if day > globalCsv.pvp_cross_server_day or ctime >= globalCsv.pvp_cross_server_stop_stake then return end | |
227 | + | |
228 | + local betInfo = pvpInfo:getProperty("betInfo") | |
229 | + if not betInfo[day] then return end | |
230 | + | |
231 | + local betNum = pvpInfo:getProperty("betNum") | |
232 | + betNum[idx] = (betNum[idx] or 0) + 1 | |
233 | + pvpInfo:setProperty("betNum", betNum) | |
234 | + return {betNum = betNum} | |
235 | +end | |
236 | + | |
237 | + | |
238 | +-------------------中心服务器 调用---------------------- | |
239 | +function CMD.loadRoles(roleIds) | |
94 | 240 | roleIds = roleIds or {} |
95 | 241 | local infos = {} |
242 | + RoleInfo[serverId] = RoleInfo[serverId] or {} | |
96 | 243 | for _, roleId in ipairs(roleIds) do |
97 | 244 | infos[roleId] = rpcRole(roleId, "pvpHInfo") |
245 | + local temp = {} | |
246 | + for _field, _v in pairs(infos[roleId]) do | |
247 | + if _field ~= "battleInfo" then | |
248 | + temp[_field] = _v | |
249 | + end | |
250 | + end | |
251 | + RoleInfo[packRoleId(serverId, roleId)] = temp | |
98 | 252 | end |
99 | 253 | return infos |
100 | 254 | end |
101 | 255 | |
256 | +-- 新赛季了 清掉缓存 | |
102 | 257 | function CMD.loadTeams() |
103 | 258 | local dbKey = getDBKey() |
104 | 259 | local redret = redisproxy:zrevrange(dbKey, 0, 15) |
... | ... | @@ -106,12 +261,43 @@ function CMD.loadTeams() |
106 | 261 | for _, roleId in ipairs(redret) do |
107 | 262 | table.insert(roleIds, tonumber(roleId)) |
108 | 263 | end |
264 | + MatchCache = {} | |
265 | + RoleInfo = {} | |
266 | + local infos = CMD.loadRoles(roleIds) | |
267 | + pvpInfo:setProperties({ | |
268 | + betInfo = {}, | |
269 | + betNum = {}, | |
270 | + }) | |
271 | + return {roleIds = roleIds, infos = infos} | |
272 | +end | |
109 | 273 | |
110 | - local infos = CMD.loadRoleInfo(roleIds) | |
274 | +-- 刷新缓存 | |
275 | +function CMD.refreshMatchCache(info) | |
276 | + MatchCache = info.matchInfo | |
277 | + RoleInfo = info.roleInfo | |
278 | +end | |
111 | 279 | |
112 | - return {roleIds = roleIds, infos = infos} | |
280 | +-- 刷新 玩家数据 | |
281 | +function CMD.refreshRoleInfo(change) | |
282 | + if not next(RoleInfo) then return end | |
283 | + if RoleInfo[change.id] then | |
284 | + for field, value in pairs(change) do | |
285 | + if field ~= "id" then | |
286 | + RoleInfo[change.id][field] = value | |
287 | + end | |
288 | + end | |
289 | + end | |
113 | 290 | end |
114 | 291 | |
292 | +------------------------------------------------------ | |
293 | +function CMD.start() | |
294 | + redisd = skynet.localname(".REDIS") | |
295 | + pvpInfo = require("models.Pvpd").new({key = "cross:pvpInfo"}) | |
296 | + pvpInfo:load() | |
297 | +end | |
298 | + | |
299 | +--------------------------------------------------------- | |
300 | + | |
115 | 301 | local function __init__() |
116 | 302 | skynet.dispatch("lua", function(_, _, command, ...) |
117 | 303 | local f = CMD[command] |
... | ... | @@ -119,7 +305,8 @@ local function __init__() |
119 | 305 | skynet.ret(skynet.pack(f(...))) |
120 | 306 | end |
121 | 307 | end) |
122 | - redisd = skynet.localname(".REDIS") | |
308 | + csvdb = sharedata.query("csvdata") | |
309 | + | |
123 | 310 | skynet.register(".PVPCROSS") |
124 | 311 | end |
125 | 312 | ... | ... |
src/services/watchdog.lua
... | ... | @@ -68,6 +68,7 @@ function CMD.start(conf) |
68 | 68 | if use_logd == 1 then |
69 | 69 | skynet.call(logd, "lua", "open") |
70 | 70 | end |
71 | + skynet.call(pvpd, "lua", "start") | |
71 | 72 | -- 开启agent状态检测定时器 |
72 | 73 | check_agent_status() |
73 | 74 | -- 创建广播服务 |
... | ... | @@ -83,8 +84,6 @@ function CMD.start(conf) |
83 | 84 | globald = skynet.newservice("services/globald") |
84 | 85 | skynet.call(globald, "lua", "start") |
85 | 86 | |
86 | - pvpd = skynet.newservice("services/pvpd") | |
87 | - cluster.register("pvpd", pvpd) | |
88 | 87 | local servId = tonumber(skynet.getenv("servId")) |
89 | 88 | cluster.open("server" .. servId) |
90 | 89 | end |
... | ... | @@ -120,6 +119,9 @@ skynet.start(function() |
120 | 119 | if use_logd == 1 then |
121 | 120 | logd = skynet.newservice("services/logd") |
122 | 121 | end |
122 | + -- pvp 服务 | |
123 | + pvpd = skynet.newservice("services/pvpd") | |
124 | + cluster.register("pvpd", pvpd) | |
123 | 125 | |
124 | 126 | local poold = skynet.newservice("services/poold") |
125 | 127 | local obj = skynet.call(poold, "lua", "start", pool_size) | ... | ... |