Ah, I guess that means my idea won't work then lol. I tried enabling PB in b3, but it still gives the same error
110916 15:12:13 ERROR "handler WidebanxtremePlugin could not handle event Client Authenticated: TypeError: object of type 'NoneType' has no len() [('b3\\\\parser.pyo', 973, 'handleEvents', None), ('b3\\\\plugin.pyo', 158, 'parseEvent', None), ('G:\\\\UserFiles\\\\NinjaNife\\\\GameServers\\\\TC30418520720240387106885\\\\b3\\\\extplugins\\\\widebanxtreme.py', 68, 'onEvent', None)]"
keep in mind we were discussing earlier about B3 and not about the widebanxtreme plugin. The error you code comes from that plugin. Try to fix the plugin first. Make sure that plugin is meant to work with your game. Try to contact his author for support and advice.
Now, there is no PB on the server itself, so I guess that could still be the problem.. Not sure; I will try to check later.
check the widebanxtreme plugin code and see what it tries to do with the b3 event data.
If b3 doesn't find a PBID when a player connects, what does it send in the EVT_CLIENT_AUTH event? Just 'None' or something else?
See my previous post. EVT_CLIENT_AUTH event data is the
Client object for the authenticated player.
As for the "sleep()" thing, I actually have found that in several of the plugins I use, and if it causes all of b3 to sleep then I should try to fix that. Is there a guide available that explains how to exchange "sleep(5)" for something that won't harm b3's core functions (only sleep the plugin/section of code)? Thanks for all the help!
There are plenty of cases where you can use sleep. Just don't use it in onEvent() in your plugins. Here how B3 dispatches an event :
Thread 1 - read game log :- B3 read a line from the game server log file and create a B3 event which is queued
- B3 reads an other game log line, etc
Thread 2 - dispatches events to plugins :- Take a B3 event off the queue
- If event is too old, log error "'**** Event sat in queue too long", discard and get an other one
- Find out the list of plugins interested in that event
- Sort that list given the plugin priority (defined by the order plugins are read from b3.xml)
- For all plugins in that list :
- * if plugin is disable, discard and go to the next one
- * call the plugin onEvent() method with the B3 event as a parameter
- * wait for the plugin onEvent() method to return
- once all plugins have made their action on that event, go get an other one off the queue
You see that if a plugin is too long to treat an event then this same event is passed to the next plugin late.
Only when all plugins listening for that event have finished does Thread 2 start working on the next event, in the meantime Thread 1 continues to pile up new fresh event into the queue.
That's why it is important to return from plugin onEvent() method as soon as the plugin can.
It is a race of Thread 2 against Thread 1. Thread 2 must keep up with the rythme of Thread 1 or some events will be discarded
Here is the code that handles the pbid after it is received:
if len(event.client.pbid) > 0 and event.client.pbid is not None and event.client.pbid != 'None':
I assume this is code from the widebanxtrem plugin ? Given the error
110914 21:35:20 ERROR "handler WidebanxtremePlugin could not handle event Client Authenticated: TypeError: object of type 'NoneType' has no len() [('b3\\\\parser.pyo', 973, 'handleEvents', None), ('b3\\\\plugin.pyo', 158, 'parseEvent', None), ('G:\\\\UserFiles\\\\MW2\\\\GameServers\\\\TC37353467860442667146473\\\\b3\\\\extplugins\\\\widebanxtreme.py', 79, 'onEvent', None)]"
It is safe to say that python does not like when one asks him to compute the length of something which is None. If we know that in some cases it is normal to find a None value, then we should first check that that value is not None
before computing the length. Try this change :
if event.client.pbid is not None and len(event.client.pbid) > 0 and event.client.pbid != 'None':