raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

onUserList event not fired when server responds with channel list. #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Override the onUserList event in a listener.
2. Connect to a server and join a channel.
3. The onUserList method is never called.

What is the expected output? What do you see instead?
The onUserList method should be called when the bot joins the channel, causing 
the Channel object to be populated.

Instead, the method is not called (no UserListEvent is created at all). This 
causes the Channel object to have an incorrect state (i.e. no data about users 
in the channel).

What version of the product are you using? On what operating system?
- PircbotX 1.7 (from Maven)
- Windows 8 release preview
- java version "1.7.0_09"
- Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
- Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode) 

Please provide any additional information below.
This appears to be a regression from version 1.6 of PircBotX (switching the 
maven dependency in the pom.xml to 1.6 and recompiling seems to resolve the 
problem).

Original issue reported on code.google.com by w.gray.m...@gmail.com on 29 Oct 2012 at 9:13

GoogleCodeExporter commented 9 years ago
Strange, I've tested both the current dev version and 1.7 and both of them give 
me a user list. Note that the user list is built with a WHO reply as it has the 
most detailed information, do you see on in the logs? Also, do you happen to be 
using a custom Listener Manager?

If not, can you attach the logs that shows your problem and some example code?

Original comment by Lord.Qua...@gmail.com on 30 Oct 2012 at 12:32

GoogleCodeExporter commented 9 years ago
Thanks for looking into this. I have attached the server interactions from both 
1.6 and 1.7 releases of PircBotX.

I am not using a custom ListenerManager (I believe that the default is now 
ThreadedListenerManager?).

It appears that the WHO line is not being sent to the server in the 1.7 
version, as such, the server never responds with the users in the channel 
(other than the NAMES response on join).

Original comment by w.gray.m...@gmail.com on 30 Oct 2012 at 10:07

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to say that the project is on GitHub if you need to take a look at the 
source.

https://github.com/SL5R0/QBot/

The main implementation is at:
https://github.com/SL5R0/QBot/blob/master/src/main/java/org/sl5r0/qbot/QBot.java

Original comment by w.gray.m...@gmail.com on 30 Oct 2012 at 10:09

GoogleCodeExporter commented 9 years ago
Sorry for the delay, I've been very busy lately

Since its been so long and I've got some free time I download your project and 
started playing around with it. And it seems to be working for me (see 
attached) on both your server and freenode. So I'm not sure what is going on, 
but I would review your own code and make sure your calling it right

If your interested in any advice I noticed some things when I was poking around
 - In QBotConfiguration I doubt you wanted to use com.sun.istack.internal.Nullable, you were probably looking for javax.annotation.Nullable. This is provided by projects like http://code.google.com/p/jsr-305/ and IIRC the J2EE distribution of Java (which is generally what people use if they want @Nullable).
 - It seems when you create a listener your passing a bot instance. This is generally not how your supposed to get the bot in a Listener, your usually supposed to use event.getBot() (and use generics if you want your bot class without casting). This is explained in http://code.google.com/p/pircbotx/wiki/EventSystemExplained#Custom_Bots_%28NEW!!%29 
 - Not sure if you just haven't finished the plugin handling yet, but I noticed that it wouldn't add my Listener unless I specified it both in PluginManager.loadCorePlugins() and the config.xml file. 

Other than that looks like a promising project!

Original comment by Lord.Qua...@gmail.com on 30 Nov 2012 at 3:49

Attachments: