From: <arn...@us...> - 2007-12-09 18:53:21
|
Revision: 100 http://adchpp.svn.sourceforge.net/adchpp/?rev=100&view=rev Author: arnetheduck Date: 2007-12-09 10:53:20 -0800 (Sun, 09 Dec 2007) Log Message: ----------- Add correct client types to lua script 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-09 18:44:45 UTC (rev 99) +++ adchpp/trunk/plugins/Script/examples/access.lua 2007-12-09 18:53:20 UTC (rev 100) @@ -290,9 +290,11 @@ end if user.level > 1 then - cmd:addParam("OP1") + cmd:addParam("CT4") + cmd:addParam("OP1") -- old name else - cmd:addParam("RG1") + cmd:addParam("CT2") + cmd:addParam("RG1") -- old name end if not cm:verifyINF(c, cmd) then @@ -349,7 +351,7 @@ reply(c, "Welcome back") cm:enterNormal(c, true, true) - if user.level > 1 and c:supports("UCMD") then + if user.level > 1 and (c:supports("UCMD") or c:supports("UCM0") then for k, v in pairs(user_commands) do ucmd = adchpp.AdcCommand(adchpp.AdcCommand_CMD_CMD, adchpp.AdcCommand_TYPE_INFO, adchpp.AdcCommand_HUB_SID) ucmd:addParam(k) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-28 14:27:56
|
Revision: 113 http://adchpp.svn.sourceforge.net/adchpp/?rev=113&view=rev Author: arnetheduck Date: 2007-12-28 06:27:54 -0800 (Fri, 28 Dec 2007) Log Message: ----------- Script fix 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-26 14:55:44 UTC (rev 112) +++ adchpp/trunk/plugins/Script/examples/access.lua 2007-12-28 14:27:54 UTC (rev 113) @@ -438,28 +438,28 @@ if command == "test" then reply(c, "Test ok") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND elseif command == "error" then xxxxyyyy() - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND elseif command == "help" then reply(c, "+test, +help, +regme password, +regnick nick password level") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND elseif command == "regme" then if not parameters:match("%S+") then reply(c, "You need to supply a password without whitespace") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end register_user(c:getCID():toBase32(), c:getField("NI"), parameters, 1) reply(c, "You're now registered") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND elseif command == "regnick" then local nick, password, level = parameters:match("^(%S+) (%S+) (%d+)") if not nick or not password or not level then reply(c, "You must supply nick, password and level!") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end level = tonumber(level) @@ -475,17 +475,17 @@ if not my_user then reply(c, "Only registered users may register others") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end if level >= my_user.level then reply(c, "You may only register to a lower level than your own") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end if level < 1 then reply(c, "Level too low") - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end register_user(cid, nick, password, level) @@ -496,7 +496,7 @@ reply(other, "You've been registered with password " .. password) end - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND elseif command == "stats" then local now = os.time() local scripttime = os.difftime(now, start_time) @@ -537,7 +537,7 @@ str = str .. recvCalls .. "\tReceive calls (" .. adchpp.Util_formatBytes(recvBytes/recvCalls) .. "/call)\n" reply(c, str) - return adchpp.AdcCommand_DONT_SEND + return adchpp.ClientManager_DONT_SEND end return 0 @@ -558,6 +558,7 @@ end local function onReceive(c, cmd, override) + cmdstr = cmd:getCommandString() if stats[cmdstr] then stats[cmdstr] = stats[cmdstr] + 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <arn...@us...> - 2007-12-28 14:53:39
|
Revision: 115 http://adchpp.svn.sourceforge.net/adchpp/?rev=115&view=rev Author: arnetheduck Date: 2007-12-28 06:53:35 -0800 (Fri, 28 Dec 2007) Log Message: ----------- Access example fix 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:51:53 UTC (rev 114) +++ adchpp/trunk/plugins/Script/examples/access.lua 2007-12-28 14:53:35 UTC (rev 115) @@ -15,7 +15,7 @@ -- Users with level lower than the specified will not be allowed to run command at all local command_min_levels = { --- [adchpp.AdcCommand.CMD_MSG] = 2 + [adchpp.AdcCommand_CMD_MSG] = 2 } -- Regexes for the various fields. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2007-12-28 15:35:36
|
Revision: 116 http://adchpp.svn.sourceforge.net/adchpp/?rev=116&view=rev Author: arnetheduck Date: 2007-12-28 07:35:31 -0800 (Fri, 28 Dec 2007) Log Message: ----------- Don't disable msg by default 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:53:35 UTC (rev 115) +++ adchpp/trunk/plugins/Script/examples/access.lua 2007-12-28 15:35:31 UTC (rev 116) @@ -15,7 +15,7 @@ -- Users with level lower than the specified will not be allowed to run command at all local command_min_levels = { - [adchpp.AdcCommand_CMD_MSG] = 2 +-- [adchpp.AdcCommand_CMD_MSG] = 2 } -- Regexes for the various fields. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arn...@us...> - 2008-01-06 19:18:39
|
Revision: 126 http://adchpp.svn.sourceforge.net/adchpp/?rev=126&view=rev Author: arnetheduck Date: 2008-01-06 11:18:26 -0800 (Sun, 06 Jan 2008) Log Message: ----------- fix pm context Modified Paths: -------------- adchpp/trunk/plugins/Script/examples/access.lua Modified: adchpp/trunk/plugins/Script/examples/access.lua =================================================================== --- adchpp/trunk/plugins/Script/examples/access.lua 2008-01-06 11:01:13 UTC (rev 125) +++ adchpp/trunk/plugins/Script/examples/access.lua 2008-01-06 19:18:26 UTC (rev 126) @@ -54,7 +54,7 @@ local context_hub = "[H]" local context_bcast = "[BF]" local context_direct = "[DE]" -local context_send = "[BFD]" +local context_send = "[BFDE]" local context_hubdirect = "[HDE]" local command_contexts = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |