From: <arn...@us...> - 2007-12-28 14:51:56
|
Revision: 114 http://adchpp.svn.sourceforge.net/adchpp/?rev=114&view=rev Author: arnetheduck Date: 2007-12-28 06:51:53 -0800 (Fri, 28 Dec 2007) Log Message: ----------- More script fixes Modified Paths: -------------- adchpp/trunk/plugins/Script/examples/access.lua Modified: adchpp/trunk/plugins/Script/examples/access.lua =================================================================== --- adchpp/trunk/plugins/Script/examples/access.lua 2007-12-28 14:27:54 UTC (rev 113) +++ adchpp/trunk/plugins/Script/examples/access.lua 2007-12-28 14:51:53 UTC (rev 114) @@ -96,6 +96,8 @@ local cm = adchpp.getCM() +function hasbit(x, p) return x % (p + p) >= p end + local function load_users() users.cids = { } users.nicks = { } @@ -424,7 +426,7 @@ local function onMSG(c, cmd) msg = cmd:getParam(0) local command, parameters = msg:match("^%+(%a+) ?(.*)") - + if not command then return 0 end @@ -514,8 +516,8 @@ str = str .. "\nDisconnect reasons: \n" for k, v in pairs(adchpp) do - if k:sub(1, 7) == "REASON_" and k ~= "REASON_LAST" then - str = str .. adchpp.size_t_getitem(adchpp.Util_reasons, adchpp[k]) .. "\t" .. k .. "\n" + if k:sub(1, 12) == "Util_REASON_" and k ~= "Util_REASON_LAST" then + str = str .. adchpp.size_t_getitem(adchpp.Util_reasons, adchpp[k]) .. "\t" .. k:sub(6) .. "\n" end end @@ -558,7 +560,6 @@ end local function onReceive(c, cmd, override) - cmdstr = cmd:getCommandString() if stats[cmdstr] then stats[cmdstr] = stats[cmdstr] + 1 @@ -566,7 +567,7 @@ stats[cmdstr] = 1 end - if override > 0 then + if hasbit(override, adchpp.ClientManager_DONT_DISPATCH) then return 0 end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |