| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- ----------------------------------------------
- -- 跨服协议白名单
- ----------------------------------------------
- local ProtoId = require("common.ProtoID")
- local t = {
- "CG_AA_DISCONNECT",
- "CG_ASK_LOGIN",
- "CG_CHAT",
- "CG_HEART_BEAT",
- "CG_HEART_BEAT_M",
- "CG_MIDDLE_LOGIN",
- "CG_MIDDLE_LOGOUT",
- "CG_MIDDLE_PLAYING_STATUS",
- }
- local hash = {}
- for k, v in pairs(ProtoId) do
- if type(k) == "number" and string.sub(v, 1, 1) == "C" then
- if hash[v] then
- assert()
- end
- hash[v] = k
- end
- end
- local permit = {}
- for k, v in ipairs(t) do
- local id = hash[v]
- if not id then
- assert(nil, v)
- end
- if permit[id] then
- assert(nil, v .. " not unique")
- end
- permit[id] = true
- end
- function isPermit(protoID)
- if permit[protoID] then
- return true
- end
- end
|