[[project @ 2002-07-24 03:05:06 by unknown_lamer] unknown_lamer**20020724030506 Lots of changes, look at the ChangeLog. Most notable is that the Hooks system actually works now. ] { hunk ./AUTHORS 8 -unknown_lamer on OpenProjects +unknown_lamer on OpenProjects and OFTC + hunk ./ChangeLog 1 +2002-07-23 Clinton Ebadi + + * source/BotInterp.H (Hook<): Changed behavior of Hook's <. If a + hook is greater than or less than the other hook, only the + priority is considered. However, if both hooks have the same + priority, then the fallthru-ness is considered, with fallthru + hooks being greater than non-fallthru hooks. + + * source/BotInterp.C (hptr_lt): Added this static function to be + used to sort the hooks list (now hooks should be sorted using + Hook's operator < instead of using pointer comparision, meaning + the new hook system will work correctly) + + * scripts/bobot-utils.scm: Make bot:log use for-each instead of + map because we don't need the result of the displays (this would + just be a list of # values and is a waste of memory). + hunk ./NEWS 1 --*- text -*- -As of version 1.98 unknown_lamer is the new maintainer. -Also as of version 1.98, you must have Guile 1.5.6+ or 1.6.x in order -to compile scripting support. +====================================================================== +====== This is a -*- text -*- file and =============================== +====== User Visible Changes In Bobot++ =============================== +====================================================================== + +IMPORTANT NOTE: ++====================================================================+ +| As of version 1.98 unknown_lamer is the new maintainer. | +| Also as of version 1.98, you must have Guile 1.5.6+ or 1.6.x in | +| order to compile scripting support. | ++====================================================================+ + +===================================================================== +====== The News ===================================================== +===================================================================== hunk ./TODO 31 -* Add Channel logging (log full text of channel if enabled) - - maybe do this as a script (log.scm) + - Note that Socket will have a buffer overflow problem with DCC + because it uses a buffer of 512 characters, and a DCC line is not + limited to 512 chars like an IRC line is. The question is: should + I rewrite readLine to be more general (allocate buffer on the + fly) or rename readLine to ircReadLine and add a more general + readLine? I think I could use a static std::string and have it + grow as needed, with a default size of 512. +* Add Channel logging (log full text of channel if enabled) script hunk ./TODO 41 -Config: (maybe) -* Change bot.conf syntax (just load it with guile) -(set-cmdchar #\!) -(set-name "DumbBot") -(set-userlist "bot.users") -(set-shitlist "bot.shit") -(set-logfile "bot.log") - -(add-server "irc.openprojects.net") -(add-server "trollaxor.com") - -(add-channel "#bobot") ; all networks - -;;; note that (add-server) would be a macro that defines -;;; a symbol for the network -(server-add-channel irc.openprojects.net "#umbclinux:::") -(server-add-channel irc.openprojects.net "#tpu:::") -;;; add-channels just maps args to server-add-channel -(server-add-channels trollaxor.com "#trolls:::" "#crapflooders:::") -(server-set-name trollaxor.com "TrollBot") - - - Support per-server channels, logfiles, cmdchars, everything... - hunk ./TODO 42 -- Work on Texinfo manual (including scripting section) +* Work on Texinfo manual (especially scripting section) hunk ./bobot++.info 184 -hooks are executed before non-fallthrough hooks. A fallthrough hook can -match and processing of hooks will continue; as soon as the first -non-fallthrough hooks matches processing of hooks stops. +hooks are executed before non-fallthrough hooks of the same priority. A +fallthrough hook can match and processing of hooks will continue; as +soon as the first non-fallthrough hooks matches processing of hooks +stops. hunk ./bobot++.info 483 -Node: Creating a Hook6720 -Node: Hook Types7512 -Node: Scheme User Levels9985 -Node: Sending Messages11114 -Node: High Level Message Functions11682 -Node: Low Level Message Functions11900 -Node: Concept Index12659 -Node: Function Index12841 -Node: Variable Index13102 +Node: Creating a Hook6741 +Node: Hook Types7533 +Node: Scheme User Levels10006 +Node: Sending Messages11135 +Node: High Level Message Functions11703 +Node: Low Level Message Functions11921 +Node: Concept Index12680 +Node: Function Index12862 +Node: Variable Index13123 hunk ./bobot++.texinfo 192 -and fallthrough hooks are executed before non-fallthrough hooks. A -fallthrough hook can match and processing of hooks will continue; as -soon as the first non-fallthrough hooks matches processing of hooks -stops. +and fallthrough hooks are executed before non-fallthrough hooks of the +same priority. A fallthrough hook can match and processing of hooks +will continue; as soon as the first non-fallthrough hooks matches +processing of hooks stops. hunk ./scripts/bobot-utils.scm 9 -;;; because you are really linking with Bobot++, a GPLed program! +;;; because you are really linking with Bobot++, a GPLed program. hunk ./scripts/bobot-utils.scm 56 - (map + (for-each hunk ./source/Bot.C 85 -#if HAVE_IOSBASE - logFile.open(logs_dir + logFileName, std::ios_base::out | - std::ios_base::ate | std::ios_base::app); -#else - logFile.open(logs_dir + logFileName, ios::out | ios::ate - | ios::app); -#endif - logLine("Starting log."); + set_log_dir (logs_dir); + set_log_file (logFileName); + + hunk ./source/Bot.C 248 - logFileName = parameters; + { + if (parameters[0] == '/') + { + set_log_dir ("/"); + set_log_file (parameters.subString (1)); + } + else + set_log_file (parameters); + } hunk ./source/Bot.C 676 + +void +Bot::set_log_file (String name) +{ + logFileName = name; +#if HAVE_IOSBASE + logFile.open(logs_dir + logFileName, std::ios_base::out | + std::ios_base::ate | std::ios_base::app); +#else + logFile.open(logs_dir + logFileName, ios::out | ios::ate + | ios::app); +#endif + + logLine("Starting log."); +} + +void +Bot::set_log_dir (String dir) +{ + logs_dir = dir; +} hunk ./source/Bot.H 140 + // getters and setters + void set_log_dir (String); + void set_log_file (String); hunk ./source/BotInterp.C 64 +namespace +{ + bool hptr_lt (const Hook* h, const Hook* h1) + // Hook Pointer less than + // Used to sort the Hooks list + { return *h < *h1; } +} + hunk ./source/BotInterp.C 85 + hunk ./source/BotInterp.C 94 - hooksMap[hooktype].sort (); + hooksMap[hooktype].sort (hptr_lt); hunk ./source/BotInterp.C 100 - hooksMap[hooktype].sort (); + hooksMap[hooktype].sort (hptr_lt); hunk ./source/BotInterp.H 49 - if (fallthru && h.fallthru) - return priority < h.priority; - // fallthru-thru is > non-fallthru thru ALWAYS + if (priority < h.priority) + return true; + else if (priority > h.priority) + return false; + else if (fallthru && h.fallthru) + return false; hunk ./source/BotInterp.H 59 - else - return priority < h.priority; }