[SimBot-commits] CVS: simbot simbot.pl,1.120,1.121
Status: Abandoned
Brought to you by:
kstange
|
From: Pete P. <fou...@us...> - 2005-06-20 02:00:03
|
Update of /cvsroot/simbot/simbot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13352 Modified Files: simbot.pl Log Message: We now fire the unload event for the plugins when we get disconnected from the server and are quitting, instead of when we send the quit command or get klined. This should (might?) fix a crash should simbot get a message after beginning to quit. It also removes a bit of code duplication. Index: simbot.pl =================================================================== RCS file: /cvsroot/simbot/simbot/simbot.pl,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -p -r1.120 -r1.121 --- simbot.pl 6 Jun 2005 22:16:17 -0000 1.120 +++ simbot.pl 20 Jun 2005 01:59:54 -0000 1.121 @@ -1929,6 +1929,12 @@ sub irc_disconnected { &debug(3, "Disconnected!\n"); $kernel->post(bot => unregister => "all"); + + # Everyone out of the pool! + foreach(keys(%event_plugin_unload)) { + &plugin_callback($_, $event_plugin_unload{$_}); + } + # since the event loop should soon have nothing to do # it'll exit. Or something like that. } else { @@ -1966,10 +1972,6 @@ sub server_banned { if(!@{$conf{'network'}{'server'}}) { # hmm... we've removed our last server &debug(1, "No more servers to connect to! Please add some to config.ini.\n"); - # Everyone out of the pool! - foreach(keys(%event_plugin_unload)) { - &plugin_callback($_, $event_plugin_unload{$_}); - } $terminating=100; } @@ -2001,11 +2003,6 @@ sub quit_session { $terminating = 1 unless $terminating > 1; - # Everyone out of the pool! - foreach(keys(%event_plugin_unload)) { - &plugin_callback($_, $event_plugin_unload{$_}); - } - $kernel->post(bot => quit => PROJECT . " " . VERSION . (($message ne "") ? ": $message" : "")); &debug(3, "Disconnecting from IRC... $message\n"); |